package WEB-INF.classes.wenrgise.common.businessdelegate;

import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
import javax.ejb.CreateException;
import wenrgise.common.bean.EmpInfoBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.facade.SecurityFacade;
import wenrgise.ejb.common.facade.SecurityFacadeHome;
import wenrgise.ejb.common.utility.ServiceLocator;

public class SecurityBD {
  public HashMap getDisabledFields(String sScreenName, String sHdrDtlFlag, String sSreenMode, String sPageStatus) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException {
    try {
      SecurityFacadeHome oHome = (SecurityFacadeHome)ServiceLocator.getLocator().getService("HrmSecurityFacade");
      SecurityFacade oSecFacade = oHome.create();
      return oSecFacade.getDisabledFields(sScreenName, sHdrDtlFlag, sSreenMode, sPageStatus);
    } catch (CreateException oCex) {
      throw new EnrgiseApplicationException("wenrgise.common.internal");
    } 
  }
  
  public ArrayList getTreeSet(EmpInfoBean oEmpInfoBean) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException {
    try {
      SecurityFacadeHome oHome = (SecurityFacadeHome)ServiceLocator.getLocator().getService("HrmSecurityFacade");
      SecurityFacade oSecFacade = oHome.create();
      return oSecFacade.addMenuList(oEmpInfoBean);
    } catch (CreateException oCex) {
      throw new EnrgiseApplicationException("wenrgise.common.internal");
    } 
  }
  
  public HashMap getAccessInfo(EmpInfoBean oEmpInfoBean) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException {
    try {
      SecurityFacadeHome oHome = (SecurityFacadeHome)ServiceLocator.getLocator().getService("HrmSecurityFacade");
      SecurityFacade oSecFacade = oHome.create();
      return oSecFacade.getAccessInfo(oEmpInfoBean);
    } catch (CreateException oCex) {
      throw new EnrgiseApplicationException("wenrgise.common.internal");
    } 
  }
}
