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.ejb.business.HrmCommonBO;
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.helper.QueryValue;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.hrms.bean.HrmOrgClassHdrBean;
import wenrgise.hrms.bean.HrmRecApplnMtnAddDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnEduDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnExpDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnHdrBean;
import wenrgise.hrms.bean.HrmRecApplnMtnLangDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnOtherDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnRefDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnResultDtlBean;
import wenrgise.hrms.bean.HrmRecApplnMtnTrngDtlBean;
import wenrgise.hrms.vo.HrmRecApplnMtnQVO;

public class HrmRecApplnMtnBO extends HrmBaseBO {
  public HrmRecApplnMtnBO() {}
  
  public HrmRecApplnMtnBO(UserInfo oUserInfo) {
    super(oUserInfo);
  }
  
  public RecordMetaInfo getHrmRecApplnMtnHdrMetaInfo(HrmRecApplnMtnQVO oHrmRecApplnMtnQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    Timestamp oWhenPicked = null;
    int count = 0;
    BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, oHrmRecApplnMtnQVO.getHeaderPrimaryKey()));
    arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnQVO.getApplicationNo()));
    arylstParam.add(new DBObject(3, 1, 12, oHrmRecApplnMtnQVO.getReferenceNo()));
    arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnQVO.getApplForDesignation()));
    arylstParam.add(new DBObject(5, 2, -5));
    arylstParam.add(new DBObject(6, 2, 93));
    arylstParam.add(new DBObject(7, 2, 12));
    arylstParam.add(new DBObject(8, 2, 12));
    arylstParam.add(new DBObject(9, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECAPPLNMTN.procHrRecApplnMtnHdrCount(?,?,?,?,?,?,?,?,?)");
    RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
    DBObject oTimeObject = arylstOutArray.get(1);
    oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
    DBObject oTotalRecord = arylstOutArray.get(0);
    oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
    return oRecordMetaInfo;
  }
  
  public ArrayList getHrmRecApplnMtnHeaderInfo(HrmRecApplnMtnQVO oHrmRecApplnMtnQVO, 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 (oHrmRecApplnMtnQVO == null)
      oHrmRecApplnMtnQVO = new HrmRecApplnMtnQVO(); 
    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, oHrmRecApplnMtnQVO.getHeaderPrimaryKey()));
    arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnQVO.getApplicationNo()));
    arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnQVO.getReferenceNo()));
    arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnQVO.getApplForDesignation()));
    arylstParam.add(new DBObject(7, 2, -10));
    arylstParam.add(new DBObject(8, 2, 12));
    arylstParam.add(new DBObject(9, 2, 12));
    arylstParam.add(new DBObject(10, 2, 4));
    ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECAPPLNMTN.procHrRecApplnMtnHdrInfo(?,?,?,?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    String draft = null;
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHeaderList = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnHdrBean oHrmRecApplnMtnHdrBean = new HrmRecApplnMtnHdrBean();
      oHrmRecApplnMtnHdrBean.setHeaderPrimaryKey(oRow.get("ID").getString());
      oHrmRecApplnMtnHdrBean.setApplicationNo(oRow.get("APPL_NO").getString());
      oHrmRecApplnMtnHdrBean.setApplnNoId(oRow.get("id").getString());
      oHrmRecApplnMtnHdrBean.setApplicationDate(EnrgiseUtil.convertToString(oRow.get("APPL_DATE").getDate()));
      oHrmRecApplnMtnHdrBean.setReferenceNo(oRow.get("REF_NO").getString());
      oHrmRecApplnMtnHdrBean.setReferenceId(oRow.get("REF_ID").getString());
      oHrmRecApplnMtnHdrBean.setApplForGrade(oRow.get("GRADE").getString());
      oHrmRecApplnMtnHdrBean.setApplForDesignation(oRow.get("DESIGNATION").getString());
      oHrmRecApplnMtnHdrBean.setDesignationId(oRow.get("DESIGNATION_ID").getString());
      oHrmRecApplnMtnHdrBean.setApplicantFirstName(oRow.get("FIRST_NAME").getString());
      oHrmRecApplnMtnHdrBean.setApplicantMiddleName(oRow.get("MIDDLE_NAME").getString());
      oHrmRecApplnMtnHdrBean.setApplicantLastName(oRow.get("LAST_NAME").getString());
      oHrmRecApplnMtnHdrBean.setEntryMode(oRow.get("ENTRY_MODE").getString());
      oHrmRecApplnMtnHdrBean.setRollNo(oRow.get("ROLL_NO").getString());
      oHrmRecApplnMtnHdrBean.setPicturePath(oRow.get("PICTURE_PATH").getString());
      arylstHeaderList.add(oHrmRecApplnMtnHdrBean);
    } 
    return arylstHeaderList;
  }
  
  public RecordMetaInfo getHrmRecApplnPerDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnPerDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnAddDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnAddDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnLangDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnLangDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnEduDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnEduDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnExpDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnExpDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnResultDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnResDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnOtherDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnResDtlCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnRefMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnRefCount(?,?,?,?,?,?)");
    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 RecordMetaInfo getHrmRecApplnTrngDtlsMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(2, 2, -5));
    arylstParam.add(new DBObject(3, 2, 93));
    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, "HRMRECAPPLNMTN.procHrRecMtnTrngCount(?,?,?,?,?,?)");
    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 getHrmRecApplnRef(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnRefDtl = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnRefDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnRefDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnRefDtlBean oHrmRecApplnMtnRefDtlBean = new HrmRecApplnMtnRefDtlBean();
      oHrmRecApplnMtnRefDtlBean.setDetailId(oRow.get("ID").getString());
      oHrmRecApplnMtnRefDtlBean.setTxtName(oRow.get("NAME").getString());
      oHrmRecApplnMtnRefDtlBean.setTxtAddress(oRow.get("ADDRESS").getString());
      oHrmRecApplnMtnRefDtlBean.setTxtPhone(oRow.get("PHONE").getString());
      oHrmRecApplnMtnRefDtlBean.setTxtPosition(oRow.get("POSITION").getString());
      arylstHrmRecApplnMtnRefDtl.add(oHrmRecApplnMtnRefDtlBean);
    } 
    return arylstHrmRecApplnMtnRefDtl;
  }
  
  public ArrayList getHrmRecApplnTrngDtls(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnTrngDtls = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnTrngDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnTrngDtls = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnTrngDtlBean oHrmRecApplnMtnTrngDtlBean = new HrmRecApplnMtnTrngDtlBean();
      oHrmRecApplnMtnTrngDtlBean.setDetailId(oRow.get("ID").getString());
      oHrmRecApplnMtnTrngDtlBean.setTxtCourse(oRow.get("COURSE").getString());
      oHrmRecApplnMtnTrngDtlBean.setTxtFromDate(EnrgiseUtil.convertToString(oRow.get("FROM_DATE").getDate()));
      oHrmRecApplnMtnTrngDtlBean.setTxtToDate(EnrgiseUtil.convertToString(oRow.get("TO_DATE").getDate()));
      oHrmRecApplnMtnTrngDtlBean.setTxtSubject(oRow.get("SUBJECT").getString());
      oHrmRecApplnMtnTrngDtlBean.setTxtInstitute(oRow.get("INSTITUTION").getString());
      arylstHrmRecApplnMtnTrngDtls.add(oHrmRecApplnMtnTrngDtlBean);
    } 
    return arylstHrmRecApplnMtnTrngDtls;
  }
  
  public ArrayList getHrmRecApplnOtherDtl(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnOtherDtl = null;
    ArrayList arylstClass = null;
    String sScaleId = null;
    String sDesignationId = null;
    HrmOrgClassHdrBean def = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnResDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnOtherDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnOtherDtlBean oHrmRecApplnMtnOtherDtlBean = new HrmRecApplnMtnOtherDtlBean();
      oHrmRecApplnMtnOtherDtlBean.setDetailId(oRow.get("ID").getString());
      oHrmRecApplnMtnOtherDtlBean.setDisqualified(String.valueOf(oRow.get("OFFER_ACCEPTED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setQualInterview(String.valueOf(oRow.get("INTERVIEW_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setQualInterview2(String.valueOf(oRow.get("INTERVIEW_FLAG_2").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setQualInterview3(String.valueOf(oRow.get("INTERVIEW_FLAG_3").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setFailedWrittenA(String.valueOf(oRow.get("WRITTEN_TEST_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setFailedWrittenB(String.valueOf(oRow.get("GD_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setMedicalCleared(String.valueOf(oRow.get("MEDICAL_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setInterviewScore(oRow.get("INTERVIEW_SCORE").getString());
      oHrmRecApplnMtnOtherDtlBean.setInterviewScore2(oRow.get("INTERVIEW_SCORE_2").getString());
      oHrmRecApplnMtnOtherDtlBean.setInterviewScore3(oRow.get("INTERVIEW_SCORE_3").getString());
      oHrmRecApplnMtnOtherDtlBean.setRating(oRow.get("RATING").getString());
      oHrmRecApplnMtnOtherDtlBean.setTestCenter(oRow.get("TEST_CNTR_NAME").getString());
      oHrmRecApplnMtnOtherDtlBean.setTestCentreId(oRow.get("TSTCNTR_MS_ID").getString());
      oHrmRecApplnMtnOtherDtlBean.setWrittenScoreA(oRow.get("WRTN_TEST_SCORE").getString());
      oHrmRecApplnMtnOtherDtlBean.setWrittenScoreB(oRow.get("GD_SCORE").getString());
      oHrmRecApplnMtnOtherDtlBean.setAppointedFlag(String.valueOf(oRow.get("APPOINTMENT_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnOtherDtlBean.setJoinedOrganisation(String.valueOf(oRow.get("JOINED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      arylstHrmRecApplnMtnOtherDtl.add(oHrmRecApplnMtnOtherDtlBean);
    } 
    return arylstHrmRecApplnMtnOtherDtl;
  }
  
  public ArrayList getHrmRecApplnAddDtl(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnAddDtl = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnAddDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    HrmRecApplnMtnAddDtlBean oHrmRecApplnMtnAddDtlBean = new HrmRecApplnMtnAddDtlBean();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnAddDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      oHrmRecApplnMtnAddDtlBean.setDetailId(oRow.get("ID").getString());
      oHrmRecApplnMtnAddDtlBean.setPermAddress(oRow.get("PERM_ADD").getString());
      oHrmRecApplnMtnAddDtlBean.setPermCity(oRow.get("PERM_CITY").getString());
      oHrmRecApplnMtnAddDtlBean.setPermCountry(oRow.get("PERM_COUNTRY").getString());
      oHrmRecApplnMtnAddDtlBean.setPermPhone(oRow.get("PERM_PHONE").getString());
      oHrmRecApplnMtnAddDtlBean.setPermPin(oRow.get("PERM_PIN_CODE").getString());
      oHrmRecApplnMtnAddDtlBean.setPermState(oRow.get("PERM_STATE").getString());
      oHrmRecApplnMtnAddDtlBean.setPresAddress(oRow.get("PRES_ADD").getString());
      oHrmRecApplnMtnAddDtlBean.setPresCity(oRow.get("PRES_CITY").getString());
      oHrmRecApplnMtnAddDtlBean.setPresCountry(oRow.get("PRES_COUNTRY").getString());
      oHrmRecApplnMtnAddDtlBean.setPresPhone(oRow.get("PRES_PHONE").getString());
      oHrmRecApplnMtnAddDtlBean.setPresPin(oRow.get("PRES_PIN_CODE").getString());
      oHrmRecApplnMtnAddDtlBean.setPresState(oRow.get("PRES_STATE").getString());
      oHrmRecApplnMtnAddDtlBean.setGuardianName(oRow.get("GUARDIAN_NAME").getString());
      oHrmRecApplnMtnAddDtlBean.setPlaceOfBirth(oRow.get("PLACE_OF_BIRTH").getString());
      oHrmRecApplnMtnAddDtlBean.setDateOfBirth(EnrgiseUtil.convertToString(oRow.get("DOB").getDate()));
      oHrmRecApplnMtnAddDtlBean.setNationality(oRow.get("NATIONALITY").getString());
      oHrmRecApplnMtnAddDtlBean.setNationalityCode(oRow.get("NATIONALITY_CODE").getString());
      oHrmRecApplnMtnAddDtlBean.setMaritalStatusDesc(oRow.get("MARITAL_STATUS").getString());
      oHrmRecApplnMtnAddDtlBean.setMaritalStatus(oRow.get("MARITAL_STATUS_CODE").getString());
      oHrmRecApplnMtnAddDtlBean.setSex(oRow.get("SEX").getString());
      oHrmRecApplnMtnAddDtlBean.setMotherTongue(oRow.get("MOTHER_TONGUE").getString());
      oHrmRecApplnMtnAddDtlBean.setMotherToungueCode(oRow.get("MOTHER_TONGUE_CODE").getString());
      oHrmRecApplnMtnAddDtlBean.setRelatedToEmp(String.valueOf(oRow.get("RELATED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setRelatedEmpId(oRow.get("RELATED_EMP_ID").getString());
      oHrmRecApplnMtnAddDtlBean.setRelatedEmpName(oRow.get("RELATED_EMPLOYEE").getString());
      oHrmRecApplnMtnAddDtlBean.setReligionId(oRow.get("RLGN_MST_ID").getString());
      oHrmRecApplnMtnAddDtlBean.setReligion(oRow.get("RELIGION").getString());
      oHrmRecApplnMtnAddDtlBean.setHandicappedFlag(String.valueOf(oRow.get("HANDICAPPED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setHealthRecord(oRow.get("HEALTH_RECORDS").getString());
      oHrmRecApplnMtnAddDtlBean.setBloodGroup(oRow.get("BLOOD_GROUP").getString());
      oHrmRecApplnMtnAddDtlBean.setAppliedEarlier(String.valueOf(oRow.get("APPL_EARLY_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setMail(oRow.get("EMAIL").getString());
      oHrmRecApplnMtnAddDtlBean.setReservationCategoryId(oRow.get("RSVCAT_MST_ID").getString());
      oHrmRecApplnMtnAddDtlBean.setReservationCategory(oRow.get("RESV_CAT_NAME").getString());
      oHrmRecApplnMtnAddDtlBean.setPrevEmpFlag(String.valueOf(oRow.get("PREV_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setPrevEmpDtls(oRow.get("PREV_DTLS").getString());
      oHrmRecApplnMtnAddDtlBean.setHobbies(oRow.get("HOBBIES").getString());
      oHrmRecApplnMtnAddDtlBean.setGrossExpected(oRow.get("GROSS_EXP").getString());
      oHrmRecApplnMtnAddDtlBean.setAddlInfo(oRow.get("REMARKS").getString());
      oHrmRecApplnMtnAddDtlBean.setChequeNo(oRow.get("BANK_DOC_NO").getString());
      oHrmRecApplnMtnAddDtlBean.setSubmissionDate(EnrgiseUtil.convertToString(oRow.get("BANK_DOC_DATE").getDate()));
      oHrmRecApplnMtnAddDtlBean.setSubmittedAmount(oRow.get("BANK_DOC_AMOUNT").getString());
      oHrmRecApplnMtnAddDtlBean.setArrestedBefore(String.valueOf(oRow.get("ARRESTED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setFinedByCourt(String.valueOf(oRow.get("FINED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setImprisonedBefore(String.valueOf(oRow.get("IMPRISONED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setProsecutedBefore(String.valueOf(oRow.get("PROSECUTED_FLAG").getString()).equalsIgnoreCase("Y") ? "on" : "off");
      oHrmRecApplnMtnAddDtlBean.setReasons(oRow.get("REASON").getString());
      oHrmRecApplnMtnAddDtlBean.setPassportNo(oRow.get("PASSPORT_NO").getString());
      oHrmRecApplnMtnAddDtlBean.setPlaceOfIssue(oRow.get("PLACE_ISSUE").getString());
      oHrmRecApplnMtnAddDtlBean.setExpiryDate(EnrgiseUtil.convertToString(oRow.get("PASSPORT_EXPIRY_DATE").getDate()));
      oHrmRecApplnMtnAddDtlBean.setIssueDate(EnrgiseUtil.convertToString(oRow.get("PASSPORT_ISSUE_DATE").getDate()));
      arylstHrmRecApplnMtnAddDtl.add(oHrmRecApplnMtnAddDtlBean);
    } 
    return arylstHrmRecApplnMtnAddDtl;
  }
  
  public ArrayList getHrmRecApplnLangDtl(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnLangDtl = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnLangDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnLangDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnLangDtlBean oHrmRecApplnMtnLangDtlBean = new HrmRecApplnMtnLangDtlBean();
      oHrmRecApplnMtnLangDtlBean.setDetailId(oRow.get("LANG_KNOW_ID").getString());
      oHrmRecApplnMtnLangDtlBean.setLangId(oRow.get("LANG_MST_ID").getString());
      oHrmRecApplnMtnLangDtlBean.setTxtLanguageCode(oRow.get("LANG_NAME").getString());
      oHrmRecApplnMtnLangDtlBean.setTxtKnowledgeLevel(oRow.get("KNOWLEDGE_LEVEL").getString());
      arylstHrmRecApplnMtnLangDtl.add(oHrmRecApplnMtnLangDtlBean);
    } 
    return arylstHrmRecApplnMtnLangDtl;
  }
  
  public ArrayList getHrmRecApplnEduDtl(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnEduDtl = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnEduDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnEduDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnEduDtlBean oHrmEmployePDEduDtlBean = new HrmRecApplnMtnEduDtlBean();
      oHrmEmployePDEduDtlBean.setDetailId(oRow.get("EDU_ID").getString());
      oHrmEmployePDEduDtlBean.setQualificationId(oRow.get("QUAL_MST_ID").getString());
      oHrmEmployePDEduDtlBean.setTxtInstCode(oRow.get("INST_NAME").getString());
      oHrmEmployePDEduDtlBean.setTxtPercentageMarks(oRow.get("PERC_MARKS").getString());
      oHrmEmployePDEduDtlBean.setTxtPassYear(oRow.get("PASS_YEAR").getString());
      oHrmEmployePDEduDtlBean.setTxtQualification(oRow.get("QUAL_NAME").getString());
      oHrmEmployePDEduDtlBean.setTxtMajorSub(oRow.get("MAJOR_SUBJECTS").getString());
      oHrmEmployePDEduDtlBean.setTxtOtherProfQuali(oRow.get("OTHER_QUAL").getString());
      oHrmEmployePDEduDtlBean.setTxtSpeecialCourses(oRow.get("SPECIAL_COURSES_ATTENDED").getString());
      oHrmEmployePDEduDtlBean.setTxtSpeecialisation(oRow.get("SPECIALIZATION").getString());
      arylstHrmRecApplnMtnEduDtl.add(oHrmEmployePDEduDtlBean);
    } 
    return arylstHrmRecApplnMtnEduDtl;
  }
  
  public ArrayList getHrmRecApplnExpDtl(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnExpDtl = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnExpDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnExpDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean = new HrmRecApplnMtnExpDtlBean();
      oHrmRecApplnMtnExpDtlBean.setDetailId(oRow.get("EXP_ID").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtPeriodFrom(oRow.get("FROM_MMYYYY").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtPeriodTo(oRow.get("TO_MMYYYY").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtLocation(oRow.get("LOCATION").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtOrganisation(oRow.get("ORG_NAME").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtWorkExp(oRow.get("WORK_EXPERIENCE").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtDesignationCode(oRow.get("DESIG").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtReportTo(oRow.get("REPORT_TO").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtNoPersonSupervised(oRow.get("PERSONNEL_SUPERVISED").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtStartingSal(oRow.get("STARTING_SALARY").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtLeavingSal(oRow.get("LEAVING_SALARY").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtBasic(oRow.get("BASIC").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtDA(oRow.get("DA").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtHRA(oRow.get("HRA").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtConv(oRow.get("CONV_ALLOWANCE").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtIncentives(oRow.get("INCENTIVES").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtBonus(oRow.get("BONUS").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtOtherAllowances(oRow.get("OTHERS_ALLOWANCES").getString());
      oHrmRecApplnMtnExpDtlBean.setTxtWorkDesc(oRow.get("JOB_DESC").getString());
      arylstHrmRecApplnMtnExpDtl.add(oHrmRecApplnMtnExpDtlBean);
    } 
    return arylstHrmRecApplnMtnExpDtl;
  }
  
  public ArrayList getHrmRecApplnResultDtl(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList arylstHrmRecApplnMtnResultDtl = null;
    arylstParam = new ArrayList();
    arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey));
    arylstParam.add(new DBObject(4, 2, -10));
    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, "HRMRECAPPLNMTN.procHrRecMtnResDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    if (arylstParam.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator itrBean = arylstParam.iterator();
    while (itrBean.hasNext()) {
      if (count == 0)
        arylstHrmRecApplnMtnResultDtl = new ArrayList(); 
      count++;
      oRow = (QueryRow)itrBean.next();
      HrmRecApplnMtnResultDtlBean oHrmRecApplnMtnResultDtlBean = new HrmRecApplnMtnResultDtlBean();
      oHrmRecApplnMtnResultDtlBean.setDetailId(oRow.get("ID").getString());
      if (oRow.get("QUALIFIED_FLAG").getString().equalsIgnoreCase("Y")) {
        oHrmRecApplnMtnResultDtlBean.setDisqualified("Off");
      } else {
        oHrmRecApplnMtnResultDtlBean.setDisqualified("On");
      } 
      if (oRow.get("INTERVIEW_FLAG").getString().equalsIgnoreCase("Y")) {
        oHrmRecApplnMtnResultDtlBean.setFailedInterview("Off");
      } else {
        oHrmRecApplnMtnResultDtlBean.setFailedInterview("On");
      } 
      if (oRow.get("WRITTEN_TEST_FLAG").getString().equalsIgnoreCase("Y")) {
        oHrmRecApplnMtnResultDtlBean.setFailedWrittenA("Off");
      } else {
        oHrmRecApplnMtnResultDtlBean.setFailedWrittenA("On");
      } 
      if (oRow.get("GD_FLAG").getString().equalsIgnoreCase("Y")) {
        oHrmRecApplnMtnResultDtlBean.setFailedWrittenB("Off");
      } else {
        oHrmRecApplnMtnResultDtlBean.setFailedWrittenB("On");
      } 
      if (oRow.get("MEDICAL_FLAG").getString().equalsIgnoreCase("Y")) {
        oHrmRecApplnMtnResultDtlBean.setMedicalCleared("On");
      } else {
        oHrmRecApplnMtnResultDtlBean.setMedicalCleared("Off");
      } 
      oHrmRecApplnMtnResultDtlBean.setInterviewScore(oRow.get("INTERVIEW_SCORE").getString());
      oHrmRecApplnMtnResultDtlBean.setPanelRanking(oRow.get("RANK").getString());
      oHrmRecApplnMtnResultDtlBean.setTestCenter(oRow.get("TEST_CNTR_NAME").getString());
      oHrmRecApplnMtnResultDtlBean.setTestCentreId(oRow.get("TSTCNTR_MS_ID").getString());
      oHrmRecApplnMtnResultDtlBean.setWrittenScoreA(oRow.get("WRTN_TEST_SCORE").getString());
      oHrmRecApplnMtnResultDtlBean.setWrittenScoreB(oRow.get("GD_SCORE").getString());
      arylstHrmRecApplnMtnResultDtl.add(oHrmRecApplnMtnResultDtlBean);
    } 
    return arylstHrmRecApplnMtnResultDtl;
  }
  
  public void initializeBOImpl() {
    this.headerTable = "HRM_ADVT_APPL_DTL";
  }
  
  public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnAddDtl")) {
      saveHrmRecApplnAddDtl(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnExpDtl")) {
      saveHrmRecApplnExpDtl(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnEduDtl")) {
      saveHrmRecApplnEduDtl(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnLangDtl")) {
      saveHrmRecApplnLangDtl(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnOtherDtl")) {
      saveHrmRecApplnOtherDtl(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnResultDtl")) {
      saveHrmRecApplnResultDtl(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnRef")) {
      saveHrmRecApplnRef(sHeaderPrimaryKey, arylstDetailBeanArray);
    } else if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnTrngDtls")) {
      saveHrmRecApplnTrngDtls(sHeaderPrimaryKey, arylstDetailBeanArray);
    } 
  }
  
  private void saveHrmRecApplnAddDtl(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    String metro = null;
    while (itrBean.hasNext()) {
      HrmRecApplnMtnAddDtlBean oHrmRecApplnMtnAddDtlBean = itrBean.next();
      if (oHrmRecApplnMtnAddDtlBean.getDetailId() == null || oHrmRecApplnMtnAddDtlBean.getDetailId().equalsIgnoreCase(""))
        oHrmRecApplnMtnAddDtlBean.setStatus("N"); 
      if (oHrmRecApplnMtnAddDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnAddDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnAddDtlBean.getPresAddress()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnAddDtlBean.getPresPin()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnAddDtlBean.getPresCity()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnAddDtlBean.getPresState()));
        arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnAddDtlBean.getPresCountry()));
        arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnAddDtlBean.getPresPhone()));
        arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnAddDtlBean.getPermAddress()));
        arylstParam.add(new DBObject(11, 1, 12, oHrmRecApplnMtnAddDtlBean.getPermPin()));
        arylstParam.add(new DBObject(12, 1, 12, oHrmRecApplnMtnAddDtlBean.getPermCity()));
        arylstParam.add(new DBObject(13, 1, 12, oHrmRecApplnMtnAddDtlBean.getPermState()));
        arylstParam.add(new DBObject(14, 1, 12, oHrmRecApplnMtnAddDtlBean.getPermCountry()));
        arylstParam.add(new DBObject(15, 1, 12, oHrmRecApplnMtnAddDtlBean.getPermPhone()));
        arylstParam.add(new DBObject(16, 1, 12, oHrmRecApplnMtnAddDtlBean.getGuardianName()));
        arylstParam.add(new DBObject(17, 1, 12, oHrmRecApplnMtnAddDtlBean.getMotherToungueCode()));
        arylstParam.add(new DBObject(18, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnAddDtlBean.getDateOfBirth())));
        arylstParam.add(new DBObject(19, 1, 12, oHrmRecApplnMtnAddDtlBean.getPlaceOfBirth()));
        arylstParam.add(new DBObject(20, 1, 12, oHrmRecApplnMtnAddDtlBean.getNationalityCode()));
        arylstParam.add(new DBObject(21, 1, 12, oHrmRecApplnMtnAddDtlBean.getMaritalStatus()));
        arylstParam.add(new DBObject(22, 1, 12, oHrmRecApplnMtnAddDtlBean.getSex()));
        arylstParam.add(new DBObject(23, 1, 12, oHrmRecApplnMtnAddDtlBean.getMail()));
        arylstParam.add(new DBObject(24, 1, 12, oHrmRecApplnMtnAddDtlBean.getReservationCategoryId()));
        arylstParam.add(new DBObject(25, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getAppliedEarlier()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(26, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getHandicappedFlag()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(27, 1, 12, oHrmRecApplnMtnAddDtlBean.getReligionId()));
        arylstParam.add(new DBObject(28, 1, 12, oHrmRecApplnMtnAddDtlBean.getBloodGroup()));
        arylstParam.add(new DBObject(29, 1, 12, oHrmRecApplnMtnAddDtlBean.getHobbies()));
        arylstParam.add(new DBObject(30, 1, 12, oHrmRecApplnMtnAddDtlBean.getAddlInfo()));
        arylstParam.add(new DBObject(31, 1, 12, oHrmRecApplnMtnAddDtlBean.getPassportNo()));
        arylstParam.add(new DBObject(32, 1, 12, oHrmRecApplnMtnAddDtlBean.getPlaceOfIssue()));
        arylstParam.add(new DBObject(33, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnAddDtlBean.getExpiryDate())));
        arylstParam.add(new DBObject(34, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnAddDtlBean.getIssueDate())));
        arylstParam.add(new DBObject(35, 1, 12, oHrmRecApplnMtnAddDtlBean.getChequeNo()));
        arylstParam.add(new DBObject(36, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnAddDtlBean.getSubmissionDate())));
        arylstParam.add(new DBObject(37, 1, 12, oHrmRecApplnMtnAddDtlBean.getSubmittedAmount()));
        arylstParam.add(new DBObject(38, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getArrestedBefore()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(39, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getFinedByCourt()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(40, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getImprisonedBefore()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(41, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getProsecutedBefore()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(42, 1, 12, oHrmRecApplnMtnAddDtlBean.getReasons()));
        arylstParam.add(new DBObject(43, 1, 12, oHrmRecApplnMtnAddDtlBean.getHealthRecord()));
        arylstParam.add(new DBObject(44, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getRelatedToEmp()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(45, 1, 12, oHrmRecApplnMtnAddDtlBean.getRelatedEmpId()));
        arylstParam.add(new DBObject(46, 1, 12, String.valueOf(oHrmRecApplnMtnAddDtlBean.getPrevEmpFlag()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(47, 1, 12, oHrmRecApplnMtnAddDtlBean.getPrevEmpDtls()));
        arylstParam.add(new DBObject(48, 1, 12, oHrmRecApplnMtnAddDtlBean.getGrossExpected()));
        arylstParam.add(new DBObject(49, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(50, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
      } 
    } 
    if (bUpdate)
      oBean.executeBatch(); 
  }
  
  private void saveHrmRecApplnResultDtl(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    String metro = null;
    String sMedFlag = null;
    String sQualFlag = null;
    String sWrAFlag = null;
    String sWrBFlag = null;
    String sIntFlag = null;
    while (itrBean.hasNext()) {
      HrmRecApplnMtnResultDtlBean oHrmRecApplnMtnResultDtlBean = itrBean.next();
      if (oHrmRecApplnMtnResultDtlBean.getDetailId() == null || oHrmRecApplnMtnResultDtlBean.getDetailId().equalsIgnoreCase(""))
        oHrmRecApplnMtnResultDtlBean.setStatus("N"); 
      if (oHrmRecApplnMtnResultDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnResultDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        if (oHrmRecApplnMtnResultDtlBean.getFailedWrittenA().equalsIgnoreCase("on")) {
          sWrAFlag = "Y";
        } else {
          sWrAFlag = "N";
        } 
        if (oHrmRecApplnMtnResultDtlBean.getFailedWrittenB().equalsIgnoreCase("on")) {
          sWrBFlag = "Y";
        } else {
          sWrBFlag = "N";
        } 
        if (oHrmRecApplnMtnResultDtlBean.getFailedInterview().equalsIgnoreCase("on")) {
          sIntFlag = "Y";
        } else {
          sIntFlag = "N";
        } 
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnResultDtlBean.getTestCentreId()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnResultDtlBean.getInterviewScore()));
        arylstParam.add(new DBObject(6, 1, 12, sIntFlag));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnResultDtlBean.getWrittenScoreB()));
        arylstParam.add(new DBObject(8, 1, 12, sWrBFlag));
        arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnResultDtlBean.getWrittenScoreA()));
        arylstParam.add(new DBObject(10, 1, 12, sWrAFlag));
        if (oHrmRecApplnMtnResultDtlBean.getMedicalCleared().equalsIgnoreCase("on")) {
          sMedFlag = "Y";
        } else {
          sMedFlag = "N";
        } 
        if (oHrmRecApplnMtnResultDtlBean.getDisqualified().equalsIgnoreCase("on")) {
          sQualFlag = "Y";
        } else {
          sQualFlag = "N";
        } 
        arylstParam.add(new DBObject(11, 1, 12, sMedFlag));
        arylstParam.add(new DBObject(12, 1, 12, oHrmRecApplnMtnResultDtlBean.getPanelRanking()));
        arylstParam.add(new DBObject(13, 1, 12, sQualFlag));
        arylstParam.add(new DBObject(14, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(15, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
      } 
    } 
    if (bUpdate)
      oBean.executeBatch(); 
  }
  
  private void saveHrmRecApplnTrngDtls(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    while (itrBean.hasNext()) {
      HrmRecApplnMtnTrngDtlBean oHrmRecApplnMtnTrngDtlBean = itrBean.next();
      if (oHrmRecApplnMtnTrngDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnTrngDtl(?,?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "I"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnTrngDtlBean.getTxtCourse()));
        arylstParam.add(new DBObject(5, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnTrngDtlBean.getTxtFromDate())));
        arylstParam.add(new DBObject(6, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnTrngDtlBean.getTxtToDate())));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnTrngDtlBean.getTxtSubject()));
        arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnTrngDtlBean.getTxtInstitute()));
        arylstParam.add(new DBObject(9, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnTrngDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnTrngDtl(?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnTrngDtlBean.getDetailId()));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnTrngDtlBean.getTxtCourse()));
        arylstParam.add(new DBObject(5, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnTrngDtlBean.getTxtFromDate())));
        arylstParam.add(new DBObject(6, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnTrngDtlBean.getTxtToDate())));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnTrngDtlBean.getTxtSubject()));
        arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnTrngDtlBean.getTxtInstitute()));
        arylstParam.add(new DBObject(9, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnTrngDtlBean.getStatus().equals("D")) {
        if (!bDelete) {
          oBean1 = new DBUtilitiesBean();
          oBean1.createBatch("HRMRECAPPLNMTN.procDeleteHrRecApplnTrngDtl(?)");
          bDelete = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, oHrmRecApplnMtnTrngDtlBean.getDetailId()));
        oBean1.addToBatch(arylstParam);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bUpdate)
      oBean.executeBatch(); 
    if (bDelete)
      oBean1.executeBatch(); 
  }
  
  private void saveHrmRecApplnRef(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    while (itrBean.hasNext()) {
      HrmRecApplnMtnRefDtlBean oHrmRecApplnRefDtlBean = itrBean.next();
      if (oHrmRecApplnRefDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnRefDtl(?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "I"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnRefDtlBean.getTxtName()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnRefDtlBean.getTxtAddress()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnRefDtlBean.getTxtPhone()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnRefDtlBean.getTxtPosition()));
        arylstParam.add(new DBObject(8, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnRefDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnRefDtl(?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnRefDtlBean.getDetailId()));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnRefDtlBean.getTxtName()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnRefDtlBean.getTxtAddress()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnRefDtlBean.getTxtPhone()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnRefDtlBean.getTxtPosition()));
        arylstParam.add(new DBObject(8, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnRefDtlBean.getStatus().equals("D")) {
        if (!bDelete) {
          oBean1 = new DBUtilitiesBean();
          oBean1.createBatch("HRMRECAPPLNMTN.procDeleteHrRecApplnRefDtl(?)");
          bDelete = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, oHrmRecApplnRefDtlBean.getDetailId()));
        oBean1.addToBatch(arylstParam);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bUpdate)
      oBean.executeBatch(); 
    if (bDelete)
      oBean1.executeBatch(); 
  }
  
  private void saveHrmRecApplnLangDtl(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    while (itrBean.hasNext()) {
      HrmRecApplnMtnLangDtlBean oHrmRecApplnMtnLangDtlBean = itrBean.next();
      if (oHrmRecApplnMtnLangDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnLangDtl(?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "I"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnLangDtlBean.getLangId()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnLangDtlBean.getTxtKnowledgeLevel()));
        arylstParam.add(new DBObject(6, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnLangDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnLangDtl(?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnLangDtlBean.getDetailId()));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnLangDtlBean.getLangId()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnLangDtlBean.getTxtKnowledgeLevel()));
        arylstParam.add(new DBObject(6, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnLangDtlBean.getStatus().equals("D")) {
        if (!bDelete) {
          oBean1 = new DBUtilitiesBean();
          oBean1.createBatch("HRMRECAPPLNMTN.procDeleteHrRecApplnLangDtl(?)");
          bDelete = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, oHrmRecApplnMtnLangDtlBean.getDetailId()));
        oBean1.addToBatch(arylstParam);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bUpdate)
      oBean.executeBatch(); 
    if (bDelete)
      oBean1.executeBatch(); 
  }
  
  private void saveHrmRecApplnEduDtl(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    while (itrBean.hasNext()) {
      HrmRecApplnMtnEduDtlBean oHrmRecApplnMtnEduDtlBean = itrBean.next();
      if (oHrmRecApplnMtnEduDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnEduDtl(?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "I"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtInstCode()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnEduDtlBean.getQualificationId()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtPassYear()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtPercentageMarks()));
        arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtMajorSub()));
        arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtSpeecialisation()));
        arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtOtherProfQuali()));
        arylstParam.add(new DBObject(11, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtSpeecialCourses()));
        arylstParam.add(new DBObject(12, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(13, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnEduDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnEduDtl(?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnEduDtlBean.getDetailId()));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtInstCode()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnEduDtlBean.getQualificationId()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtPassYear()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtPercentageMarks()));
        arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtMajorSub()));
        arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtSpeecialisation()));
        arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtOtherProfQuali()));
        arylstParam.add(new DBObject(11, 1, 12, oHrmRecApplnMtnEduDtlBean.getTxtSpeecialCourses()));
        arylstParam.add(new DBObject(12, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(13, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnEduDtlBean.getStatus().equals("D")) {
        if (!bDelete) {
          oBean1 = new DBUtilitiesBean();
          oBean1.createBatch("HRMRECAPPLNMTN.procDeleteHrRecApplnEduDtl(?)");
          bDelete = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, oHrmRecApplnMtnEduDtlBean.getDetailId()));
        oBean1.addToBatch(arylstParam);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bUpdate)
      oBean.executeBatch(); 
    if (bDelete)
      oBean1.executeBatch(); 
  }
  
  private void saveHrmRecApplnExpDtl(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    String sWorkExp = new String();
    Iterator itrBean = arylstDetailBeanArray.iterator();
    while (itrBean.hasNext()) {
      HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean = itrBean.next();
      sWorkExp = CalculateWorkExp(oHrmRecApplnMtnExpDtlBean);
      if (oHrmRecApplnMtnExpDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnExpDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "I"));
        arylstParam.add(new DBObject(2, 1, 12, null));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtOrganisation()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtLocation()));
        arylstParam.add(new DBObject(8, 1, 12, sWorkExp));
        arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtDesignationCode()));
        arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtReportTo()));
        arylstParam.add(new DBObject(11, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtWorkDesc()));
        arylstParam.add(new DBObject(12, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtNoPersonSupervised()));
        arylstParam.add(new DBObject(13, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtStartingSal()));
        arylstParam.add(new DBObject(14, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtLeavingSal()));
        arylstParam.add(new DBObject(15, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtBasic()));
        arylstParam.add(new DBObject(16, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtDA()));
        arylstParam.add(new DBObject(17, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtHRA()));
        arylstParam.add(new DBObject(18, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtConv()));
        arylstParam.add(new DBObject(19, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtOtherAllowances()));
        arylstParam.add(new DBObject(20, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtIncentives()));
        arylstParam.add(new DBObject(21, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtBonus()));
        arylstParam.add(new DBObject(22, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(23, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnExpDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnExpDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnExpDtlBean.getDetailId()));
        arylstParam.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom()));
        arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo()));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtOrganisation()));
        arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtLocation()));
        arylstParam.add(new DBObject(8, 1, 12, sWorkExp));
        arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtDesignationCode()));
        arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtReportTo()));
        arylstParam.add(new DBObject(11, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtWorkDesc()));
        arylstParam.add(new DBObject(12, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtNoPersonSupervised()));
        arylstParam.add(new DBObject(13, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtStartingSal()));
        arylstParam.add(new DBObject(14, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtLeavingSal()));
        arylstParam.add(new DBObject(15, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtBasic()));
        arylstParam.add(new DBObject(16, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtDA()));
        arylstParam.add(new DBObject(17, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtHRA()));
        arylstParam.add(new DBObject(18, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtConv()));
        arylstParam.add(new DBObject(19, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtOtherAllowances()));
        arylstParam.add(new DBObject(20, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtIncentives()));
        arylstParam.add(new DBObject(21, 1, 12, oHrmRecApplnMtnExpDtlBean.getTxtBonus()));
        arylstParam.add(new DBObject(22, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(23, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
        continue;
      } 
      if (oHrmRecApplnMtnExpDtlBean.getStatus().equals("D")) {
        if (!bDelete) {
          oBean1 = new DBUtilitiesBean();
          oBean1.createBatch("HRMRECAPPLNMTN.procDeleteHrRecApplnExpDtl(?)");
          bDelete = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, oHrmRecApplnMtnExpDtlBean.getDetailId()));
        oBean1.addToBatch(arylstParam);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bUpdate)
      oBean.executeBatch(); 
    if (bDelete)
      oBean1.executeBatch(); 
  }
  
  private void saveHrmRecApplnOtherDtl(String sHeaderPrimaryKey, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bUpdate = false;
    boolean bDelete = false;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    String metro = null;
    String sMedFlag = null;
    String sQualFlag = null;
    String sWrAFlag = null;
    String sWrBFlag = null;
    String sIntFlag = null;
    while (itrBean.hasNext()) {
      HrmRecApplnMtnOtherDtlBean oHrmRecApplnMtnOtherDtlBean = itrBean.next();
      if (oHrmRecApplnMtnOtherDtlBean.getDetailId() == null || oHrmRecApplnMtnOtherDtlBean.getDetailId().equalsIgnoreCase(""))
        oHrmRecApplnMtnOtherDtlBean.setStatus("N"); 
      if (oHrmRecApplnMtnOtherDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMRECAPPLNMTN.procUpsertHrRecApplnResultDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        arylstParam = new ArrayList();
        arylstParam.add(new DBObject(1, 1, 12, "U"));
        arylstParam.add(new DBObject(2, 1, 12, sHeaderPrimaryKey));
        if (oHrmRecApplnMtnOtherDtlBean.getFailedWrittenA().equalsIgnoreCase("on")) {
          sWrAFlag = "Y";
        } else {
          sWrAFlag = "N";
        } 
        if (oHrmRecApplnMtnOtherDtlBean.getFailedWrittenB().equalsIgnoreCase("on")) {
          sWrBFlag = "Y";
        } else {
          sWrBFlag = "N";
        } 
        if (oHrmRecApplnMtnOtherDtlBean.getQualInterview().equalsIgnoreCase("on")) {
          sIntFlag = "Y";
        } else {
          sIntFlag = "N";
        } 
        arylstParam.add(new DBObject(3, 1, 12, oHrmRecApplnMtnOtherDtlBean.getTestCentreId()));
        arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnOtherDtlBean.getInterviewScore()));
        arylstParam.add(new DBObject(5, 1, 12, sIntFlag));
        arylstParam.add(new DBObject(6, 1, 12, oHrmRecApplnMtnOtherDtlBean.getWrittenScoreB()));
        arylstParam.add(new DBObject(7, 1, 12, sWrBFlag));
        arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnOtherDtlBean.getWrittenScoreA()));
        arylstParam.add(new DBObject(9, 1, 12, sWrAFlag));
        if (oHrmRecApplnMtnOtherDtlBean.getMedicalCleared().equalsIgnoreCase("on")) {
          sMedFlag = "Y";
        } else {
          sMedFlag = "N";
        } 
        if (oHrmRecApplnMtnOtherDtlBean.getDisqualified().equalsIgnoreCase("on")) {
          sQualFlag = "Y";
        } else {
          sQualFlag = "N";
        } 
        arylstParam.add(new DBObject(10, 1, 12, sMedFlag));
        arylstParam.add(new DBObject(11, 1, 12, String.valueOf(oHrmRecApplnMtnOtherDtlBean.getQualInterview2()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(12, 1, 12, String.valueOf(oHrmRecApplnMtnOtherDtlBean.getQualInterview3()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(13, 1, 12, oHrmRecApplnMtnOtherDtlBean.getRating()));
        arylstParam.add(new DBObject(14, 1, 12, sQualFlag));
        arylstParam.add(new DBObject(15, 1, 12, String.valueOf(oHrmRecApplnMtnOtherDtlBean.getAppointedFlag()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(16, 1, 12, String.valueOf(oHrmRecApplnMtnOtherDtlBean.getJoinedOrganisation()).equalsIgnoreCase("on") ? "Y" : "N"));
        arylstParam.add(new DBObject(17, 1, 12, oHrmRecApplnMtnOtherDtlBean.getInterviewScore2()));
        arylstParam.add(new DBObject(18, 1, 12, oHrmRecApplnMtnOtherDtlBean.getInterviewScore3()));
        arylstParam.add(new DBObject(19, 1, 12, this.oUserInfo.getUserTypeId()));
        arylstParam.add(new DBObject(20, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(arylstParam);
      } 
    } 
    if (bUpdate)
      oBean.executeBatch(); 
  }
  
  public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList arylstParam = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmRecApplnMtnHdrBean oHrmRecApplnMtnHdrBean = (HrmRecApplnMtnHdrBean)oBaseHeaderBean;
    if (ScreenMode.equalsIgnoreCase("N")) {
      arylstParam = new ArrayList();
      arylstParam.add(new DBObject(1, 1, 12, "i"));
      arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnHdrBean.getApplicantFirstName()));
      arylstParam.add(new DBObject(3, 1, 12, oHrmRecApplnMtnHdrBean.getApplicantMiddleName()));
      arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnHdrBean.getApplicantLastName()));
      arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnHdrBean.getApplicationNo()));
      arylstParam.add(new DBObject(6, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnHdrBean.getApplicationDate())));
      arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnHdrBean.getDesignationId()));
      arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnHdrBean.getEmployeeStatus()));
      arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnHdrBean.getRollNo()));
      arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnHdrBean.getReferenceId()));
      arylstParam.add(new DBObject(11, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParam.add(new DBObject(12, 1, 12, this.oUserInfo.getSiteId()));
      arylstParam.add(new DBObject(13, 1, 12, null));
      arylstParam.add(new DBObject(14, 2, 12));
      arylstParam.add(new DBObject(15, 2, 12));
      arylstParam.add(new DBObject(16, 2, 12));
      arylstParam.add(new DBObject(17, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECAPPLNMTN.procUpsertHrRecApplnHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
      System.out.println(returnString);
    } else if (ScreenMode.equalsIgnoreCase("U")) {
      arylstParam = new ArrayList();
      arylstParam.add(new DBObject(1, 1, 12, "u"));
      arylstParam.add(new DBObject(2, 1, 12, oHrmRecApplnMtnHdrBean.getApplicantFirstName()));
      arylstParam.add(new DBObject(3, 1, 12, oHrmRecApplnMtnHdrBean.getApplicantMiddleName()));
      arylstParam.add(new DBObject(4, 1, 12, oHrmRecApplnMtnHdrBean.getApplicantLastName()));
      arylstParam.add(new DBObject(5, 1, 12, oHrmRecApplnMtnHdrBean.getApplicationNo()));
      arylstParam.add(new DBObject(6, 1, 12, EnrgiseUtil.convertToSqlDate(oHrmRecApplnMtnHdrBean.getApplicationDate())));
      arylstParam.add(new DBObject(7, 1, 12, oHrmRecApplnMtnHdrBean.getDesignationId()));
      arylstParam.add(new DBObject(8, 1, 12, oHrmRecApplnMtnHdrBean.getEmployeeStatus()));
      arylstParam.add(new DBObject(9, 1, 12, oHrmRecApplnMtnHdrBean.getRollNo()));
      arylstParam.add(new DBObject(10, 1, 12, oHrmRecApplnMtnHdrBean.getReferenceId()));
      arylstParam.add(new DBObject(11, 1, 12, this.oUserInfo.getUserTypeId()));
      arylstParam.add(new DBObject(12, 1, 12, this.oUserInfo.getSiteId()));
      arylstParam.add(new DBObject(13, 1, 12, oHrmRecApplnMtnHdrBean.getHeaderPrimaryKey()));
      arylstParam.add(new DBObject(14, 2, 12));
      arylstParam.add(new DBObject(15, 2, 12));
      arylstParam.add(new DBObject(16, 2, 12));
      arylstParam.add(new DBObject(17, 2, 4));
      ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMRECAPPLNMTN.procUpsertHrRecApplnHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = arylstOutArray.get(0);
      returnString = (String)oOutObject.getObject();
      System.out.println(returnString);
    } 
    return returnString;
  }
  
  public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
    System.out.println("Update ille!");
  }
  
  public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
    return "saveNewHeaderImpl ille!";
  }
  
  public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList arylstDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    HrmRecApplnMtnHdrBean oHrmRecApplnMtnHdrBean = (HrmRecApplnMtnHdrBean)oBaseHeaderBean;
    if (bHeaderDataChanged)
      if (!sScreenMode.equalsIgnoreCase("D"))
        checkMandatoryHeader((HrmRecApplnMtnHdrBean)oBaseHeaderBean);  
    if (bDetailDataChanged)
      if (!sScreenMode.equalsIgnoreCase("D")) {
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnAddDtl")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnAddDtlBean oHrmRecApplnMtnAddDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnAddDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryAddDtl(oHrmRecApplnMtnAddDtlBean, rowCount); 
            rowCount++;
          } 
        } 
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnLangDtl")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnLangDtlBean oHrmRecApplnMtnLangDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnLangDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryLangDtl(oHrmRecApplnMtnLangDtlBean, rowCount); 
            rowCount++;
          } 
        } 
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnEduDtl")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnEduDtlBean oHrmRecApplnMtnEduDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnEduDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryEduDtl(oHrmRecApplnMtnEduDtlBean, rowCount); 
            rowCount++;
          } 
        } 
        int percentPF = 0;
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnResultDtl")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnResultDtlBean oHrmRecApplnMtnResultDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnResultDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryResultDtl(oHrmRecApplnMtnResultDtlBean, rowCount); 
          } 
          rowCount++;
        } 
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnExpDtl")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnExpDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryExpDtl(oHrmRecApplnMtnExpDtlBean, rowCount); 
            rowCount++;
          } 
        } 
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnRef")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnRefDtlBean oHrmRecApplnMtnRefDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnRefDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryRefDtl(oHrmRecApplnMtnRefDtlBean, rowCount); 
            rowCount++;
          } 
        } 
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnTrngDtls")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnTrngDtlBean oHrmRecApplnMtnTrngDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnTrngDtlBean.getStatus().equalsIgnoreCase("D"))
              checkMandatoryTrngDtl(oHrmRecApplnMtnTrngDtlBean, rowCount); 
            rowCount++;
          } 
        } 
        if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnOtherDtl")) {
          Iterator itrBean1 = arylstDetailBeanArray.iterator();
          int rowCount = 1;
          while (itrBean1.hasNext()) {
            HrmRecApplnMtnOtherDtlBean oHrmRecApplnMtnOtherDtlBean = itrBean1.next();
            if (!oHrmRecApplnMtnOtherDtlBean.getStatus().equalsIgnoreCase("D"));
            rowCount++;
          } 
        } 
      }  
  }
  
  private void checkMandatoryHeader(HrmRecApplnMtnHdrBean oHrmRecApplnMtnHdrBean) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oParams = new ArrayList();
    ArrayList oErrorList = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnHdrBean.getApplicationNo())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.applicationNo");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnHdrBean.getReferenceNo())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.referenceNo");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnHdrBean.getApplicantFirstName())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.applicationFirstName");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnHdrBean.getApplicantLastName())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.applicationLastName");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnHdrBean.getApplicationDate())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.applicationDate");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkMandatoryAddDtl(HrmRecApplnMtnAddDtlBean oHrmRecApplnMtnAddDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getMotherTongue())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.motherTongue");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getDateOfBirth())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.DOB");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getNationality())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.nationality");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getSex())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.sex");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getMaritalStatus())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.maritalStatus");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPermCountry())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.country");
      oParams = new ArrayList();
      oParams.add("Permanent Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPresCountry())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.country");
      oParams = new ArrayList();
      oParams.add("Present Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPermCity())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.city");
      oParams = new ArrayList();
      oParams.add("Permanent Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPresCity())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.city");
      oParams = new ArrayList();
      oParams.add("Present Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPermState())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpPersonalDetailsAddress.state");
      oParams = new ArrayList();
      oParams.add("Permanent Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPresState())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpPersonalDetailsAddress.state");
      oParams = new ArrayList();
      oParams.add("Present Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPermAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpPersonalDetailsAddress.address");
      oParams = new ArrayList();
      oParams.add("Permanent Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getPresAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpPersonalDetailsAddress.address");
      oParams = new ArrayList();
      oParams.add("Present Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnAddDtlBean.getReligion())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmEmpPersonalDetails.religion");
      oParams = new ArrayList();
      oParams.add("Present Address");
      oParams.add(oMessageKey);
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.onlyDetailAdd.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkMandatoryLangDtl(HrmRecApplnMtnLangDtlBean oHrmRecApplnMtnLangDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnLangDtlBean.getTxtKnowledgeLevel())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.knowledgeLevel");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnLangDtlBean.getTxtLanguageCode())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.languageCode");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkMandatoryEduDtl(HrmRecApplnMtnEduDtlBean oHrmRecApplnMtnEduDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnEduDtlBean.getTxtInstCode())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.instCode");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnEduDtlBean.getTxtQualification())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.qualification");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnEduDtlBean.getTxtPercentageMarks())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.percentageMarks");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnEduDtlBean.getTxtPassYear())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.passYear");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkMandatoryResultDtl(HrmRecApplnMtnResultDtlBean oHrmRecApplnMtnResultDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    rowCount++;
    reportError(oErrorList);
  }
  
  private void checkMandatoryExpDtl(HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.periodFrom");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.periodTo");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnExpDtlBean.getTxtOrganisation())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.organisation");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnExpDtlBean.getTxtLocation())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.location");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkMandatoryTrngDtl(HrmRecApplnMtnTrngDtlBean oHrmRecApplnMtnTrngDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtCourse())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.course");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtFromDate())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.fromDate");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtToDate())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.toDate");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtInstitute())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.institute");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkMandatoryRefDtl(HrmRecApplnMtnRefDtlBean oHrmRecApplnMtnRefDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    ArrayList oParams = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnRefDtlBean.getTxtName())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.name");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmRecApplnMtnRefDtlBean.getTxtAddress())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmApplicationMaintenance.address");
      oParams = new ArrayList();
      oParams.add(oMessageKey);
      oParams.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParams, "E"));
    } 
    reportError(oErrorList);
  }
  
  public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
  
  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();
    additionalFieldValidationImpl(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, arylstDetailBeanArray, bDetailDataChanged, oDetailPicked);
    HrmRecApplnMtnHdrBean oHrmRecApplnMtnHdrBean = (HrmRecApplnMtnHdrBean)oBaseHeaderBean;
    if (bHeaderDataChanged)
      if (!sScreenMode.equalsIgnoreCase("D"))
        checkUniqueHeader((HrmRecApplnMtnHdrBean)oBaseHeaderBean);  
    if (bDetailDataChanged) {
      if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnEduDtl")) {
        Iterator itrBean1 = arylstDetailBeanArray.iterator();
        int rowCount = 1;
        while (itrBean1.hasNext()) {
          HrmRecApplnMtnEduDtlBean oHrmRecApplnMtnEduDtlBean = itrBean1.next();
          if (!oHrmRecApplnMtnEduDtlBean.getStatus().equals("D")) {
            checkPercentage(arylstDetailBeanArray);
            getyyyyDateFormat(arylstDetailBeanArray, arylstErrorList);
          } 
        } 
        rowCount++;
      } 
      if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnExpDtl")) {
        Iterator itrBean1 = arylstDetailBeanArray.iterator();
        int rowCount = 1;
        while (itrBean1.hasNext()) {
          HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean = itrBean1.next();
          if (!oHrmRecApplnMtnExpDtlBean.getStatus().equals("D"))
            checkDateValidation(arylstDetailBeanArray, arylstErrorList); 
        } 
        rowCount++;
      } 
      if (sScreenName.equalsIgnoreCase("HrmRecApplnMtnTrngDtls")) {
        Iterator itrBean1 = arylstDetailBeanArray.iterator();
        int rowCount = 1;
        while (itrBean1.hasNext()) {
          HrmRecApplnMtnTrngDtlBean oHrmRecApplnMtnTrngDtlBean = itrBean1.next();
          if (!oHrmRecApplnMtnTrngDtlBean.getStatus().equals("D"))
            checkTrngDateValidation(arylstDetailBeanArray, arylstErrorList); 
        } 
        rowCount++;
      } 
    } 
    reportError(arylstErrorList);
  }
  
  private void checkDateValidation(ArrayList arylstDetailBeanArray, ArrayList arylstErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    Iterator itrBean1 = arylstDetailBeanArray.iterator();
    int iCount = 1;
    while (itrBean1.hasNext()) {
      HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean = itrBean1.next();
      if (!oHrmRecApplnMtnExpDtlBean.getStatus().equalsIgnoreCase("D")) {
        String sEffectFrom = oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom();
        String sEffectTo = oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo();
        HrmCommonBO oBO = new HrmCommonBO();
        String sysDate = oBO.getSysDate();
        int year = Integer.parseInt(sysDate.substring(6, sysDate.length()));
        int month = Integer.parseInt(sysDate.substring(3, 5));
        if (year < Integer.parseInt(sEffectTo.substring(2, 6))) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodTo"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmRecApplnMtn.checkExpTo", arylstParam));
        } 
        if (year == Integer.parseInt(sEffectTo.substring(2, 6)))
          if (month < Integer.parseInt(sEffectTo.substring(0, 2))) {
            arylstParam = new ArrayList();
            arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodTo"));
            arylstParam.add(new Integer(iCount));
            arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmRecApplnMtn.checkExpTo", arylstParam));
          }  
        if (Integer.parseInt(sEffectFrom.substring(0, 2)) < 1 || Integer.parseInt(sEffectFrom.substring(0, 2)) > 12) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodFrom"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("hrms.dateValidation.month", arylstParam));
        } 
        if (Integer.parseInt(sEffectFrom.substring(2, 3)) == 0) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodFrom"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("hrms.dateValidation.year", arylstParam));
        } 
        if (Integer.parseInt(sEffectTo.substring(0, 2)) < 1 || Integer.parseInt(sEffectTo.substring(0, 2)) > 12) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodTo"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("hrms.dateValidation.month", arylstParam));
        } 
        if (Integer.parseInt(sEffectTo.substring(2, 3)) == 0) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodTo"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("hrms.dateValidation.year", arylstParam));
        } 
        int iFromMonth = Integer.parseInt(sEffectFrom.substring(0, 2));
        int iFromYear = Integer.parseInt(sEffectFrom.substring(2, 6));
        int iToMonth = Integer.parseInt(sEffectTo.substring(0, 2));
        int iToYear = Integer.parseInt(sEffectTo.substring(2, 6));
        if (iFromYear > iToYear) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodFrom"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmRecApplnMtn.checkExp", arylstParam));
        } 
        if (iFromYear == iToYear)
          if (iFromMonth >= iToMonth) {
            arylstParam = new ArrayList();
            arylstParam.add(new MessageKey("hrm.HrmApplicationMaintenance.periodFrom"));
            arylstParam.add(new Integer(iCount));
            arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmRecApplnMtn.checkExp", arylstParam));
          }  
      } 
    } 
  }
  
  private void checkTrngDateValidation(ArrayList arylstDetailBeanArray, ArrayList arylstErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    Iterator itrBean1 = arylstDetailBeanArray.iterator();
    int iCount = 1;
    while (itrBean1.hasNext()) {
      HrmRecApplnMtnTrngDtlBean oHrmRecApplnMtnTrngDtlBean = itrBean1.next();
      if (!oHrmRecApplnMtnTrngDtlBean.getStatus().equalsIgnoreCase("D")) {
        DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
        if (EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtFromDate())) {
          int dateFlag = EnrgiseUtil.compareDates(dateFormat, oHrmRecApplnMtnTrngDtlBean.getTxtToDate(), oHrmRecApplnMtnTrngDtlBean.getTxtFromDate());
          if (dateFlag == -1 && dateFlag != -2) {
            arylstParam = new ArrayList();
            arylstParam.add("");
            arylstParam.add(new Integer(0));
            arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmApplicationMaintenance.dateConstraintViolated", arylstParam));
          } 
        } 
        if (EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtToDate())) {
          int dateFlag1 = EnrgiseUtil.compareDates(dateFormat, EnrgiseUtil.convertToString(EnrgiseUtil.getSysDate()), oHrmRecApplnMtnTrngDtlBean.getTxtToDate());
          if (dateFlag1 == -1 && dateFlag1 != -2) {
            arylstParam = new ArrayList();
            arylstParam.add("");
            arylstParam.add(new Integer(0));
            arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmApplicationMaintenance.dateConstraintViolated2", arylstParam));
          } 
        } 
        if (EnrgiseUtil.checkString(oHrmRecApplnMtnTrngDtlBean.getTxtFromDate())) {
          int dateFlag1 = EnrgiseUtil.compareDates(dateFormat, EnrgiseUtil.convertToString(EnrgiseUtil.getSysDate()), oHrmRecApplnMtnTrngDtlBean.getTxtFromDate());
          if (dateFlag1 == -1 && dateFlag1 != -2) {
            arylstParam = new ArrayList();
            arylstParam.add("");
            arylstParam.add(new Integer(0));
            arylstErrorList.add(new EnrgiseMessageKeyException("hrm.HrmApplicationMaintenance.dateConstraintViolated1", arylstParam));
          } 
        } 
      } 
    } 
  }
  
  private void getyyyyDateFormat(ArrayList arylstDetailBeanArray, ArrayList arylstErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstParam = new ArrayList();
    HrmCommonBO oBO = new HrmCommonBO();
    Iterator itrBean1 = arylstDetailBeanArray.iterator();
    int iCount = 1;
    while (itrBean1.hasNext()) {
      HrmRecApplnMtnEduDtlBean oHrmRecApplnMtnEduDtlBean = itrBean1.next();
      if (!oHrmRecApplnMtnEduDtlBean.getStatus().equalsIgnoreCase("D")) {
        String sEffectFrom = oHrmRecApplnMtnEduDtlBean.getTxtPassYear();
        int iMMEffectFrom = Integer.parseInt(sEffectFrom);
        String sysDate = oBO.getSysDate();
        if (iMMEffectFrom <= 1900) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("Pass Year"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("wenrgise.empPers.detail.dateConstraintViolated", arylstParam));
          continue;
        } 
        if (iMMEffectFrom > Integer.parseInt(sysDate.substring(6, 10))) {
          arylstParam = new ArrayList();
          arylstParam.add(new MessageKey("Pass Year"));
          arylstParam.add(new Integer(iCount));
          arylstErrorList.add(new EnrgiseMessageKeyException("wenrgise.empPers.detail.dateConstraintViolated", arylstParam));
        } 
      } 
    } 
  }
  
  private void checkUniqueHeader(HrmRecApplnMtnHdrBean oHrmRecApplnMtnHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstList1 = new ArrayList();
    ArrayList arylstParam = new ArrayList();
    String sQuery = String.valueOf(String.valueOf(" Select ID as ID from HRM_ADVT_APPL_DTL where APPL_NO='").concat(String.valueOf(oHrmRecApplnMtnHdrBean.getApplicationNo()))).concat(String.valueOf("'"));
    System.out.println(sQuery);
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    ArrayList arylstList = oBean.executeQuery(sQuery);
    Iterator itrBean = arylstList.iterator();
    if (itrBean.hasNext()) {
      QueryRow oRow = itrBean.next();
      if (!oRow.get("ID").getString().equalsIgnoreCase(oHrmRecApplnMtnHdrBean.getHeaderPrimaryKey())) {
        arylstParam = new ArrayList();
        arylstParam.add("");
        arylstParam.add(new Integer(0));
        arylstList1.add(new EnrgiseMessageKeyException("wenrgise.common.uniqueConstraintViolated", arylstParam));
      } 
    } 
    reportError(arylstList1);
  }
  
  private void checkPercentage(ArrayList arylstDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstList = new ArrayList();
    ArrayList arylstParam = new ArrayList();
    int count = 0;
    Iterator itrBean = arylstDetailBeanArray.iterator();
    int totalDuration = 0;
    while (itrBean.hasNext()) {
      HrmRecApplnMtnEduDtlBean oHrmRecApplnMtnEduDtlBean = arylstDetailBeanArray.get(count);
      float fPercent = Float.parseFloat(oHrmRecApplnMtnEduDtlBean.getTxtPercentageMarks());
      if (fPercent > 100) {
        arylstParam = new ArrayList();
        arylstParam.add("");
        arylstParam.add(new Integer(0));
        arylstList.add(new EnrgiseMessageKeyException("hrm.HrmEmpPersonalDetailsEdu.checkPercent", arylstParam));
      } 
      count++;
      itrBean.next();
    } 
    reportError(arylstList);
  }
  
  public LovVO getHrmRecApplnRefNoLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("hrm.HrmAdvertisementAttribute.id");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.referenceNo");
    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();
    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, "HRMRECAPPLNMTN.procGetHrmRecRefNoLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("CODE").getString());
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  public LovVO getHrmRecApplnDesigLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("hrm.HrmAdvertisementAttribute.id");
    arylstHeaderList.add("hrm.HrmAdvertisementAttribute.id");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.applForGrade");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.applForDesignation");
    arylstHeaderList.add("hrm.HrmAdvertisementAttribute.id");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.resvCategory");
    oLovVO.setHeaderList(arylstHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("H");
    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.getProperty("referenceNo") != null)
      sQuerySearch2 = oLovQueryVO.getProperty("referenceNo"); 
    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, "HRMRECAPPLNMTN.procGetHrmRecDesigLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("DESIG_ID").getString());
      oLOVBean.setDetailField3(oRow.get("GRADE").getString());
      oLOVBean.setDetailField4(oRow.get("DESIG_NAME").getString());
      oLOVBean.setDetailField5(oRow.get("RESERVATION_ID").getString());
      oLOVBean.setDetailField6(oRow.get("RESERVATION_NAME").getString());
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  public LovVO getHrmRecApplnApplnNoLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("id");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.applicationNo");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.applicationDate");
    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, "HRMRECAPPLNMTN.procGetHrmRecApplNoLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("APPL_NO").getString());
      oLOVBean.setDetailField3(EnrgiseUtil.convertToString(oRow.get("APPL_DATE").getDate()));
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  public LovVO getHrmRecApplnLangCodeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.languageCode");
    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();
    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, "HRMRECAPPLNMTN.procGetHrmRecLangLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("DESCRIPTION").getString());
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  public LovVO getHrmRecApplnKnowCodeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.knowledgeLevel");
    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();
    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, "HRMRECAPPLNMTN.procGetHrmRecKnowCodeLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("NAME").getString());
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  public LovVO getHrmRecApplnResvCatCodeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.resvCategory");
    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();
    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, "HRMRECAPPLNMTN.procGetHrmRecResCatLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("NAME").getString());
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  public LovVO getHrmRecApplnTestCodeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList arylstHeaderList = new ArrayList();
    arylstHeaderList.add("ID");
    arylstHeaderList.add("hrm.HrmApplicationMaintenance.testCenter");
    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();
    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, "HRMRECAPPLNMTN.procGetHrmRecTestCtrLOVdata(?,?,?,?,?,?)");
    DBObject oOutObject = arylstOutArray.get(0);
    arylstParam = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = arylstParam.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        arylstParam = new ArrayList(); 
      count++;
      oRow = (QueryRow)iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("NAME").getString());
      arylstParam.add(oLOVBean);
    } 
    oLovVO.setDetailList(arylstParam);
    return oLovVO;
  }
  
  private String CalculateWorkExp(HrmRecApplnMtnExpDtlBean oHrmRecApplnMtnExpDtlBean) throws EnrgiseSystemException {
    ArrayList oList = new ArrayList();
    int iFromDate = 0;
    int iFromYear = 0;
    int iToDate = 0;
    int iToYear = 0;
    int iExp = 0;
    int iNewToDate = 0;
    if (EnrgiseUtil.checkString(oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom())) {
      iFromDate = Integer.parseInt(oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom().substring(0, 2));
      iFromYear = Integer.parseInt(oHrmRecApplnMtnExpDtlBean.getTxtPeriodFrom().substring(2, 6));
    } 
    if (EnrgiseUtil.checkString(oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo())) {
      iToDate = Integer.parseInt(oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo().substring(0, 2));
      iToYear = Integer.parseInt(oHrmRecApplnMtnExpDtlBean.getTxtPeriodTo().substring(2, 6));
    } 
    if (iToDate < iFromDate) {
      iNewToDate = iToDate + 12;
      if (iToYear > iFromYear) {
        iExp = (iToYear - iFromYear) * 12 + iNewToDate - iFromDate - 12;
      } else if (iToYear == iFromYear) {
        iExp = iNewToDate - iFromDate;
      } 
    } else if (iToDate > iFromDate) {
      if (iToYear > iFromYear) {
        iExp = (iToYear - iFromYear) * 12 + iToDate - iFromDate;
      } else if (iToYear == iFromYear) {
        iExp = iToDate - iFromDate;
      } 
    } else if (iFromDate == iToDate) {
      if (iToYear > iFromYear) {
        iExp = (iToYear - iFromYear) * 12;
      } else if (iToYear == iFromYear) {
        iExp = iFromDate - iToDate;
      } 
    } 
    return String.valueOf(iExp);
  }
}
