package wenrgise.hrms.ejb.facade;

import java.sql.Timestamp;
import java.util.ArrayList;
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.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.hrms.bean.HrmLnAppHdrBean;
import wenrgise.hrms.bean.HrmLnChartHdrBean;
import wenrgise.hrms.bean.HrmLnMstHdrBean;
import wenrgise.hrms.bean.HrmMediclaimMasterHdrBean;
import wenrgise.hrms.ejb.business.HrmLnAppBO;
import wenrgise.hrms.ejb.business.HrmLnChartBO;
import wenrgise.hrms.ejb.business.HrmLnMstBO;
import wenrgise.hrms.ejb.business.HrmMediclaimMasterBO;
import wenrgise.hrms.vo.HrmLnAppQVO;
import wenrgise.hrms.vo.HrmLnChartQVO;
import wenrgise.hrms.vo.HrmLnMstQVO;
import wenrgise.hrms.vo.HrmMediclaimMasterQVO;

public class HrmLoanFacadeBean 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 getHrmLoanMstHeaderMetaInfo(HrmLnMstQVO oHrmLoanMstQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oHrmLoanMstBusinessObject = new HrmLnMstBO();
    return oHrmLoanMstBusinessObject.getHrmLoanMstHdrMetaInfo(oHrmLoanMstQueryVO);
  }
  
  public ArrayList getHrmLoanMstHeaderInfo(HrmLnMstQVO oHrmLoanMstQueryVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oHrmLoanMstBusinessObject = new HrmLnMstBO();
    return oHrmLoanMstBusinessObject.getHrmLoanMstHeaderInfo(oHrmLoanMstQueryVO, lStartPosition, lLastPosition);
  }
  
  public RecordMetaInfo getHrmLoanMstDetailMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oHrmLoanMstBusinessObject = new HrmLnMstBO();
    return oHrmLoanMstBusinessObject.getHrmLoanMstDetailMetaInfo(lPrimaryKey);
  }
  
  public ArrayList getHrmLoanMstDetail(String lPrimaryKey, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oHrmLoanMstBusinessObject = new HrmLnMstBO();
    return oHrmLoanMstBusinessObject.getHrmLoanMstDetailInfo(lPrimaryKey, lStartPosition, lLastPosition);
  }
  
  public ArrayList getHrmCurLoanMstDetail() throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oHrmLoanMstBusinessObject = new HrmLnMstBO();
    return oHrmLoanMstBusinessObject.getHrmCurLoanMstDetailInfo();
  }
  
  public LovVO getHrmLoanDetailLOVInfo(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oHrmLoanMstBusinessObject = new HrmLnMstBO();
    return oHrmLoanMstBusinessObject.getHrmLoanDetailLOVInfo(oLovQueryVO);
  }
  
  public LovVO getHrmLoanCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oLoanChart = new HrmLnMstBO();
    LovVO oLovVO = oLoanChart.getHrmLoanCodeLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmChartNameLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO LoanMaster = new HrmLnMstBO();
    LovVO oLovVO = LoanMaster.getHrmChartNameLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmLoanCodeLOVdataNew(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO LoanMaster = new HrmLnMstBO();
    LovVO oLovVO = LoanMaster.getHrmLoanCodeLOVdataNew(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmChartNameLOVdataNew(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO LoanMaster = new HrmLnMstBO();
    LovVO oLovVO = LoanMaster.getHrmChartNameLOVdataNew(oLovQueryVO);
    return oLovVO;
  }
  
  public String saveData(HrmLnMstHdrBean oHrmLnMstHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oLoanMaster = new HrmLnMstBO(oUserInfo);
    return oLoanMaster.saveData((BaseHeaderBean)oHrmLnMstHdrBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
  }
  
  public void updateLoanMst(String sSql, String sId, String sUserId, String sUserSiteId) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnMstBO oLoanMasterBusinessObject = new HrmLnMstBO();
    oLoanMasterBusinessObject.updateLoanMst(sSql, sId, sUserId, sUserSiteId);
  }
  
  public RecordMetaInfo getHrmLoanChartHdrMetaInfo(HrmLnChartQVO oHrmLnChartQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnChartBO oHrmLnChartBO = new HrmLnChartBO();
    return oHrmLnChartBO.getHrmLoanChartHdrMetaInfo(oHrmLnChartQVO);
  }
  
  public ArrayList getHrmLoanChartHdrInfo(HrmLnChartQVO oHrmLnChartQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnChartBO oHrmLnChartBO = new HrmLnChartBO();
    return oHrmLnChartBO.getHrmLoanChartHdrInfo(oHrmLnChartQVO, lStartPosition, lLastPosition);
  }
  
  public RecordMetaInfo getHrmLoanChartDetailMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnChartBO oHrmLnChartBO = new HrmLnChartBO();
    return oHrmLnChartBO.getHrmLoanChartDetailMetaInfo(lPrimaryKey);
  }
  
  public ArrayList getHrmLoanChartDetailInfo(String lPrimaryKey, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnChartBO oHrmLnChartBO = new HrmLnChartBO();
    return oHrmLnChartBO.getHrmLoanChartDetailInfo(lPrimaryKey, lStartPosition, lLastPosition);
  }
  
  public LovVO getHrmLoanChartNameLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnChartBO oLoanChart = new HrmLnChartBO();
    LovVO oLovVO = oLoanChart.getHrmLoanChartNameLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public String saveData(HrmLnChartHdrBean oHrmLnChartHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmLnChartBO oHrmLnChartBO = new HrmLnChartBO(oUserInfo);
      return oHrmLnChartBO.saveData((BaseHeaderBean)oHrmLnChartHdrBean, 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 getHrmLoanAppHdrMetaInfo(HrmLnAppQVO oHrmLnAppQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrEmpLoanAppHdrMetaInfo(oHrmLnAppQVO);
  }
  
  public ArrayList getHrmLoanAppHdrInfo(HrmLnAppQVO oHrmLnAppQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrEmpLoanAppHeader(oHrmLnAppQVO, lStartPosition, lLastPosition);
  }
  
  public RecordMetaInfo getHrmLnAppDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrmLnAppDtlMetaInfo(lPrimaryKey);
  }
  
  public RecordMetaInfo getHrmLnDisDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrmLnDisDtlMetaInfo(lPrimaryKey);
  }
  
  public RecordMetaInfo getHrmLnHblIntRateMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrmLnHblIntRateMetaInfo(lPrimaryKey);
  }
  
  public ArrayList getHrmLnAppDtl(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrmLnAppDtl(lPrimaryKey, lStartPosition, lLastPosition);
  }
  
  public ArrayList getHrmLnDisDtl(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrmLnDisDtl(lPrimaryKey, lStartPosition, lLastPosition);
  }
  
  public ArrayList getHrmLnHblIntRateDtl(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppBO.getHrmLnHblIntRateDtl(lPrimaryKey, lStartPosition, lLastPosition);
  }
  
  public String loanAppBulkPayment(HrmLnAppHdrBean oHrmLnAppHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
    return oHrmLnAppHdrBean.getHeaderPrimaryKey();
  }
  
  public LovVO getHrmLnAppEmpNoQLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO();
    LovVO oLovVO = oHrmLnAppBO.getHrmLnAppEmpNoQLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmLnAppEmpNoLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO();
    LovVO oLovVO = oHrmLnAppBO.getHrmLnAppEmpNoLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmLnAppLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO();
    LovVO oLovVO = oHrmLnAppBO.getHrmLnAppLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmLnAppInsLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO();
    LovVO oLovVO = oHrmLnAppBO.getHrmLnAppInsLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public String saveData(HrmLnAppHdrBean oHrmLnAppHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmLnAppBO oHrmLnAppBO = new HrmLnAppBO(oUserInfo);
      return oHrmLnAppBO.saveData((BaseHeaderBean)oHrmLnAppHdrBean, 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 getHrmMediclaimMasterHeaderMetaInfo(HrmMediclaimMasterQVO oHrmMediclaimMasterQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oHrmMediclaimMasterBO = new HrmMediclaimMasterBO();
    return oHrmMediclaimMasterBO.getHrmMediclaimMasterHeaderMetaInfo(oHrmMediclaimMasterQVO);
  }
  
  public ArrayList getHrmMediclaimMasterHeaderInfo(HrmMediclaimMasterQVO oHrmMediclaimMasterQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oHrmMediclaimMasterBO = new HrmMediclaimMasterBO();
    return oHrmMediclaimMasterBO.getHrmMediclaimMasterHeaderInfo(oHrmMediclaimMasterQVO, lStartPosition, lLastPosition);
  }
  
  public RecordMetaInfo getHrmMediclaimMasterDetailMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oHrmMediclaimMasterBO = new HrmMediclaimMasterBO();
    return oHrmMediclaimMasterBO.getHrmMediclaimMasterDetailMetaInfo(lPrimaryKey);
  }
  
  public ArrayList getHrmMediclaimMasterDetail(String lPrimaryKey, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oHrmMediclaimMasterBO = new HrmMediclaimMasterBO();
    return oHrmMediclaimMasterBO.getHrmMediclaimMasterDetail(lPrimaryKey, lStartPosition, lLastPosition);
  }
  
  public LovVO getHrmMediCadreLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oHrmMediclaimMasterBO = new HrmMediclaimMasterBO();
    LovVO oLovVO = oHrmMediclaimMasterBO.getHrmMediCadreLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public LovVO getHrmMediClassLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oHrmMediclaimMasterBO = new HrmMediclaimMasterBO();
    LovVO oLovVO = oHrmMediclaimMasterBO.getHrmMediClassLOVdata(oLovQueryVO);
    return oLovVO;
  }
  
  public String saveData(HrmMediclaimMasterHdrBean oHrmMediclaimMasterHdrBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
    HrmMediclaimMasterBO oLoanMaster = new HrmMediclaimMasterBO(oUserInfo);
    return oLoanMaster.saveData((BaseHeaderBean)oHrmMediclaimMasterHdrBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
  }
}
