package wenrgise.hrms.ejb.facade;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.hrms.bean.HrmGenEligRuleHdrBean;
import wenrgise.hrms.bean.HrmGenEligRuleQueryHdrBean;
import wenrgise.hrms.ejb.business.HrmGenEligRuleBO;
import wenrgise.hrms.ejb.business.HrmGenEligRuleQueryBO;
import wenrgise.hrms.vo.HrmGenEligRuleQVO;
import wenrgise.hrms.vo.HrmGenEligRuleQueryQVO;

public class HrmEligibilityFacadeBean implements SessionBean {
  SessionContext ctx;
  
  public void ejbCreate() {}
  
  public void ejbActivate() {}
  
  public void ejbPassivate() {}
  
  public void ejbRemove() {}
  
  public void setSessionContext(SessionContext ctx) {
    this.ctx = ctx;
  }
  
  public RecordMetaInfo getHrmGenEligRuleHdrMetaInfo(HrmGenEligRuleQVO oHrmGenEligRuleQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmGenEligRuleBO oHrmGenEligRuleBO = new HrmGenEligRuleBO();
    return oHrmGenEligRuleBO.getHrmGenEligRuleHdrMetaInfo(oHrmGenEligRuleQVO);
  }
  
  public ArrayList getHrmGenEligRuleHeaderInfo(HrmGenEligRuleQVO oHrmGenEligRuleQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmGenEligRuleBO oHrmGenEligRuleBO = new HrmGenEligRuleBO();
    return oHrmGenEligRuleBO.getHrmGenEligRuleHeaderInfo(oHrmGenEligRuleQVO, lStartPosition, lLastPosition);
  }
  
  public HashMap getEligClassInfo() throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmGenEligRuleBO oHrmGenEligRuleBO = new HrmGenEligRuleBO();
    return oHrmGenEligRuleBO.getEligClassInfo();
  }
  
  public String saveData(HrmGenEligRuleHdrBean oHrmEligibilityRuleHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmGenEligRuleBO oHrmGenEligRuleBO = new HrmGenEligRuleBO(oUserInfo);
      return oHrmGenEligRuleBO.saveData((BaseHeaderBean)oHrmEligibilityRuleHdrBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
    } catch (EnrgiseSystemException oSysEx) {
      this.ctx.setRollbackOnly();
      throw oSysEx;
    } catch (EnrgiseApplicationException oAppEx) {
      this.ctx.setRollbackOnly();
      throw oAppEx;
    } 
  }
  
  public RecordMetaInfo getHrmGenEligRuleQueryDetailMetaInfo(HrmGenEligRuleQueryQVO oQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmGenEligRuleQueryBO oHrmGenEligRuleQueryBO = new HrmGenEligRuleQueryBO();
    return oHrmGenEligRuleQueryBO.getHrmGenEligRuleQueryDetailMetaInfo((BaseQueryVO)oQVO);
  }
  
  public ArrayList getHrmGenEligRuleQueryDetail(HrmGenEligRuleQueryQVO oQVO, long lAbsoluteStart, long lAbsoluteEnd) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmGenEligRuleQueryBO oHrmGenEligRuleQueryBO = new HrmGenEligRuleQueryBO();
    return oHrmGenEligRuleQueryBO.getHrmGenEligRuleQueryDetail((BaseQueryVO)oQVO, lAbsoluteStart, lAbsoluteEnd);
  }
  
  public String saveData(HrmGenEligRuleQueryHdrBean oHrmGenEligRuleQueryHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmGenEligRuleQueryBO oHrmGenEligRuleQueryBO = new HrmGenEligRuleQueryBO(oUserInfo);
      return oHrmGenEligRuleQueryBO.saveData((BaseHeaderBean)oHrmGenEligRuleQueryHdrBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
    } catch (EnrgiseSystemException oSysEx) {
      this.ctx.setRollbackOnly();
      throw oSysEx;
    } catch (EnrgiseApplicationException oAppEx) {
      this.ctx.setRollbackOnly();
      throw oAppEx;
    } 
  }
}
