package wenrgise.hrms.businessdelegate;

import java.rmi.RemoteException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.CreateException;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.ejb.common.utility.ServiceLocator;
import wenrgise.hrms.bean.HrmAprslGoalsDtlBean;
import wenrgise.hrms.bean.HrmAprslHdrBean;
import wenrgise.hrms.bean.HrmAprslKPADtlBean;
import wenrgise.hrms.bean.HrmAprslTrngReqDtlBean;
import wenrgise.hrms.ejb.facade.HrmThirdFacade;
import wenrgise.hrms.ejb.facade.HrmThirdFacadeHome;
import wenrgise.hrms.vo.HrmAprslQVO;
import wenrgise.workflow.bean.WflWorkListInfoBean;

public class HrmAprslBD extends HrmBaseBD {
  public boolean updateHeaderRecordImpl(BaseHeaderBean oBaseHeaderBean) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
    return true;
  }
  
  public String saveImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
      HrmThirdFacade oHrmThirdFacade = oHome.create();
      return oHrmThirdFacade.saveHrmEmpAprsl((HrmAprslHdrBean)oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked, this.oUserInfo);
    } catch (CreateException oCrtExcep) {
      throw new EnrgiseSystemException(oCrtExcep);
    } 
  }
  
  public String getInsertDataImpl(BaseQueryVO oQueryVO) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
    return null;
  }
  
  public RecordMetaInfo getTotalDetailRecordCountImpl(String lPrimaryKey, String sScreenName) throws EnrgiseApplicationException, EnrgiseSystemException {
    RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
    try {
      HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
      HrmThirdFacade oHrmThirdFacade = oHome.create();
      if (sScreenName.equalsIgnoreCase("HrmAprslKPA")) {
        oRecordMetaInfo = oHrmThirdFacade.getHrmEmpAprslKPADetailMetaInfo(lPrimaryKey);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslGoals")) {
        oRecordMetaInfo = oHrmThirdFacade.getHrmEmpAprslGoalsDetailMetaInfo(lPrimaryKey);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslTrngReq")) {
        oRecordMetaInfo = oHrmThirdFacade.getHrmAprslTrngReqDtlMetaInfo(lPrimaryKey);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslEmpDtls")) {
        oRecordMetaInfo.setRecordCount(1L);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslEmployee")) {
        oRecordMetaInfo = oHrmThirdFacade.getHrmAprslEmpDtlMetaInfo(lPrimaryKey);
      } 
    } catch (RemoteException oRe) {
      throw new EnrgiseSystemException(oRe);
    } catch (CreateException oCrt) {
      throw new EnrgiseSystemException(oCrt);
    } 
    return oRecordMetaInfo;
  }
  
  public ArrayList getDetailRecordImpl(String lPrimaryKey, String sScreenName, long lAbsoluteStart, long lAbsoluteEnd) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList arylstRet = new ArrayList();
    try {
      HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
      HrmThirdFacade oHrmThirdFacade = oHome.create();
      if (sScreenName.equalsIgnoreCase("HrmAprslKPA")) {
        arylstRet = oHrmThirdFacade.getHrmEmpAprslKPADetail(lPrimaryKey, lAbsoluteStart, lAbsoluteEnd);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslGoals")) {
        arylstRet = oHrmThirdFacade.getHrmEmpAprslGoalsDetail(lPrimaryKey, lAbsoluteStart, lAbsoluteEnd);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslTrngReq")) {
        arylstRet = oHrmThirdFacade.getHrAprslTrngReqDetail(lPrimaryKey, lAbsoluteStart, lAbsoluteEnd);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslEmpDtls")) {
        arylstRet = oHrmThirdFacade.getHrAprslEmpPerDetail(lPrimaryKey, lAbsoluteStart, lAbsoluteEnd);
      } else if (sScreenName.equalsIgnoreCase("HrmAprslEmployee")) {
        arylstRet = oHrmThirdFacade.getHrAprslEmpPerDetail(lPrimaryKey, lAbsoluteStart, lAbsoluteEnd);
      } 
    } catch (RemoteException oRe) {
      throw new EnrgiseSystemException(oRe);
    } catch (CreateException oCrt) {
      throw new EnrgiseSystemException(oCrt);
    } 
    return arylstRet;
  }
  
  public RecordMetaInfo getHeaderMetaImpl(BaseQueryVO oQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
      HrmThirdFacade oHrmThirdFacade = oHome.create();
      return oHrmThirdFacade.getHrmEmpAprslHdrMetaInfo((HrmAprslQVO)oQueryVO);
    } catch (RemoteException oRe) {
      throw new EnrgiseSystemException(oRe);
    } catch (CreateException oCrt) {
      throw new EnrgiseSystemException(oCrt);
    } 
  }
  
  public ArrayList getHeaderRecordImpl(BaseQueryVO oQueryVO, long lStartPosition, long lLastPosition) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
    try {
      HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
      HrmThirdFacade oHrmThirdFacade = oHome.create();
      ArrayList oHeaderList = oHrmThirdFacade.getHrmEmpAprslHdrInfo((HrmAprslQVO)oQueryVO, lStartPosition, lLastPosition);
      return oHeaderList;
    } catch (RemoteException oRe) {
      throw new EnrgiseSystemException(oRe);
    } catch (CreateException oCrt) {
      throw new EnrgiseSystemException(oCrt);
    } 
  }
  
  public Map getDisabledFieldsImpl(ThisPageVO oThisPageVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    HashMap oHashMap = new HashMap();
    ArrayList arylstEnableList = new ArrayList();
    ArrayList arylstDisableList = new ArrayList();
    arylstDisableList.add("butDelRow");
    HrmAprslHdrBean oHrmAprslHdrBean = (HrmAprslHdrBean)oThisPageVO.getOHeaderBean();
    if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAprslLevel())) {
      if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("0") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("1"))
        arylstDisableList.add("finalRating"); 
      if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("2") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("3") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("4") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("5"))
        if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
          if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R"))
            arylstDisableList.add("finalRating");   
    } else {
      arylstDisableList.add("finalRating");
    } 
    if (oThisPageVO.getScreenMode().equalsIgnoreCase("U")) {
      arylstEnableList.add("butGetDetail");
      arylstDisableList.add("butStOrder");
    } 
    ArrayList oDetailList = oThisPageVO.getODetailList();
    if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAprslLevel())) {
      if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("0") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("1")) {
        if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getCalFlag()))
          if (oHrmAprslHdrBean.getCalFlag().equalsIgnoreCase("C")) {
            arylstDisableList.add("butDone");
            arylstDisableList.add("butReject");
          } else if (oHrmAprslHdrBean.getCalFlag().equalsIgnoreCase("D")) {
            arylstDisableList.add("butCalculate");
            arylstDisableList.add("butReject");
            if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getDoneFlag()))
              if (oHrmAprslHdrBean.getDoneFlag().equalsIgnoreCase("true"))
                arylstDisableList.add("butDone");  
          }  
      } else if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("2") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("3") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("4") || oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("5")) {
        if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getCalFlag()))
          if (oHrmAprslHdrBean.getCalFlag().equalsIgnoreCase("C")) {
            arylstDisableList.add("butDone");
          } else if (oHrmAprslHdrBean.getCalFlag().equalsIgnoreCase("D")) {
            arylstDisableList.add("butCalculate");
            if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getDoneFlag()))
              if (oHrmAprslHdrBean.getDoneFlag().equalsIgnoreCase("true")) {
                arylstDisableList.add("butDone");
                arylstDisableList.add("butReject");
              }  
          }  
      } 
    } else {
      arylstDisableList.add("butDone");
      arylstDisableList.add("butReject");
      arylstDisableList.add("butCalculate");
    } 
    if (oDetailList != null)
      if (oThisPageVO.getScreenName().equalsIgnoreCase("HrmAprslKPA")) {
        Iterator oIt = oDetailList.iterator();
        while (oIt.hasNext()) {
          HrmAprslKPADtlBean oHrmAprslKPADtlBean = oIt.next();
          if (!oHrmAprslKPADtlBean.getStatus().equalsIgnoreCase("N")) {
            if (oHrmAprslKPADtlBean.getTxtKpaRatingReq().equalsIgnoreCase("N")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
            } 
            if (oHrmAprslKPADtlBean.getTxtKpaAprslType().equalsIgnoreCase("0")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
            } 
            if (oHrmAprslKPADtlBean.getTxtKpaAprslType().equalsIgnoreCase("1")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
            } 
            if (oHrmAprslKPADtlBean.getTxtKpaAprslType().equalsIgnoreCase("2"));
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("0")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating0())) {
                oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
                oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
                  oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
                  oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("1")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating1())) {
                oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
                oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
                  oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
                  oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("2")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating2())) {
                oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
                oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
                  oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
                  oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("3")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating3())) {
                oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
                oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
                  oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
                  oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("4")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating4())) {
                oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
                oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
                  oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
                  oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("5")) {
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelAprl4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating0("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating1("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating2("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating3("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating4("true");
              oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK0LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK1LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK2LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK3LOV("true");
              oHrmAprslKPADtlBean.setDisabbutRatingK4LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating5())) {
                oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
                oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslKPADtlBean.setDisabtxtLevelRating5("true");
                  oHrmAprslKPADtlBean.setDisabtxtLevelAprl5("true");
                  oHrmAprslKPADtlBean.setDisabbutRatingK5LOV("true");
                }  
            } 
          } 
        } 
      }  
    if (oDetailList != null)
      if (oThisPageVO.getScreenName().equalsIgnoreCase("HrmAprslGoals")) {
        Iterator oIt = oDetailList.iterator();
        while (oIt.hasNext()) {
          HrmAprslGoalsDtlBean oHrmAprslGoalsDtlBean = oIt.next();
          if (!oHrmAprslGoalsDtlBean.getStatus().equalsIgnoreCase("N")) {
            if (oHrmAprslGoalsDtlBean.getTxtSecRatingReq().equalsIgnoreCase("N")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
            } 
            if (oHrmAprslGoalsDtlBean.getTxtSecAprslType().equalsIgnoreCase("0")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
            } 
            if (oHrmAprslGoalsDtlBean.getTxtSecAprslType().equalsIgnoreCase("1")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
            } 
            if (oHrmAprslGoalsDtlBean.getTxtSecAprslType().equalsIgnoreCase("2"));
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("0")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating0())) {
                oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
                oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
                  oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("1")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating1())) {
                oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
                oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
                  oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("2")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating2())) {
                oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
                oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
                  oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("3")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating3())) {
                oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
                oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
                  oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("4")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating4())) {
                oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
                oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
                  oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
                }  
            } 
            if (oHrmAprslHdrBean.getAprslLevel().equalsIgnoreCase("5")) {
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating0g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating1g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating2g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating3g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating4g("true");
              oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG0LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG1LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG2LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG3LOV("true");
              oHrmAprslGoalsDtlBean.setDisabbutRatingG4LOV("true");
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getRating5())) {
                oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
                oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
              } 
              if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getAppFlag()))
                if (oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("R") || oHrmAprslHdrBean.getAppFlag().equalsIgnoreCase("A")) {
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelRating5g("true");
                  oHrmAprslGoalsDtlBean.setDisabtxtLevelAprl5g("true");
                  oHrmAprslGoalsDtlBean.setDisabbutRatingG5LOV("true");
                }  
            } 
          } 
        } 
      }  
    if (oDetailList != null)
      if (oThisPageVO.getScreenName().equalsIgnoreCase("HrmAprslTrngReq")) {
        Iterator oIt = oDetailList.iterator();
        while (oIt.hasNext()) {
          HrmAprslTrngReqDtlBean oHrmAprslTrngReqDtlBean = oIt.next();
          if (oHrmAprslTrngReqDtlBean.getStatus().equalsIgnoreCase("Q")) {
            oHrmAprslTrngReqDtlBean.setDisabbutCourseLOV("true");
            oHrmAprslTrngReqDtlBean.setDisabbutRecLOV("true");
            oHrmAprslTrngReqDtlBean.setDisabbutTrngCalLOV("true");
            oHrmAprslTrngReqDtlBean.setDisabtxtPurpose("true");
            oHrmAprslTrngReqDtlBean.setDisabtxtRemarks("true");
          } 
        } 
      }  
    oHashMap.put("D", arylstDisableList);
    oHashMap.put("E", arylstEnableList);
    return oHashMap;
  }
  
  public String submitImpl(String sButtonName, BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
    try {
      String sHeaderPrimaryKey = null;
      HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
      HrmThirdFacade oHrmThirdFacade = oHome.create();
      if (sButtonName.equalsIgnoreCase("butCalculate"))
        sHeaderPrimaryKey = oHrmThirdFacade.calEmpFinRating((HrmAprslHdrBean)oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked); 
      if (sButtonName.equalsIgnoreCase("butDone"))
        sHeaderPrimaryKey = oHrmThirdFacade.approveEmpAprsl((HrmAprslHdrBean)oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked, this.oUserInfo); 
      if (sButtonName.equalsIgnoreCase("butReject"))
        sHeaderPrimaryKey = oHrmThirdFacade.rejectEmpAprsl((HrmAprslHdrBean)oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked, this.oUserInfo); 
      return sHeaderPrimaryKey;
    } catch (RemoteException oRe) {
      throw new EnrgiseSystemException(oRe);
    } catch (CreateException oCrt) {
      throw new EnrgiseSystemException(oCrt);
    } 
  }
  
  public void onLoadAction(ThisPageVO oThisPageVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    if (oThisPageVO.getActionName() == 10) {
      HrmAprslHdrBean oHrmAprslHdrBean = (HrmAprslHdrBean)oThisPageVO.getOHeaderBean();
      if (!EnrgiseUtil.checkString(oHrmAprslHdrBean.getWorkListId()));
    } 
    if (oThisPageVO.getActionName() == 13) {
      HrmAprslHdrBean oHrmAprslHdrBean = (HrmAprslHdrBean)oThisPageVO.getOHeaderBean();
      if (EnrgiseUtil.checkString(oHrmAprslHdrBean.getWorkListId())) {
        WflWorkListInfoBean oWflWorkListInfoBean = new WflWorkListInfoBean();
        try {
          HrmThirdFacadeHome oHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
          HrmThirdFacade oHrmThirdFacade = oHome.create();
          oWflWorkListInfoBean = oHrmThirdFacade.getWorkListInfo(oHrmAprslHdrBean.getWorkListId());
        } catch (CreateException oCrtExcep) {
          throw new EnrgiseSystemException(oCrtExcep);
        } catch (RemoteException oRt) {
          throw new EnrgiseSystemException(oRt);
        } 
        oHrmAprslHdrBean.setEmpId(oWflWorkListInfoBean.getCreatorempId());
      } 
    } 
  }
}
