package wenrgise.hrms.ejb.business;

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.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
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.HrmTrngEmpFeedBackDtlBean;
import wenrgise.hrms.bean.HrmTrngEmpFeedBackHdrBean;
import wenrgise.hrms.vo.HrmTrngEmpFbkQVO;

public class HrmTrngEmpFdbkBO extends HrmBaseBO {
  public HrmTrngEmpFdbkBO() {}
  
  public HrmTrngEmpFdbkBO(UserInfo oUserInfo) {
    super(oUserInfo);
  }
  
  public LovVO getHrmTrngCourseLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("ID");
    oHeaderList.add("hrm.HrmEmpFeedback.courseName");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList oParameters = new ArrayList();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
    oParameters.add(new DBObject(2, 2, -10));
    oParameters.add(new DBObject(3, 2, 12));
    oParameters.add(new DBObject(4, 2, 12));
    oParameters.add(new DBObject(5, 2, 4));
    ArrayList oOutArray = oBean.callProc(oParameters, "HRMTRNGLOV.proc_HrCalDtlLov(?,?,?,?,?)");
    DBObject oOutObject = oOutArray.get(0);
    ArrayList oList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = oList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("COURSE_ID").getString());
      oLOVBean.setDetailField2(oRow.get("CRS_NAME").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  public LovVO getHrmTrngRatingHelpLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("hrm.HrmEmpFeedback.minRating");
    oHeaderList.add("hrm.HrmEmpFeedback.maxRating");
    oHeaderList.add("hrm.HrmCoreCompetency.desc");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList oParameters = new ArrayList();
    String sRatingCode = new String();
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getProperty("ratingScheme") != null)
      sRatingCode = oLovQueryVO.getProperty("ratingScheme"); 
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
    oParameters.add(new DBObject(2, 1, 12, sRatingCode));
    oParameters.add(new DBObject(3, 2, -10));
    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, "HRMTRNGLOV.proc_HrRatingHelpLov(?,?,?,?,?,?)");
    DBObject oOutObject = oOutArray.get(0);
    ArrayList oList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = oList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("RATING_FROM").getString());
      oLOVBean.setDetailField2(oRow.get("RATING_TO").getString());
      oLOVBean.setDetailField3(oRow.get("DESCRIPTION").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  public LovVO getHrmTrngFacultyLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
    LovVO oLovVO = new LovVO();
    ArrayList oHeaderList = new ArrayList();
    oHeaderList.add("ID");
    oHeaderList.add("hrm.HrmEmpFeedback.facultyName");
    oLovVO.setHeaderList(oHeaderList);
    ArrayList arylstVisibility = new ArrayList();
    arylstVisibility.add("H");
    arylstVisibility.add("V");
    oLovVO.setVisibilityList(arylstVisibility);
    int count = 0;
    ArrayList oParameters = new ArrayList();
    String sInstId = new String();
    if (oLovQueryVO.getProperty("instId") != null)
      sInstId = oLovQueryVO.getProperty("instId"); 
    String sQuerySearch1 = new String();
    if (oLovQueryVO.getSearchField1() != null)
      sQuerySearch1 = oLovQueryVO.getSearchField1(); 
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    oParameters = new ArrayList();
    oParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
    oParameters.add(new DBObject(2, 1, 12, sInstId));
    oParameters.add(new DBObject(3, 2, -10));
    oParameters.add(new DBObject(4, 2, 4));
    ArrayList oOutArray = oBean.callProc(oParameters, "HRMTRNGLOV.proc_HrFacNameLov(?,?,?,?)");
    DBObject oOutObject = oOutArray.get(0);
    ArrayList oList = (ArrayList)oOutObject.getObject();
    QueryRow oRow = null;
    Iterator iter = oList.iterator();
    while (iter.hasNext()) {
      if (count == 0)
        oList = new ArrayList(); 
      count++;
      oRow = iter.next();
      LOVBean oLOVBean = new LOVBean();
      oLOVBean.setDetailField1(oRow.get("ID").getString());
      oLOVBean.setDetailField2(oRow.get("FACULTY_NAME").getString());
      oList.add(oLOVBean);
    } 
    oLovVO.setDetailList(oList);
    return oLovVO;
  }
  
  public RecordMetaInfo getHrmTrngEmpFbkHdrMetaInfo(HrmTrngEmpFbkQVO oHrmTrngEmpFbkQVO) 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, oHrmTrngEmpFbkQVO.getHeaderPrimaryKey()));
    oParameters.add(new DBObject(2, 1, 12, oHrmTrngEmpFbkQVO.getCourseId()));
    oParameters.add(new DBObject(3, 2, -5));
    oParameters.add(new DBObject(4, 2, 93));
    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, "HRMEMPFEEDBK.proc_GetHrEmpFbkHdrCount(?,?,?,?,?,?,?)");
    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 getHrmTrngEmpFbkHeader(HrmTrngEmpFbkQVO oHrmTrngEmpFbkQVO, 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 (oHrmTrngEmpFbkQVO == null)
      oHrmTrngEmpFbkQVO = new HrmTrngEmpFbkQVO(); 
    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, oHrmTrngEmpFbkQVO.getHeaderPrimaryKey()));
    oParameters.add(new DBObject(4, 1, 12, oHrmTrngEmpFbkQVO.getCourseId()));
    oParameters.add(new DBObject(5, 2, -10));
    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, "HRMEMPFEEDBK.proc_GetHrEmpFbkHdr(?,?,?,?,?,?,?,?)");
    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();
      HrmTrngEmpFeedBackHdrBean oHrmTrngEmpFeedBackHdrBean = new HrmTrngEmpFeedBackHdrBean();
      oHrmTrngEmpFeedBackHdrBean.setHeaderPrimaryKey(oRow.get("CAL_ID").getString());
      oHrmTrngEmpFeedBackHdrBean.setInstId(oRow.get("INST_ID").getString());
      oHrmTrngEmpFeedBackHdrBean.setEndDate(EnrgiseUtil.convertToString(oRow.get("END_DATE").getDate()));
      oHrmTrngEmpFeedBackHdrBean.setStartDate(EnrgiseUtil.convertToString(oRow.get("START_DATE").getDate()));
      oHrmTrngEmpFeedBackHdrBean.setMaxRating(oRow.get("MAX_RATING").getString());
      oHrmTrngEmpFeedBackHdrBean.setMinRating(oRow.get("MIN_RATING").getString());
      oHrmTrngEmpFeedBackHdrBean.setRatingScheme(oRow.get("RATINGCODE").getString());
      oHrmTrngEmpFeedBackHdrBean.setInstitutionName(oRow.get("INST_NAME").getString());
      oHrmTrngEmpFeedBackHdrBean.setCourseId(oRow.get("CAL_ID").getString());
      oHrmTrngEmpFeedBackHdrBean.setCourseName(oRow.get("CRS_NAME").getString());
      oHrmTrngEmpFeedBackHdrBean.setStatusFlag(oRow.get("STATUS_FLAG").getString());
      oHeaderList.add(oHrmTrngEmpFeedBackHdrBean);
    } 
    return oHeaderList;
  }
  
  public RecordMetaInfo getTrngEmpFdBkDetailMetaInfo(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, "HRMEMPFEEDBK.proc_HrEmpFdBkDtlCount(?,?,?,?,?,?)");
    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 getTrngEmpFdBkDetail(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = new DBUtilitiesBean();
    int count = 0;
    QueryRow oRow = null;
    QueryValue oValue = null;
    ArrayList oList = null;
    Iterator oIt = null;
    ArrayList oTrngEmpFdBkDetail = 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, "HRMEMPFEEDBK.proc_HrEmpFdBkDtlInfo(?,?,?,?,?,?,?)");
    oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
    if (oList.size() == 0)
      throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); 
    count = 0;
    oIt = oList.iterator();
    while (oIt.hasNext()) {
      if (count == 0)
        oTrngEmpFdBkDetail = new ArrayList(); 
      count++;
      oRow = oIt.next();
      HrmTrngEmpFeedBackDtlBean oHrmTrngEmpFeedBackDtlBean = new HrmTrngEmpFeedBackDtlBean();
      oHrmTrngEmpFeedBackDtlBean.setDetailId(oRow.get("ID").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtSkillArea(oRow.get("SKILL_AREA").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtFacId(oRow.get("FSRL_NO").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtFacultyName(oRow.get("FNAME").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtEmpNo(oRow.get("EMP_NO").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtEmpName(oRow.get("NAME").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtDeliveryClarity(oRow.get("FAC_DELV_CLAR").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtPresentation(oRow.get("FAC_PRESENTATION").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtInteraction(oRow.get("FAC_INTERACTION").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtCourseMaterial(oRow.get("COURSE_MATERIAL").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtCourseObjective(oRow.get("COURSE_OBJECTIVE").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtCourseDuration(oRow.get("COURSE_DURATION").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtTrainingAids(oRow.get("TRNG_AIDS").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtTrainingArrangements(oRow.get("TRNG_ARRANGEMENTS").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtOverallRating(oRow.get("OVERALL_RATING").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtTopicsRelevant(oRow.get("RELEV_TOPICS").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtTopicsIrrelevant(oRow.get("IRRELEV_TOPICS").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtSuggestions(oRow.get("SUGGESTION").getString());
      oHrmTrngEmpFeedBackDtlBean.setTxtTrnHdrId(oRow.get("EMP_TRNG_HDR_ID").getString());
      oTrngEmpFdBkDetail.add(oHrmTrngEmpFeedBackDtlBean);
    } 
    return oTrngEmpFdBkDetail;
  }
  
  public void additionalFieldValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
  
  public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
  
  public void additionalBusinessValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
  
  public void initializeBOImpl() {
    this.headerTable = "HRM_EMP_TRNG_FDBK_DTL";
  }
  
  public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
    if (sScreenName.equalsIgnoreCase("HrmTrngEmpFeedBack"))
      saveHrmEmpFeedBack(sHeaderPrimaryKey, oDetailBeanArray); 
  }
  
  private void saveHrmEmpFeedBack(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
    boolean bUpdate = false;
    boolean bInsert = false;
    ArrayList oParameters = new ArrayList();
    DBUtilitiesBean oBean = null;
    DBUtilitiesBean oBean1 = null;
    Iterator oIt = oDetailBeanArray.iterator();
    while (oIt.hasNext()) {
      HrmTrngEmpFeedBackDtlBean oHrmTrngEmpFeedBackDtlBean = oIt.next();
      if (oHrmTrngEmpFeedBackDtlBean.getStatus().equals("N")) {
        if (!bInsert) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMEMPFEEDBK.proc_UpsertHrEmpFeedBackDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bInsert = true;
        } 
        oParameters.add(new DBObject(1, 1, 12, "I"));
        oParameters.add(new DBObject(2, 1, 12, oHrmTrngEmpFeedBackDtlBean.getDetailId()));
        oParameters.add(new DBObject(3, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTrnHdrId()));
        oParameters.add(new DBObject(4, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtFacId()));
        oParameters.add(new DBObject(5, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtDeliveryClarity()));
        oParameters.add(new DBObject(6, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtPresentation()));
        oParameters.add(new DBObject(7, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtInteraction()));
        oParameters.add(new DBObject(8, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtCourseMaterial()));
        oParameters.add(new DBObject(9, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtCourseObjective()));
        oParameters.add(new DBObject(10, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtCourseDuration()));
        oParameters.add(new DBObject(11, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTrainingAids()));
        oParameters.add(new DBObject(12, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTrainingArrangements()));
        oParameters.add(new DBObject(13, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtOverallRating()));
        oParameters.add(new DBObject(14, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTopicsRelevant()));
        oParameters.add(new DBObject(15, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTopicsIrrelevant()));
        oParameters.add(new DBObject(16, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtSuggestions()));
        oParameters.add(new DBObject(17, 1, 12, this.oUserInfo.getUserTypeId()));
        oParameters.add(new DBObject(18, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(oParameters);
        continue;
      } 
      if (oHrmTrngEmpFeedBackDtlBean.getStatus().equals("U")) {
        if (!bUpdate) {
          oBean = new DBUtilitiesBean();
          oBean.createBatch("HRMEMPFEEDBK.proc_UpsertHrEmpFeedBackDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
          bUpdate = true;
        } 
        oParameters = new ArrayList();
        oParameters.add(new DBObject(1, 1, 12, "U"));
        oParameters.add(new DBObject(2, 1, 12, oHrmTrngEmpFeedBackDtlBean.getDetailId()));
        oParameters.add(new DBObject(3, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTrnHdrId()));
        oParameters.add(new DBObject(4, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtFacId()));
        oParameters.add(new DBObject(5, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtDeliveryClarity()));
        oParameters.add(new DBObject(6, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtPresentation()));
        oParameters.add(new DBObject(7, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtInteraction()));
        oParameters.add(new DBObject(8, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtCourseMaterial()));
        oParameters.add(new DBObject(9, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtCourseObjective()));
        oParameters.add(new DBObject(10, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtCourseDuration()));
        oParameters.add(new DBObject(11, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTrainingAids()));
        oParameters.add(new DBObject(12, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTrainingArrangements()));
        oParameters.add(new DBObject(13, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtOverallRating()));
        oParameters.add(new DBObject(14, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTopicsRelevant()));
        oParameters.add(new DBObject(15, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtTopicsIrrelevant()));
        oParameters.add(new DBObject(16, 1, 12, oHrmTrngEmpFeedBackDtlBean.getTxtSuggestions()));
        oParameters.add(new DBObject(17, 1, 12, this.oUserInfo.getUserTypeId()));
        oParameters.add(new DBObject(18, 1, 12, this.oUserInfo.getSiteId()));
        oBean.addToBatch(oParameters);
      } 
    } 
    if (bInsert)
      oBean.executeBatch(); 
    if (bUpdate)
      oBean.executeBatch(); 
  }
  
  public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
    System.out.println("Update ille!");
  }
  
  public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String param1) throws EnrgiseSystemException {
    return "saveHeaderImpl toBeDone";
  }
  
  public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
    return "saveNewHeaderImpl ille!";
  }
}
