package wenrgise.hrms.ejb.business;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.DateUtility;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.hrms.bean.HrmRecEmpRecCreationHdrBean;
import wenrgise.hrms.vo.HrmRecEmpRecCreationQVO;

public class HrmRecEmpRecCreationBO extends HrmBaseBO {
  public HrmRecEmpRecCreationBO() {}
  
  public HrmRecEmpRecCreationBO(UserInfo oUserInfo) {
    super(oUserInfo);
  }
  
  public RecordMetaInfo getHrmEmpRecCrtnHdrMetaInfo(HrmRecEmpRecCreationQVO oHrmRecEmpRecCreationQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, oHrmRecEmpRecCreationQVO.getHeaderPrimaryKey()));
    arylstParam.add(new DBObject(2, 1, 12, oHrmRecEmpRecCreationQVO.getApplicationNo()));
    arylstParam.add(new DBObject(3, 2, -5));
    arylstParam.add(new DBObject(4, 2, 93));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 12));
    arylstParam.add(new DBObject(7, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_HrmEmpRecCreationHdrCount(?,?,?,?,?,?,?)");
    RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
    DBObject oTotalRecord = arylstOutArray.get(0);
    oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
    DBObject oTimeObject = arylstOutArray.get(1);
    oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
    return oRecordMetaInfo;
  }
  
  public ArrayList getHrmEmpRecCrtnHeaderInfo(HrmRecEmpRecCreationQVO oHrmRecEmpRecCreationQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    Timestamp oWhenPicked = null;
    int count = 0;
    BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
    ArrayList arylstHeaderList = null;
    if (oHrmRecEmpRecCreationQVO == null)
      oHrmRecEmpRecCreationQVO = new HrmRecEmpRecCreationQVO(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, oHrmRecEmpRecCreationQVO.getHeaderPrimaryKey()));
    arylstParam.add(new DBObject(4, 1, 12, oHrmRecEmpRecCreationQVO.getApplicationNo()));
    arylstParam.add(new DBObject(5, 2, -10));
    arylstParam.add(new DBObject(6, 2, 12));
    arylstParam.add(new DBObject(7, 2, 12));
    arylstParam.add(new DBObject(8, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrEmpRecCreationHdr(?,?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    if (arylstList.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstList.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHeaderList = new ArrayList(); 
      count++;
      oRow = itrBean.next();
      HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = new HrmRecEmpRecCreationHdrBean();
      oHrmRecEmpRecCreationHdrBean.setHeaderPrimaryKey(oRow.get("ID").getString());
      oHrmRecEmpRecCreationHdrBean.setApplnId(oRow.get("ID").getString());
      oHrmRecEmpRecCreationHdrBean.setApplicationNo(oRow.get("APPL_NO").getString());
      oHrmRecEmpRecCreationHdrBean.setAdvNo(oRow.get("REF_NO").getString());
      oHrmRecEmpRecCreationHdrBean.setDesgnId(oRow.get("DESGN_ID").getString());
      oHrmRecEmpRecCreationHdrBean.setApplForDesignation(oRow.get("FOR_DESIG").getString());
      oHrmRecEmpRecCreationHdrBean.setApplForGrade(oRow.get("FOR_GRADE").getString());
      oHrmRecEmpRecCreationHdrBean.setEmployeeFirstName(oRow.get("FIRST_NAME").getString());
      oHrmRecEmpRecCreationHdrBean.setEmployeeMiddleName(oRow.get("MIDDLE_NAME").getString());
      oHrmRecEmpRecCreationHdrBean.setEmployeeLastName(oRow.get("LAST_NAME").getString());
      oHrmRecEmpRecCreationHdrBean.setEntryModeCode(oRow.get("ENTRY_MODE_CODE").getString());
      oHrmRecEmpRecCreationHdrBean.setEntryMode(oRow.get("ENTRY_MODE").getString());
      oHrmRecEmpRecCreationHdrBean.setRollNo(oRow.get("ROLL_NO").getString());
      oHrmRecEmpRecCreationHdrBean.setNewEmpNo(oRow.get("EMP_NO").getString());
      oHrmRecEmpRecCreationHdrBean.setGuardianName(oRow.get("GUARDIAN_NAME").getString());
      oHrmRecEmpRecCreationHdrBean.setPlaceOfBirth(oRow.get("PLACE_OF_BIRTH").getString());
      oHrmRecEmpRecCreationHdrBean.setDateOfBirth(EnrgiseUtil.convertToString(oRow.get("DOB").getDate()));
      oHrmRecEmpRecCreationHdrBean.setNationality(oRow.get("NATIONALITY").getString());
      oHrmRecEmpRecCreationHdrBean.setNationalityCode(oRow.get("NATIONALITY_CODE").getString());
      oHrmRecEmpRecCreationHdrBean.setMaritalStatus(oRow.get("MARITAL_STATUS").getString());
      oHrmRecEmpRecCreationHdrBean.setMaritalStatusCode(oRow.get("MARITAL_STATUS_CODE").getString());
      oHrmRecEmpRecCreationHdrBean.setSex(oRow.get("SEX").getString());
      oHrmRecEmpRecCreationHdrBean.setMotherToungue(oRow.get("MOTHER_TONGUE").getString());
      oHrmRecEmpRecCreationHdrBean.setMotherToungueCode(oRow.get("MOTHER_TONGUE_CODE").getString());
      oHrmRecEmpRecCreationHdrBean.setRelatedEmployee(oRow.get("RELATED_EMPLOYEE").getString());
      oHrmRecEmpRecCreationHdrBean.setRelatedEmployeeId(oRow.get("RELATED_EMP_ID").getString());
      oHrmRecEmpRecCreationHdrBean.setReligion(oRow.get("RLGN_NAME").getString());
      oHrmRecEmpRecCreationHdrBean.setReligionId(oRow.get("RLGN_MST_ID").getString());
      oHrmRecEmpRecCreationHdrBean.setBloodGroup(oRow.get("BLOOD_GROUP").getString());
      oHrmRecEmpRecCreationHdrBean.setEmail(oRow.get("EMAIL").getString());
      oHrmRecEmpRecCreationHdrBean.setArrested(oRow.get("ARRESTED_FLAG").getString());
      oHrmRecEmpRecCreationHdrBean.setProscecuted(oRow.get("PROSECUTED_FLAG").getString());
      oHrmRecEmpRecCreationHdrBean.setFined(oRow.get("FINED_FLAG").getString());
      oHrmRecEmpRecCreationHdrBean.setImprisoned(oRow.get("IMPRISONED_FLAG").getString());
      oHrmRecEmpRecCreationHdrBean.setHandicappedFlag(String.valueOf(oRow.get("HANDICAPPED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecEmpRecCreationHdrBean.setPassportNo(oRow.get("PASSPORT_NO").getString());
      oHrmRecEmpRecCreationHdrBean.setPlaceOfissue(oRow.get("PLACE_ISSUE").getString());
      oHrmRecEmpRecCreationHdrBean.setExpiryDate(EnrgiseUtil.convertToString(oRow.get("PASSPORT_EXPIRY_DATE").getDate()));
      oHrmRecEmpRecCreationHdrBean.setIssueDate(EnrgiseUtil.convertToString(oRow.get("PASSPORT_ISSUE_DATE").getDate()));
      oHrmRecEmpRecCreationHdrBean.setPresentAddress(oRow.get("PRES_ADD").getString());
      oHrmRecEmpRecCreationHdrBean.setCountryPresentAddress(oRow.get("PRES_COUNTRY").getString());
      oHrmRecEmpRecCreationHdrBean.setStatePresentAddress(oRow.get("PRES_STATE").getString());
      oHrmRecEmpRecCreationHdrBean.setCityPresentAddress(oRow.get("PRES_CITY").getString());
      oHrmRecEmpRecCreationHdrBean.setPhonePresentAddress(oRow.get("PRES_PHONE").getString());
      oHrmRecEmpRecCreationHdrBean.setPinCodePresentAddress(oRow.get("PRES_PIN_CODE").getString());
      oHrmRecEmpRecCreationHdrBean.setPermanentAddress(oRow.get("PERM_ADD").getString());
      oHrmRecEmpRecCreationHdrBean.setCountryPermanentAddress(oRow.get("PERM_COUNTRY").getString());
      oHrmRecEmpRecCreationHdrBean.setStatePermanentAddress(oRow.get("PERM_STATE").getString());
      oHrmRecEmpRecCreationHdrBean.setCityPermanentAddress(oRow.get("PERM_CITY").getString());
      oHrmRecEmpRecCreationHdrBean.setPhonePermanentAddresss(oRow.get("PERM_PHONE").getString());
      oHrmRecEmpRecCreationHdrBean.setPinCodePermanentAddress(oRow.get("PERM_PIN_CODE").getString());
      arylstHeaderList.add(oHrmRecEmpRecCreationHdrBean);
    } 
    return arylstHeaderList;
  }
  
  public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {}
  
  public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
    return new String();
  }
  
  public void initializeBOImpl() {
    this.headerTable = "HRM_ADVT_APPL_DTL";
  }
  
  public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {}
  
  public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
  
  public RecordMetaInfo getDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    return null;
  }
  
  public ArrayList getDetailInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    return null;
  }
  
  public LovVO getHrmRecCrnApplnNoLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.applicationNo");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmApplnNoLOVdata(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("APPL_NO").getString());
      oLOVBean.setDetailField3(oRow.get("EMPNAME").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnEntryModeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmEntryModeLOVdata(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("GLOBAL_CODE_TYPE").getString());
      oLOVBean.setDetailField2(oRow.get("GLOBAL_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("GLOBAL_CODE_DESC").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnEmployeeTypeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmEmployeeTypeLOVdata(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("GLOBAL_CODE_TYPE").getString());
      oLOVBean.setDetailField2(oRow.get("GLOBAL_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("GLOBAL_CODE_DESC").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnMotherTongueLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmMotherTngLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("DESCRIPTION").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnNationalityLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmNationalityLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("GLOBAL_CODE_TYPE").getString());
      oLOVBean.setDetailField2(oRow.get("GLOBAL_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("GLOBAL_CODE_DESC").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnMaritalStatusLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmMaritalStatLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("GLOBAL_CODE_TYPE").getString());
      oLOVBean.setDetailField2(oRow.get("GLOBAL_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("GLOBAL_CODE_DESC").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnReservationCtgLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.hierarchyLevel");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmRsvCtgLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      oLOVBean.setDetailField4(oRow.get("HIERARCHY_LEVEL").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnReligionLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmReligionLOVdata(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("DESCRIPTION").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnCountryLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmCountryLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("COUNTRY_ID").getString());
      oLOVBean.setDetailField2(oRow.get("COUNTRY_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnStateLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmStateLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("GLOBAL_CODE_TYPE").getString());
      oLOVBean.setDetailField2(oRow.get("GLOBAL_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("GLOBAL_CODE_DESC").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnBaseSiteLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmRecBaseSiteLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnDesignationLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.hierarchyLevel");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmDesignationLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      oLOVBean.setDetailField4(oRow.get("HIERARCHY_LEVEL").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnScaleLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.hierarchyLevel");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmScaleLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      oLOVBean.setDetailField4(oRow.get("HIERARCHY_LEVEL").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnGradeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.hierarchyLevel");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmGradeLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      oLOVBean.setDetailField4(oRow.get("HIERARCHY_LEVEL").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnCostCentreLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    String sQuerySearch2 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    if (oLovQueryVO.getSearchField2() != null)
      sQuerySearch2 = oLovQueryVO.getSearchField2(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 1, 12, sQuerySearch2));
    arylstParam.add(new DBObject(3, 2, -10));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 12));
    arylstParam.add(new DBObject(6, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmCostCenterLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("COST_ID").getString());
      oLOVBean.setDetailField2(oRow.get("COST_CODE").getString());
      oLOVBean.setDetailField3(oRow.get("COST_DESC").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnJoiningGroupLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmWorkGroupLOVdata(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public LovVO getHrmRecCrnTechNonTechLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.code");
    arylstHeaderList.add("hrm.HrmEmpRecCreation.desc");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sQuerySearch1));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetHrmTechLOVdata(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    ArrayList arylstList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      oLOVBean.setDetailField3(oRow.get("NAME").getString());
      arylstList.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstList);
    return oLovVO;
  }
  
  public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
    String sSaveRecCrn = saveRecEmpInfo(oBaseHeaderBean, ScreenMode);
    return sSaveRecCrn;
  }
  
  public String saveRecEmpInfo(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList arylstParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = (HrmRecEmpRecCreationHdrBean)oBaseHeaderBean;
    String handicapped = null;
    if (String.valueOf(oHrmRecEmpRecCreationHdrBean.getHandicappedFlag()).equalsIgnoreCase("on")) {
      handicapped = "Y";
    } else {
      handicapped = "N";
    } 
    if (ScreenMode.equalsIgnoreCase("U")) {
      arylstParameters = new ArrayList();
      arylstParameters.add(new DBObject(1, 1, 12, oHrmRecEmpRecCreationHdrBean.getApplicationNo()));
      arylstParameters.add(new DBObject(2, 1, 12, oHrmRecEmpRecCreationHdrBean.getApplnId()));
      arylstParameters.add(new DBObject(3, 1, 12, oHrmRecEmpRecCreationHdrBean.getNewEmpNo()));
      arylstParameters.add(new DBObject(4, 1, 12, oHrmRecEmpRecCreationHdrBean.getEmployeeFirstName()));
      arylstParameters.add(new DBObject(5, 1, 12, oHrmRecEmpRecCreationHdrBean.getEmployeeMiddleName()));
      arylstParameters.add(new DBObject(6, 1, 12, oHrmRecEmpRecCreationHdrBean.getEmployeeLastName()));
      arylstParameters.add(new DBObject(7, 1, 12, oHrmRecEmpRecCreationHdrBean.getEntryModeCode()));
      arylstParameters.add(new DBObject(8, 1, 12, oHrmRecEmpRecCreationHdrBean.getGuardianName()));
      arylstParameters.add(new DBObject(9, 1, 12, oHrmRecEmpRecCreationHdrBean.getMotherToungueCode()));
      arylstParameters.add(new DBObject(10, 1, 12, oHrmRecEmpRecCreationHdrBean.getPlaceOfBirth()));
      arylstParameters.add(new DBObject(11, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getDateOfBirth())));
      arylstParameters.add(new DBObject(12, 1, 12, oHrmRecEmpRecCreationHdrBean.getNationalityCode()));
      arylstParameters.add(new DBObject(13, 1, 12, oHrmRecEmpRecCreationHdrBean.getBloodGroup()));
      arylstParameters.add(new DBObject(14, 1, 12, oHrmRecEmpRecCreationHdrBean.getMaritalStatusCode()));
      arylstParameters.add(new DBObject(15, 1, 12, oHrmRecEmpRecCreationHdrBean.getSex()));
      arylstParameters.add(new DBObject(16, 1, 12, oHrmRecEmpRecCreationHdrBean.getEmail()));
      arylstParameters.add(new DBObject(17, 1, 12, handicapped));
      arylstParameters.add(new DBObject(18, 1, 12, oHrmRecEmpRecCreationHdrBean.getPassportNo()));
      arylstParameters.add(new DBObject(19, 1, 12, oHrmRecEmpRecCreationHdrBean.getPlaceOfissue()));
      arylstParameters.add(new DBObject(20, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getExpiryDate())));
      arylstParameters.add(new DBObject(21, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getIssueDate())));
      arylstParameters.add(new DBObject(22, 1, 12, oHrmRecEmpRecCreationHdrBean.getAppointmentOrder()));
      arylstParameters.add(new DBObject(23, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getAppointmentOrderDate())));
      arylstParameters.add(new DBObject(24, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate())));
      arylstParameters.add(new DBObject(25, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getLocationJoiningDate())));
      arylstParameters.add(new DBObject(26, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getTentativeConfirmDate())));
      arylstParameters.add(new DBObject(27, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getRetirementDate())));
      arylstParameters.add(new DBObject(28, 1, 12, oHrmRecEmpRecCreationHdrBean.getEmployeeType()));
      arylstParameters.add(new DBObject(29, 1, 12, oHrmRecEmpRecCreationHdrBean.getBaseSiteId()));
      arylstParameters.add(new DBObject(30, 1, 12, oHrmRecEmpRecCreationHdrBean.getReligionId()));
      arylstParameters.add(new DBObject(31, 1, 12, oHrmRecEmpRecCreationHdrBean.getRelatedEmployeeId()));
      arylstParameters.add(new DBObject(32, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParameters.add(new DBObject(33, 1, 12, this.oUserInfo.getSiteId()));
      arylstParameters.add(new DBObject(34, 2, 12));
      arylstParameters.add(new DBObject(35, 2, 12));
      arylstParameters.add(new DBObject(36, 2, 12));
      arylstParameters.add(new DBObject(37, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMRECCREATION.proc_UpsertHrEmpRecCreationHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
      System.out.println(returnString);
    } 
    saveRecEmpAdd(oBaseHeaderBean, ScreenMode, returnString);
    saveRecJoinInf(oBaseHeaderBean, ScreenMode, returnString);
    saveRecWrkGrp(oBaseHeaderBean, ScreenMode, returnString);
    saveRecEmpDayOff(oBaseHeaderBean, ScreenMode, returnString);
    return oHrmRecEmpRecCreationHdrBean.getApplnId();
  }
  
  public String saveRecEmpAdd(BaseHeaderBean oBaseHeaderBean, String ScreenMode, String empPerId) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList arylstParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = (HrmRecEmpRecCreationHdrBean)oBaseHeaderBean;
    if (ScreenMode.equalsIgnoreCase("U")) {
      arylstParameters = new ArrayList();
      arylstParameters.add(new DBObject(1, 1, 12, "i"));
      arylstParameters.add(new DBObject(2, 1, 12, empPerId));
      arylstParameters.add(new DBObject(3, 1, 12, oHrmRecEmpRecCreationHdrBean.getOfficeAddress()));
      arylstParameters.add(new DBObject(4, 1, 12, oHrmRecEmpRecCreationHdrBean.getCityOfficeAddress()));
      arylstParameters.add(new DBObject(5, 1, 12, oHrmRecEmpRecCreationHdrBean.getStateOfficeAddress()));
      arylstParameters.add(new DBObject(6, 1, 12, oHrmRecEmpRecCreationHdrBean.getCountryOfficeAddress()));
      arylstParameters.add(new DBObject(7, 1, 12, oHrmRecEmpRecCreationHdrBean.getPinCodeOfficeAddress()));
      arylstParameters.add(new DBObject(8, 1, 12, oHrmRecEmpRecCreationHdrBean.getPhoneOfficeAddress()));
      arylstParameters.add(new DBObject(9, 1, 12, oHrmRecEmpRecCreationHdrBean.getPresentAddress()));
      arylstParameters.add(new DBObject(10, 1, 12, oHrmRecEmpRecCreationHdrBean.getCityPresentAddress()));
      arylstParameters.add(new DBObject(11, 1, 12, oHrmRecEmpRecCreationHdrBean.getStatePresentAddress()));
      arylstParameters.add(new DBObject(12, 1, 12, oHrmRecEmpRecCreationHdrBean.getCountryPresentAddress()));
      arylstParameters.add(new DBObject(13, 1, 12, oHrmRecEmpRecCreationHdrBean.getPinCodePresentAddress()));
      arylstParameters.add(new DBObject(14, 1, 12, oHrmRecEmpRecCreationHdrBean.getPhonePresentAddress()));
      arylstParameters.add(new DBObject(15, 1, 12, oHrmRecEmpRecCreationHdrBean.getPermanentAddress()));
      arylstParameters.add(new DBObject(16, 1, 12, oHrmRecEmpRecCreationHdrBean.getCityPermanentAddress()));
      arylstParameters.add(new DBObject(17, 1, 12, oHrmRecEmpRecCreationHdrBean.getStatePermanentAddress()));
      arylstParameters.add(new DBObject(18, 1, 12, oHrmRecEmpRecCreationHdrBean.getCountryPermanentAddress()));
      arylstParameters.add(new DBObject(19, 1, 12, oHrmRecEmpRecCreationHdrBean.getPinCodePermanentAddress()));
      arylstParameters.add(new DBObject(20, 1, 12, oHrmRecEmpRecCreationHdrBean.getPhonePermanentAddresss()));
      arylstParameters.add(new DBObject(21, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParameters.add(new DBObject(22, 1, 12, this.oUserInfo.getSiteId()));
      arylstParameters.add(new DBObject(23, 2, 12));
      arylstParameters.add(new DBObject(24, 2, 12));
      arylstParameters.add(new DBObject(25, 2, 12));
      arylstParameters.add(new DBObject(26, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMRECCREATION.proc_UpsertHrEmpRecCreationAdd(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
      System.out.println(returnString);
    } 
    return returnString;
  }
  
  public String saveRecEmpDayOff(BaseHeaderBean oBaseHeaderBean, String ScreenMode, String empPerId) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList arylstParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = (HrmRecEmpRecCreationHdrBean)oBaseHeaderBean;
    if (ScreenMode.equalsIgnoreCase("U")) {
      arylstParameters = new ArrayList();
      arylstParameters.add(new DBObject(1, 1, 12, "i"));
      arylstParameters.add(new DBObject(2, 1, 12, empPerId));
      arylstParameters.add(new DBObject(3, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate())));
      arylstParameters.add(new DBObject(4, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParameters.add(new DBObject(5, 1, 12, this.oUserInfo.getSiteId()));
      arylstParameters.add(new DBObject(6, 2, 12));
      arylstParameters.add(new DBObject(7, 2, 12));
      arylstParameters.add(new DBObject(8, 2, 12));
      arylstParameters.add(new DBObject(9, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMRECCREATION.procUpsertHrEmpDayOff(?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
    } else if (ScreenMode.equalsIgnoreCase("D")) {
    
    } 
    return returnString;
  }
  
  public String saveRecJoinInf(BaseHeaderBean oBaseHeaderBean, String ScreenMode, String empPerId) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList arylstParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = (HrmRecEmpRecCreationHdrBean)oBaseHeaderBean;
    if (ScreenMode.equalsIgnoreCase("U")) {
      arylstParameters = new ArrayList();
      arylstParameters.add(new DBObject(1, 1, 12, "i"));
      arylstParameters.add(new DBObject(2, 1, 12, empPerId));
      arylstParameters.add(new DBObject(3, 1, 12, oHrmRecEmpRecCreationHdrBean.getDesgnId()));
      arylstParameters.add(new DBObject(4, 1, 12, oHrmRecEmpRecCreationHdrBean.getGradeId()));
      arylstParameters.add(new DBObject(5, 1, 12, oHrmRecEmpRecCreationHdrBean.getReservationCategory()));
      arylstParameters.add(new DBObject(6, 1, 12, oHrmRecEmpRecCreationHdrBean.getApplicationNo()));
      arylstParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
      arylstParameters.add(new DBObject(9, 2, 12));
      arylstParameters.add(new DBObject(10, 2, 12));
      arylstParameters.add(new DBObject(11, 2, 12));
      arylstParameters.add(new DBObject(12, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMRECCREATION.proc_UpsertHrEmpRecCrnDtl(?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
    } else if (ScreenMode.equalsIgnoreCase("D")) {
    
    } 
    return returnString;
  }
  
  public String saveRecWrkGrp(BaseHeaderBean oBaseHeaderBean, String ScreenMode, String empPerId) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList arylstParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = (HrmRecEmpRecCreationHdrBean)oBaseHeaderBean;
    if (ScreenMode.equalsIgnoreCase("U")) {
      arylstParameters = new ArrayList();
      arylstParameters.add(new DBObject(1, 1, 12, empPerId));
      arylstParameters.add(new DBObject(2, 1, 12, "200"));
      arylstParameters.add(new DBObject(3, 1, 12, oHrmRecEmpRecCreationHdrBean.getJoiningId()));
      arylstParameters.add(new DBObject(4, 1, 12, oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate()));
      arylstParameters.add(new DBObject(5, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getSiteId()));
      arylstParameters.add(new DBObject(7, 2, 12));
      arylstParameters.add(new DBObject(8, 2, 12));
      arylstParameters.add(new DBObject(9, 2, 12));
      arylstParameters.add(new DBObject(10, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMRECCREATION.proc_UpsertHrEmpRecWrkGrpHdr(?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
      System.out.println(returnString);
    } else if (ScreenMode.equalsIgnoreCase("D")) {
    
    } 
    return returnString;
  }
  
  public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList arylstDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstErrorList = new ArrayList();
    if (bHeaderDataChanged)
      if (!sScreenMode.equalsIgnoreCase("D"))
        checkMandatoryHeader((HrmRecEmpRecCreationHdrBean)oBaseHeaderBean);  
  }
  
  private void checkMandatoryHeader(HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getOfficeAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.address");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new MessageKey("hrm.HrmEmpRecCreation.office"));
      oErrorList.add(new EnrgiseMessageKeyException("hrm.HrmEmpRecCreation.mandatory", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getCityOfficeAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.city");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new MessageKey("hrm.HrmEmpRecCreation.office"));
      oErrorList.add(new EnrgiseMessageKeyException("hrm.HrmEmpRecCreation.mandatory", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getStateOfficeAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.state");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new MessageKey("hrm.HrmEmpRecCreation.office"));
      oErrorList.add(new EnrgiseMessageKeyException("hrm.HrmEmpRecCreation.mandatory", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getCountryOfficeAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.country");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new MessageKey("hrm.HrmEmpRecCreation.office"));
      oErrorList.add(new EnrgiseMessageKeyException("hrm.HrmEmpRecCreation.mandatory", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getAppointmentOrder())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.appointmentOrder");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getAppointmentOrderDate())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.appointmentOrderDate");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.companyJoiningDate");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getGradeId())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.grade");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getBaseSiteId())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.baseSite");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getEmployeeType())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.employeeType");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList arylstDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstErrorList = new ArrayList();
    HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean = (HrmRecEmpRecCreationHdrBean)oBaseHeaderBean;
    if (bHeaderDataChanged) {
      if (!sScreenMode.equalsIgnoreCase("D")) {
        checkUniqueHeader((HrmRecEmpRecCreationHdrBean)oBaseHeaderBean);
        checkDatesConstraint((HrmRecEmpRecCreationHdrBean)oBaseHeaderBean, arylstErrorList);
      } 
      if (sScreenMode.equalsIgnoreCase("D"));
    } 
    reportError(arylstErrorList);
  }
  
  private void checkUniqueHeader(HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    String sQuery = String.valueOf(String.valueOf(" Select EMP_NO as EMP_NO from HRM_EMP_PERS where EMP_NO='").concat(String.valueOf(oHrmRecEmpRecCreationHdrBean.getNewEmpNo()))).concat(String.valueOf("'"));
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    ArrayList arylstList = oBean.executeQuery(sQuery);
    Iterator itrBean = arylstList.iterator();
    if (itrBean.hasNext()) {
      QueryRow oRow = itrBean.next();
      if (!oRow.get("EMP_NO").getString().equalsIgnoreCase(oHrmRecEmpRecCreationHdrBean.getHeaderPrimaryKey())) {
        MessageKey oMessageKey = new MessageKey("hrm.HrmEmpRecCreation.heading");
        oParams = new ArrayList();
        oParams.add(oMessageKey);
        oErrorList.add(new EnrgiseMessageKeyException("hrm.HrmEmpRecCreation.uniqueHeader", oParams, "E"));
      } 
    } 
    reportError(oErrorList);
  }
  
  private void checkDatesConstraint(HrmRecEmpRecCreationHdrBean oHrmRecEmpRecCreationHdrBean, ArrayList arylstErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
    DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
    if (EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate())) {
      int iDateFlag = EnrgiseUtil.compareDates(dateFormat, oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate(), oHrmRecEmpRecCreationHdrBean.getAppointmentOrderDate());
      if (iDateFlag == -1 && iDateFlag != -2)
        arylstErrorList.add(new EnrgiseApplicationException("wenrgise.common.dateConstraintViolated")); 
    } 
    if (EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getLocationJoiningDate())) {
      int iDateFlag = EnrgiseUtil.compareDates(dateFormat, oHrmRecEmpRecCreationHdrBean.getLocationJoiningDate(), oHrmRecEmpRecCreationHdrBean.getCompanyJoiningDate());
      if (iDateFlag == -1 && iDateFlag != -2)
        arylstErrorList.add(new EnrgiseApplicationException("wenrgise.common.dateConstraintViolated")); 
    } 
    if (EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getTentativeConfirmDate())) {
      int iDateFlag = EnrgiseUtil.compareDates(dateFormat, oHrmRecEmpRecCreationHdrBean.getTentativeConfirmDate(), oHrmRecEmpRecCreationHdrBean.getLocationJoiningDate());
      if (iDateFlag == -1 && iDateFlag != -2)
        arylstErrorList.add(new EnrgiseApplicationException("wenrgise.common.dateConstraintViolated")); 
    } 
    if (EnrgiseUtil.checkString(oHrmRecEmpRecCreationHdrBean.getRetirementDate())) {
      int iDateFlag = EnrgiseUtil.compareDates(dateFormat, oHrmRecEmpRecCreationHdrBean.getRetirementDate(), oHrmRecEmpRecCreationHdrBean.getTentativeConfirmDate());
      if (iDateFlag == -1 && iDateFlag != -2)
        arylstErrorList.add(new EnrgiseApplicationException("wenrgise.common.dateConstraintViolated")); 
    } 
  }
  
  public String getLangInfo(String sCode) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    String sLang = null;
    ArrayList arylstLangDetail = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sCode));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetMotherTngInfo(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      arylstLangDetail = new ArrayList(); 
    QueryRow oRow = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      oRow = (QueryRow)itrBean.next();
      sLang = oRow.get("DESCRIPTION").getString();
    } 
    return sLang;
  }
  
  public String getReligionInfo(String sId) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    String sRlgn = null;
    ArrayList arylstLangDetail = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, sId));
    arylstParam.add(new DBObject(2, 2, -10));
    arylstParam.add(new DBObject(3, 2, 12));
    arylstParam.add(new DBObject(4, 2, 12));
    arylstParam.add(new DBObject(5, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECCREATION.proc_GetReligionInfo(?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      arylstLangDetail = new ArrayList(); 
    QueryRow oRow = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      oRow = (QueryRow)itrBean.next();
      sRlgn = oRow.get("DESCRIPTION").getString();
    } 
    return sRlgn;
  }
}
