package wenrgise.hrms.ejb.business;

import java.lang.reflect.Array;
import java.sql.Timestamp;
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.HrmPrmTestScoreDtlBean;
import wenrgise.hrms.bean.HrmPrmTestScoreHdrBean;
import wenrgise.hrms.vo.HrmPrmTestScoreQVO;

public class HrmPrmTestScoreBO extends HrmBaseBO {
  public HrmPrmTestScoreBO() {}
  
  public HrmPrmTestScoreBO(UserInfo oUserinfo) {
    super(oUserinfo);
  }
  
  public RecordMetaInfo getHrmPrmTCHdrMetaInfo(HrmPrmTestScoreQVO oHrmPrmTestScoreQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    Timestamp oWhenPicked = null;
    int count = 0;
    BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, 12, oHrmPrmTestScoreQVO.getHeaderPrimaryKey()));
    oParameters.add(new DBObject(2, 1, 12, oHrmPrmTestScoreQVO.getPositionId()));
    oParameters.add(new DBObject(3, 1, 12, oHrmPrmTestScoreQVO.getExamType()));
    oParameters.add(new DBObject(4, 2, -5));
    oParameters.add(new DBObject(5, 2, 93));
    oParameters.add(new DBObject(6, 2, 12));
    oParameters.add(new DBObject(7, 2, 12));
    oParameters.add(new DBObject(8, 2, 4));
    ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_GetHrPROMTCCount(?,?,?,?,?,?,?,?)");
    RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
    DBObject oTimeObject = oOutArray.get(1);
    oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
    DBObject oTotalRecord = oOutArray.get(0);
    oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
    return oRecordMetaInfo;
  }
  
  public ArrayList getHrmPrmTCHdrInfo(HrmPrmTestScoreQVO oHrmPrmTestScoreQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    Timestamp oWhenPicked = null;
    int count = 0;
    BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
    ArrayList oHeaderList = null;
    if (oHrmPrmTestScoreQVO == null)
      oHrmPrmTestScoreQVO = new HrmPrmTestScoreQVO(); 
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
    oParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
    oParameters.add(new DBObject(3, 1, 12, oHrmPrmTestScoreQVO.getHeaderPrimaryKey()));
    oParameters.add(new DBObject(4, 1, 12, oHrmPrmTestScoreQVO.getPositionId()));
    oParameters.add(new DBObject(5, 1, 12, oHrmPrmTestScoreQVO.getExamType()));
    oParameters.add(new DBObject(6, 2, -10));
    oParameters.add(new DBObject(7, 2, 12));
    oParameters.add(new DBObject(8, 2, 12));
    oParameters.add(new DBObject(9, 2, 4));
    ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_GetHrPROMTCHdrInfo(?,?,?,?,?,?,?,?,?)");
    DBObject oOutObject = oOutArray.get(0);
    ArrayList oList = (ArrayList)oOutObject.getObject();
    if (oList.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    HashMap oColumns = null;
    Iterator oIt = oList.iterator();
    while (oIt.hasNext()) {
      if (count == 0)
        oHeaderList = new ArrayList(); 
      count++;
      oRow = oIt.next();
      HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean = new HrmPrmTestScoreHdrBean();
      oHrmPrmTestScoreHdrBean.setHeaderPrimaryKey(oRow.get("hdrid").getString());
      oHrmPrmTestScoreHdrBean.setExamDesc(oRow.get("description").getString());
      oHrmPrmTestScoreHdrBean.setExamType(oRow.get("exam_type").getString());
      oHrmPrmTestScoreHdrBean.setMaxPoints(oRow.get("max_point").getString());
      oHrmPrmTestScoreHdrBean.setMaxScore(oRow.get("max_score").getString());
      oHrmPrmTestScoreHdrBean.setGradeId(oRow.get("GRADE_ID").getString());
      oHrmPrmTestScoreHdrBean.setGradeCode(oRow.get("gradeCode").getString());
      oHrmPrmTestScoreHdrBean.setGradeDesc(oRow.get("gradeDesc").getString());
      oHrmPrmTestScoreHdrBean.setDesignationId(oRow.get("desigid").getString());
      oHrmPrmTestScoreHdrBean.setDesigCode(oRow.get("desigcode").getString());
      oHrmPrmTestScoreHdrBean.setDesigDesc(oRow.get("designation").getString());
      oHeaderList.add(oHrmPrmTestScoreHdrBean);
    } 
    return oHeaderList;
  }
  
  public RecordMetaInfo getHrmPrmTCDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, 12, lPrimaryKey));
    oParameters.add(new DBObject(2, 2, -5));
    oParameters.add(new DBObject(3, 2, 93));
    oParameters.add(new DBObject(4, 2, 12));
    oParameters.add(new DBObject(5, 2, 12));
    oParameters.add(new DBObject(6, 2, 4));
    ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_HrAdvtDtlCount(?,?,?,?,?,?)");
    RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
    DBObject oTotalRecord = oOutArray.get(0);
    oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
    DBObject oTimeObject = oOutArray.get(1);
    oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
    return oRecordMetaInfo;
  }
  
  public ArrayList getHrmPrmTCDetailInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    BaseDetailVO oBaseDetailVO = null;
    ArrayList oHrmPosKPAPtsDetail = null;
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition)));
    oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
    oParameters.add(new DBObject(3, 1, 12, lPrimaryKey));
    oParameters.add(new DBObject(4, 2, -10));
    oParameters.add(new DBObject(5, 2, 12));
    oParameters.add(new DBObject(6, 2, 12));
    oParameters.add(new DBObject(7, 2, 4));
    ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_GetHrmAdvtDtlInfo(?,?,?,?,?,?,?)");
    DBObject oOutObject = oOutArray.get(0);
    ArrayList oList = (ArrayList)oOutObject.getObject();
    if (oList.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    QueryRow oRow = null;
    QueryValue oValue = null;
    HashMap oColumns = null;
    Iterator oIt = oList.iterator();
    while (oIt.hasNext()) {
      if (count == 0)
        oHrmPosKPAPtsDetail = new ArrayList(); 
      count++;
      oRow = oIt.next();
      HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean = new HrmPrmTestScoreDtlBean();
      oHrmPrmTestScoreDtlBean.setDetailId(oRow.get("ID").getString());
      oHrmPrmTestScoreDtlBean.setTxtPoints(oRow.get("POINTS").getString());
      oHrmPrmTestScoreDtlBean.setStartField(oRow.get("SCORE_FROM").getString());
      oHrmPrmTestScoreDtlBean.setEndField(oRow.get("SCORE_TO").getString());
      oHrmPosKPAPtsDetail.add(oHrmPrmTestScoreDtlBean);
    } 
    return oHrmPosKPAPtsDetail;
  }
  
  public void initializeBOImpl() {
    this.headerTable = "hrm_prom_scr_hdr";
  }
  
  public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
    saveHrmTSDtl(sHeaderPrimaryKey, oDetailBeanArray);
  }
  
  private void saveHrmTSDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
    boolean bInsert = false;
    boolean bDelete = false;
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator oIt = oDetailBeanArray.iterator();
    while (oIt.hasNext()) {
      HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean = oIt.next();
      if (oHrmPrmTestScoreDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMPROMTESTSCORE.proc_UpsertHrmPrmTSDtl(?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        oParameters = new ArrayList();
        oParameters.add(new DBObject(1, 1, 12, "N"));
        oParameters.add(new DBObject(2, 1, 12, null));
        oParameters.add(new DBObject(3, 1, 12, oHrmPrmTestScoreDtlBean.getTxtPoints()));
        oParameters.add(new DBObject(4, 1, 12, oHrmPrmTestScoreDtlBean.getStartField()));
        oParameters.add(new DBObject(5, 1, 12, oHrmPrmTestScoreDtlBean.getEndField()));
        oParameters.add(new DBObject(6, 1, 12, sHeaderPrimaryKey));
        oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
        oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getUserId()));
        oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(oParameters);
        continue;
      } 
      if (oHrmPrmTestScoreDtlBean.getStatus().equals("U")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMPROMTESTSCORE.proc_UpsertHrmPrmTSDtl(?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        oParameters = new ArrayList();
        oParameters.add(new DBObject(1, 1, 12, "U"));
        oParameters.add(new DBObject(2, 1, 12, oHrmPrmTestScoreDtlBean.getDetailId()));
        oParameters.add(new DBObject(3, 1, 12, oHrmPrmTestScoreDtlBean.getTxtPoints()));
        oParameters.add(new DBObject(4, 1, 12, oHrmPrmTestScoreDtlBean.getStartField()));
        oParameters.add(new DBObject(5, 1, 12, oHrmPrmTestScoreDtlBean.getEndField()));
        oParameters.add(new DBObject(6, 1, 12, sHeaderPrimaryKey));
        oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
        oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getUserId()));
        oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(oParameters);
        continue;
      } 
      if (oHrmPrmTestScoreDtlBean.getStatus().equals("D")) {
        if (!bDelete) {
          oBean1 = new DBUtilitiesBean();
          oBean1.createBatch("HRMPROMTESTSCORE.proc_DeleteHrmPrmTSDtl(?)");
          bDelete = true;
        } 
        oParameters = new ArrayList();
        oParameters.add(new DBObject(1, 1, 12, oHrmPrmTestScoreDtlBean.getDetailId()));
        oBean1.addToBatch(oParameters);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bDelete)
      oBean1.executeBatch(); 
  }
  
  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 oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oErrorList = new ArrayList();
    if (bHeaderDataChanged)
      if (!sScreenMode.equalsIgnoreCase("D")) {
        checkMandatoryHeader((HrmPrmTestScoreHdrBean)oBaseHeaderBean);
        checkforNumericfields((HrmPrmTestScoreHdrBean)oBaseHeaderBean);
      }  
    if (bDetailDataChanged)
      if (sScreenName.equalsIgnoreCase("HrmPrmTestScore")) {
        Iterator oIt1 = oDetailBeanArray.iterator();
        int rowCount = 1;
        while (oIt1.hasNext()) {
          HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean = oIt1.next();
          if (!oHrmPrmTestScoreDtlBean.getStatus().equalsIgnoreCase("D")) {
            checkMandatoryDtls(oHrmPrmTestScoreDtlBean, rowCount);
            checkScoreValue(oHrmPrmTestScoreDtlBean, rowCount);
            checkforNumericfields(oHrmPrmTestScoreDtlBean, rowCount);
            rowCount++;
          } 
        } 
      }  
  }
  
  public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
    String returnString = null;
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    DateUtility d = new DateUtility();
    HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean = (HrmPrmTestScoreHdrBean)oBaseHeaderBean;
    if (ScreenMode.equalsIgnoreCase("N")) {
      oParameters = new ArrayList();
      oParameters.add(new DBObject(1, 1, 12, "N"));
      oParameters.add(new DBObject(2, 1, 12, null));
      oParameters.add(new DBObject(3, 1, 12, oHrmPrmTestScoreHdrBean.getExamDesc()));
      oParameters.add(new DBObject(4, 1, 12, oHrmPrmTestScoreHdrBean.getExamType()));
      oParameters.add(new DBObject(5, 1, 12, oHrmPrmTestScoreHdrBean.getMaxPoints()));
      oParameters.add(new DBObject(6, 1, 12, oHrmPrmTestScoreHdrBean.getMaxScore()));
      oParameters.add(new DBObject(7, 1, 12, oHrmPrmTestScoreHdrBean.getGradeId()));
      oParameters.add(new DBObject(8, 1, 12, oHrmPrmTestScoreHdrBean.getDesignationId()));
      oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
      oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getUserId()));
      oParameters.add(new DBObject(11, 1, 12, this.oUserInfo.getSiteId()));
      oParameters.add(new DBObject(12, 2, 12));
      oParameters.add(new DBObject(13, 2, 12));
      oParameters.add(new DBObject(14, 2, 12));
      oParameters.add(new DBObject(15, 2, 4));
      ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_UpsertHrmPrmTSHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = oOutArray.get(0);
      returnString = (String)oOutObject.getObject();
    } else if (ScreenMode.equalsIgnoreCase("U")) {
      oParameters = new ArrayList();
      oParameters.add(new DBObject(1, 1, 12, "U"));
      oParameters.add(new DBObject(2, 1, 12, oHrmPrmTestScoreHdrBean.getHeaderPrimaryKey()));
      oParameters.add(new DBObject(3, 1, 12, oHrmPrmTestScoreHdrBean.getExamDesc()));
      oParameters.add(new DBObject(4, 1, 12, oHrmPrmTestScoreHdrBean.getExamType()));
      oParameters.add(new DBObject(5, 1, 12, oHrmPrmTestScoreHdrBean.getMaxPoints()));
      oParameters.add(new DBObject(6, 1, 12, oHrmPrmTestScoreHdrBean.getMaxScore()));
      oParameters.add(new DBObject(7, 1, 12, oHrmPrmTestScoreHdrBean.getGradeId()));
      oParameters.add(new DBObject(8, 1, 12, oHrmPrmTestScoreHdrBean.getDesignationId()));
      oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
      oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getUserId()));
      oParameters.add(new DBObject(11, 1, 12, this.oUserInfo.getSiteId()));
      oParameters.add(new DBObject(12, 2, 12));
      oParameters.add(new DBObject(13, 2, 12));
      oParameters.add(new DBObject(14, 2, 12));
      oParameters.add(new DBObject(15, 2, 4));
      ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_UpsertHrmPrmTSHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      DBObject oOutObject = oOutArray.get(0);
      returnString = (String)oOutObject.getObject();
    } else if (ScreenMode.equalsIgnoreCase("D")) {
      HrmCommonBO oHrmCommonBO = new HrmCommonBO();
      oHrmCommonBO.deleteChildDetailRec("hrm_prom_scr_dtl", "PROM_SCRHDR_ID", oHrmPrmTestScoreHdrBean.getHeaderPrimaryKey(), null);
      oParameters = new ArrayList();
      oParameters.add(new DBObject(1, 1, 12, oHrmPrmTestScoreHdrBean.getHeaderPrimaryKey()));
      oParameters.add(new DBObject(2, 2, 12));
      oParameters.add(new DBObject(3, 2, 12));
      oParameters.add(new DBObject(4, 2, 4));
      ArrayList oOutArray = oBean.callProc(oParameters, "HRMPROMTESTSCORE.proc_DeleteHrmPrmTSHdr(?,?,?,?)");
      DBObject oOutObject = oOutArray.get(0);
      returnString = null;
    } 
    return returnString;
  }
  
  public void deleteDetailRecords(String sPrimkey) throws EnrgiseApplicationException, EnrgiseSystemException {}
  
  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 oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oErrorList = new ArrayList();
    HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean = (HrmPrmTestScoreHdrBean)oBaseHeaderBean;
    String maxPoints = oHrmPrmTestScoreHdrBean.getMaxPoints();
    String maxScore = oHrmPrmTestScoreHdrBean.getMaxScore();
    if (bHeaderDataChanged)
      if (!sScreenMode.equalsIgnoreCase("D")) {
        checkUniqueHeader((HrmPrmTestScoreHdrBean)oBaseHeaderBean);
        checkDates((HrmPrmTestScoreHdrBean)oBaseHeaderBean);
      }  
    if (bDetailDataChanged) {
      if (sScreenName.equalsIgnoreCase("HrmPrmTestScore")) {
        Iterator oIt1 = oDetailBeanArray.iterator();
        exclusiveItemMatGrp(oDetailBeanArray, oErrorList);
        checkPointOrder(oDetailBeanArray, oErrorList);
        checkMaxPoints(oDetailBeanArray, oErrorList, maxPoints, maxScore);
        int rowcount = 1;
        while (oIt1.hasNext()) {
          HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean = oIt1.next();
          if (!oHrmPrmTestScoreDtlBean.getStatus().equalsIgnoreCase("D"))
            continue; 
          findChildRecord(oHrmPrmTestScoreDtlBean, rowcount);
          findLanguageChildRecord(oHrmPrmTestScoreDtlBean, rowcount);
          findSkillChildRecord(oHrmPrmTestScoreDtlBean, rowcount);
          findWorkChildRecord(oHrmPrmTestScoreDtlBean, rowcount);
          rowcount++;
        } 
      } 
      reportError(oErrorList);
    } 
  }
  
  public LovVO getClassDataLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    QueryRow oRow = null;
    LovVO oLovVO = new LovVO();
    ArrayList oList = null;
    Iterator oIt = null;
    String code = oLovQueryVO.getProperty("code");
    String sQuery = "Select clsd.ID,  clsd.NAME from HRM_CLASS_DTL clsd, HRM_CLASS_MST clsm where clsd.CLS_MST_ID = clsm.ID and clsm.CODE =";
    sQuery = String.valueOf(sQuery).concat(String.valueOf(code));
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField2()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" And upper(clsd.NAME) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') ")); 
    oBean = new DBUtilitiesBean();
    oList = new ArrayList();
    oList = oBean.executeQuery(sQuery);
    oIt = oList.iterator();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmAdvertiesmentMaintenance.description");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    while (oIt.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = oIt.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("NAME").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  public LovVO getRefNoLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    QueryRow oRow = null;
    LovVO oLovVO = new LovVO();
    ArrayList oList = null;
    Iterator oIt = null;
    String sQuery = "select distinct advh.id,advh.ref_no from hrm_advt_hdr advh where 1=1";
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(advh.ref_no) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') ")); 
    oBean = new DBUtilitiesBean();
    oList = new ArrayList();
    oList = oBean.executeQuery(sQuery);
    oIt = oList.iterator();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmAdvertiesmentMaintenance.referenceNo");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    while (oIt.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = oIt.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("ref_no").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  public LovVO getPositionCodeLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    QueryRow oRow = null;
    LovVO oLovVO = new LovVO();
    ArrayList oList = null;
    Iterator oIt = null;
    String sQuery = "SELECT A.ID, A.DESCRIPTION,  B.ID as desigid, B.name as PositionDesc  FROM HRM_POS_INF_HDR A, HRM_CLASS_DTL B  WHERE   A.DESIGNATION_ID=B.ID(+)";
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(DESCRIPTION) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') ")); 
    oBean = new DBUtilitiesBean();
    oList = new ArrayList();
    oList = oBean.executeQuery(sQuery);
    oIt = oList.iterator();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmAdvertiesmentMaintenance.forPosition");
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmAdvertiesmentMaintenance.description");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    while (oIt.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = oIt.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("DESCRIPTION").getString());
      oLOVBean.setDetailField3(oRow.get("desigid").getString());
      oLOVBean.setDetailField4(oRow.get("PositionDesc").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  private void checkScoreValue(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oErrList = new ArrayList();
    if (EnrgiseUtil.checkString(oHrmPrmTestScoreDtlBean.getStartField()) && EnrgiseUtil.checkString(oHrmPrmTestScoreDtlBean.getEndField()))
      if (Double.parseDouble(oHrmPrmTestScoreDtlBean.getStartField()) >= Double.parseDouble(oHrmPrmTestScoreDtlBean.getEndField())) {
        ArrayList oParam = new ArrayList();
        oParam.add(new Integer(rowCount));
        throw new EnrgiseApplicationException("hrm.HrmTestScore.errorinscore", oParam, "E");
      }  
    reportError(oErrList);
  }
  
  private void checkMandatoryHeader(HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oList = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreHdrBean.getGradeCode())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmPrmKPARating.gradeCode");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreHdrBean.getExamType())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.examType");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreHdrBean.getExamDesc())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.examDesc");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreHdrBean.getMaxPoints())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.maxPoints");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreHdrBean.getMaxScore())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.maxScore");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
    } 
    reportError(oList);
  }
  
  private void checkMandatoryDtls(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
    ArrayList oErrorList = new ArrayList();
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreDtlBean.getTxtPoints())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.txtPoints");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oParam.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreDtlBean.getStartField())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.StartField");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oParam.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
    } 
    if (!EnrgiseUtil.checkString(oHrmPrmTestScoreDtlBean.getEndField())) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.EndField");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oParam.add(new Integer(rowCount));
      oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
    } 
    reportError(oErrorList);
  }
  
  private void checkUniqueHeader(HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
    String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(" Select id as ID from hrm_prom_scr_hdr where GRADE_ID='").concat(String.valueOf(oHrmPrmTestScoreHdrBean.getGradeId()))).concat(String.valueOf("'  and  EXAM_TYPE='"))).concat(String.valueOf(oHrmPrmTestScoreHdrBean.getExamType()))).concat(String.valueOf("' and DESIGNATION_ID='"))).concat(String.valueOf(oHrmPrmTestScoreHdrBean.getDesignationId()))).concat(String.valueOf("' "));
    System.out.println(sQuery);
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    ArrayList oList = oBean.executeQuery(sQuery);
    Iterator oIt = oList.iterator();
    if (oIt.hasNext()) {
      QueryRow oRow = oIt.next();
      if (!oRow.get("ID").getString().equalsIgnoreCase(oHrmPrmTestScoreHdrBean.getHeaderPrimaryKey()))
        throw new EnrgiseApplicationException("hrm.HrmTestScore.uniqueConstraintViolated", "E"); 
    } 
  }
  
  private void checkDates(HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {}
  
  private void findChildRecord(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {}
  
  private void exclusiveItemMatGrp(ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
    String[] sArgs = (String[])Array.newInstance(Class.forName("java.lang.String"), 2);
    sArgs[0] = "StartField";
    sArgs[1] = "EndField";
    Iterator oIt1 = oDetailBeanArray.iterator();
    EnrgiseUtil.checkDuplicate(oDetailBeanArray, sArgs, "hrm.advt.detail.exclusive", oErrorList);
  }
  
  private void checkPointOrder(ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
    Iterator oIt = oDetailBeanArray.iterator();
    int i = 1;
    while (oIt.hasNext()) {
      int rowCount = 1;
      HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean = oIt.next();
      if (i != 1) {
        Iterator oIt1 = oDetailBeanArray.iterator();
        while (oIt1.hasNext()) {
          HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean1 = oIt1.next();
          if (Double.parseDouble(oHrmPrmTestScoreDtlBean.getStartField()) > Double.parseDouble(oHrmPrmTestScoreDtlBean1.getStartField()) && Double.parseDouble(oHrmPrmTestScoreDtlBean.getTxtPoints()) < Double.parseDouble(oHrmPrmTestScoreDtlBean1.getTxtPoints())) {
            MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.txtPoints");
            ArrayList oParam = new ArrayList();
            oParam.add(oMessageKey);
            oParam.add(new Integer(i));
            throw new EnrgiseApplicationException("hrm.HrmTestScore.errorinPoints", oParam, "E");
          } 
          rowCount++;
        } 
      } 
      i++;
    } 
  }
  
  private void checkMaxPoints(ArrayList oDetailBeanArray, ArrayList oErrorList, String maxPoints, String maxScore) throws EnrgiseApplicationException, EnrgiseSystemException {
    Iterator oIt = oDetailBeanArray.iterator();
    int rowCount = 1;
    while (oIt.hasNext()) {
      HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean = oIt.next();
      if (Double.parseDouble(oHrmPrmTestScoreDtlBean.getEndField()) > Double.parseDouble(maxScore)) {
        MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.StartField");
        ArrayList oParam = new ArrayList();
        oParam.add(oMessageKey);
        oParam.add(new Integer(rowCount));
        throw new EnrgiseApplicationException("hrm.HrmTestScore.errorinmaxscore", oParam, "E");
      } 
      if (Double.parseDouble(oHrmPrmTestScoreDtlBean.getTxtPoints()) > Double.parseDouble(maxPoints)) {
        MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.EndField");
        ArrayList oParam = new ArrayList();
        oParam.add(oMessageKey);
        oParam.add(new Integer(rowCount));
        throw new EnrgiseApplicationException("hrm.HrmTestScore.errorinmaxscore", oParam, "E");
      } 
      if (Double.parseDouble(oHrmPrmTestScoreDtlBean.getTxtPoints()) > Double.parseDouble(maxPoints)) {
        ArrayList oParam = new ArrayList();
        oParam.add(new Integer(rowCount));
        throw new EnrgiseApplicationException("hrm.HrmTestScore.errorinmaxpoints", oParam, "E");
      } 
      rowCount++;
    } 
  }
  
  private void findLanguageChildRecord(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {}
  
  private void findSkillChildRecord(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {}
  
  private void findWorkChildRecord(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {}
  
  public LovVO getPositionCodeLOVNew(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    QueryRow oRow = null;
    LovVO oLovVO = new LovVO();
    ArrayList oList = null;
    Iterator oIt = null;
    String sQuery = "Select distinct poshdr.ID,poshdr.CODE, poshdr.Description,poshdr.DESIGNATION_ID,desigdtl.NAME as Designation,poshdr.scale_id,scaledtl.NAME as SCALE ";
    sQuery = String.valueOf(sQuery).concat(String.valueOf(" from HRM_POS_INF_HDR  poshdr, HRM_CLASS_DTL    desigdtl, HRM_CLASS_DTL    scaledtl  WHERE poshdr.DESIGNATION_ID = desigdtl.ID(+) and poshdr.scale_id = scaledtl.id(+) "));
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(poshdr.CODE) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') ")); 
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField2()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(poshdr.Description) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') ")); 
    oBean = new DBUtilitiesBean();
    oList = new ArrayList();
    oList = oBean.executeQuery(sQuery);
    oIt = oList.iterator();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmTestScore.positionCode");
    oHeaderList.add("hrm.HrmTestScore.desc");
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmTestScore.designation");
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmTestScore.scale");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    while (oIt.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = oIt.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("id").getString());
      oLOVBean.setDetailField2(oRow.get("code").getString());
      oLOVBean.setDetailField3(oRow.get("description").getString());
      oLOVBean.setDetailField4(oRow.get("DESIGNATION_ID").getString());
      oLOVBean.setDetailField5(oRow.get("Designation").getString());
      oLOVBean.setDetailField6(oRow.get("scale_id").getString());
      oLOVBean.setDetailField7(oRow.get("scale").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  public LovVO getPositionCodeLOVQuery(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    QueryRow oRow = null;
    LovVO oLovVO = new LovVO();
    ArrayList oList = null;
    Iterator oIt = null;
    String sQuery = "Select distinct a.ID,a.CODE,a.Description,a.DESIGNATION_ID,b.NAME as Designation,a.scale_id, c.NAME as Scale ";
    sQuery = String.valueOf(sQuery).concat(String.valueOf(" From HRM_POS_INF_HDR  a, HRM_CLASS_DTL    b,HRM_CLASS_DTL    c,HRM_PROM_SCR_HDR d  WHERE a.DESIGNATION_ID = b.ID(+) and a.SCALE_ID = c.ID(+) and    d.POS_INF_HDR_ID = a.ID "));
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(a.CODE) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') ")); 
    if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField2()))
      sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(a.Description) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') ")); 
    oBean = new DBUtilitiesBean();
    oList = new ArrayList();
    oList = oBean.executeQuery(sQuery);
    oIt = oList.iterator();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmTestScore.positionCode");
    oHeaderList.add("hrm.HrmTestScore.desc");
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmTestScore.designation");
    oHeaderList.add("");
    oHeaderList.add("hrm.HrmTestScore.scale");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    while (oIt.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = oIt.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("id").getString());
      oLOVBean.setDetailField2(oRow.get("code").getString());
      oLOVBean.setDetailField3(oRow.get("description").getString());
      oLOVBean.setDetailField4(oRow.get("DESIGNATION_ID").getString());
      oLOVBean.setDetailField5(oRow.get("Designation").getString());
      oLOVBean.setDetailField6(oRow.get("scale_id").getString());
      oLOVBean.setDetailField7(oRow.get("scale").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  private void checkforNumericfields(HrmPrmTestScoreDtlBean oHrmPrmTestScoreDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oErrList = new ArrayList();
    if (!EnrgiseUtil.checkNumber(oHrmPrmTestScoreDtlBean.getStartField(), 3, 2, "P")) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.StartField");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oParam.add(new Integer(rowCount));
      oErrList.add(new EnrgiseMessageKeyException("hrm.HrmTestScore.detail.nonnumeric", oParam));
    } 
    if (!EnrgiseUtil.checkNumber(oHrmPrmTestScoreDtlBean.getTxtPoints(), 3, 2, "P")) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.txtPoints");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oParam.add(new Integer(rowCount));
      oErrList.add(new EnrgiseMessageKeyException("hrm.HrmTestScore.detail.nonnumeric", oParam));
    } 
    if (!EnrgiseUtil.checkNumber(oHrmPrmTestScoreDtlBean.getEndField(), 3, 2, "P")) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.EndField");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oParam.add(new Integer(rowCount));
      oErrList.add(new EnrgiseMessageKeyException("hrm.HrmTestScore.detail.nonnumeric", oParam));
    } 
    reportError(oErrList);
  }
  
  private void checkforNumericfields(HrmPrmTestScoreHdrBean oHrmPrmTestScoreHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oErrList = new ArrayList();
    if (!EnrgiseUtil.checkNumber(oHrmPrmTestScoreHdrBean.getMaxScore(), 3, 2, "P")) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.maxScore");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oErrList.add(new EnrgiseMessageKeyException("hrm.HrmTestScore.header.nonnumeric", oParam));
    } 
    if (!EnrgiseUtil.checkNumber(oHrmPrmTestScoreHdrBean.getMaxPoints(), 3, 2, "P")) {
      MessageKey oMessageKey = new MessageKey("hrm.HrmTestScore.txtPoints");
      ArrayList oParam = new ArrayList();
      oParam.add(oMessageKey);
      oErrList.add(new EnrgiseMessageKeyException("hrm.HrmTestScore.header.nonnumeric", oParam));
    } 
    reportError(oErrList);
  }
}
