Package com.centraview.hr.hrfacade

Examples of com.centraview.hr.hrfacade.HrFacade


      int expenseFormID = Integer.parseInt((String)request.getParameter("rowId"));
      HrExpenseForm hrexpenseForm= new HrExpenseForm();
     
      HrFacadeHome hm = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome","HrFacade");
      HrFacade remote =(HrFacade)hm.create();
      remote.setDataSource(dataSource);
     
      ExpenseFormVO expenseFormVO = remote.getExpenseFormVO(expenseFormID);
      hrexpenseForm.setExpenseFormID(0);


      hrexpenseForm.setFormDescription(expenseFormVO.getDescription());
View Full Code Here


      ExpenseFormVOX vox = new ExpenseFormVOX(userobjectd, hrexpenseForm);

      ExpenseFormVO expenseFormVO = vox.getVO();

      HrFacadeHome hm = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
      HrFacade remote = (HrFacade)hm.create();
      remote.setDataSource(dataSource);
      if (expenseFormID > 0 && request.getParameter("DUPLICATE") != null)
      {
        hrexpenseForm.convertItemLines();
        expenseFormVO = remote.createExpense(expenseFormVO, individualID);
        hrexpenseForm.setExpenseFormID((new Integer(expenseFormVO.getExpenseFormID())).intValue());
        //set("expenseFormID",(new Integer(expenseFormVO.getExpenseFormID())).toString());
        java.sql.Timestamp date = expenseFormVO.getCreatedDate();
        if (date != null)
        {
          hrexpenseForm.setCreatedDate(date.toString());
        }
        hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());
        request.setAttribute("HrExpenseLines", expenseFormVO.getHrExpenseLines());
      }
      else if (expenseFormID > 0)
      {
        expenseFormVO.setExpenseFormID(expenseFormID);
        remote.updateExpense(expenseFormVO, individualID);

        expenseFormVO = remote.getExpenseFormVO(expenseFormID);

        //Set all elements in form.
        hrexpenseForm.setExpenseFormID(expenseFormID);

        java.sql.Timestamp date = expenseFormVO.getCreatedDate();

        //set values on hrexpenseForm
        hrexpenseForm.setCreatedDate(date.toString());
        //set("CreatedDate",dForm.format(date));
        //expenseForm.setCreatedDate(date);
        hrexpenseForm.setExpenseFormID(expenseFormID);

        hrexpenseForm.setFormDescription(expenseFormVO.getDescription());

        hrexpenseForm.setEmployee(expenseFormVO.getEmployee());
        hrexpenseForm.setEmployeeID(expenseFormVO.getEmployeeId());
        hrexpenseForm.setReportto(expenseFormVO.getReportingTo());
        hrexpenseForm.setReporttoID(expenseFormVO.getReportingId());
        hrexpenseForm.setStatus(expenseFormVO.getStatus());

        hrexpenseForm.setNotes(expenseFormVO.getNotes());

        if (expenseFormVO.getFrom() != null)
        {
          java.sql.Date fromDate = expenseFormVO.getFrom();
          String sfromDate = fromDate.toString();
          Vector fromDateSplitUp = getDate(sfromDate);

          hrexpenseForm.setFromyear((String)fromDateSplitUp.get(0));
          hrexpenseForm.setFrommonth((String)fromDateSplitUp.get(1));
          hrexpenseForm.setFromday((String)fromDateSplitUp.get(2));
        }

        if (expenseFormVO.getTo() != null)
        {
          java.sql.Date toDate = expenseFormVO.getTo();
          String stoDate = toDate.toString();
          //String[] sTokenizedDate = getDate(stoDate);
          Vector toDateSplitUp = getDate(stoDate);
          hrexpenseForm.setToyear((String)toDateSplitUp.get(0));
          hrexpenseForm.setTomonth((String)toDateSplitUp.get(1));
          hrexpenseForm.setToday((String)toDateSplitUp.get(2));
        }

        hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());

        //  @@@@@COMMENNTED ON 30/10/03
        //hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());

        request.setAttribute("HrExpenseLines", expenseFormVO.getHrExpenseLines());

      }

      else if (expenseFormID == 0)
      {
        expenseFormVO = remote.createExpense(expenseFormVO, individualID);

        hrexpenseForm.setExpenseFormID((new Integer(expenseFormVO.getExpenseFormID())).intValue());
        //set("expenseFormID",(new Integer(expenseFormVO.getExpenseFormID())).toString());

        java.sql.Timestamp date = expenseFormVO.getCreatedDate();
View Full Code Here

      }
     
      else if ((request.getParameter("expenseFormID") != null))
      {
        HrFacadeHome hm = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
        HrFacade remote = (HrFacade)hm.create();
        remote.setDataSource(dataSource);

        ExpenseFormVO expenseFormVO = remote.getExpenseFormVO(expenseFormID);
        this.hrexpenseForm.setExpenseFormID(expenseFormID);

        this.hrexpenseForm.setFormDescription(expenseFormVO.getDescription());

        this.hrexpenseForm.setEmployee(expenseFormVO.getEmployee());
View Full Code Here

    userobjectd = (com.centraview.common.UserObject)session.getAttribute("userobject");
    HrFacadeHome aa = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
    try
    {
      HrFacade remote = (HrFacade)aa.create();
      remote.setDataSource(dataSource);
      int indvID = userobjectd.getIndividualID();
      String sTimeSheetId = (String)request.getParameter("timesheetId");
      Integer iTimeSheetId = new Integer(sTimeSheetId);
      int timeSheetID = 0;
      if (iTimeSheetId != null)
        timeSheetID = iTimeSheetId.intValue();

      remote.deleteTimeSheet(indvID,timeSheetID);
      returnStatus = "success";
    }
    catch (Exception e)
    {
      returnStatus = "failure";
View Full Code Here

    int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
    ArrayList deleteLog = new ArrayList();
    String rowId[] = request.getParameterValues("rowId");
    try {
      HrFacade ejb = (HrFacade)CVUtility.setupEJB("HrFacade", "com.centraview.hr.hrfacade.HrFacadeHome", dataSource);
      for (int i=0; i<rowId.length; i++) {
        if(rowId[i] != null && !rowId[i].equals("")) {
          int elementId = Integer.parseInt(rowId[i]);
          ejb.deleteExpense(elementId);
        }
      }
    } catch(Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new CommunicationException(e.getMessage());
View Full Code Here

    //call to EJB server
    int elementID = Integer.parseInt(key);
    HrFacadeHome hrFacadeHome = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome","HrFacade");
    try
    {
      HrFacade remote =(HrFacade)hrFacadeHome.create();
      remote.setDataSource(this.dataSource);
      remote.deleteExpense(elementID);
      // TODO user-rights for deleteExpense
      this.setDirtyFlag(true);
      ListGenerator lg = ListGenerator.getListGenerator(dataSource);
      lg.makeListDirty("Expenses");
    }
View Full Code Here

    ArrayList resultDeleteLog = new ArrayList();
    HrFacadeHome hrFacadeHome = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome","HrFacade");
    try
    {
      //call to EJB server
      HrFacade remote =(HrFacade)hrFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
          try{
            remote.deleteExpense(elementID);
            // TODO user-rights for deleteExpense
          }//end of try block
          catch(AuthorizationFailedException ae){
            String errorMessage = ae.getExceptionDescription();
            resultDeleteLog.add(errorMessage);
View Full Code Here

  {
    int elementID = Integer.parseInt(key);
    HrFacadeHome hrFacadeHome = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome","HrFacade");
    try
    {
      HrFacade remote =(HrFacade)hrFacadeHome.create();
      remote.setDataSource(this.dataSource);

       remote.deleteEmployee(elementID);
      //TODO individualID should be passed to deleteView.  User rights is fubar here.

      this.setDirtyFlag(true);
      ListGenerator lg = ListGenerator.getListGenerator(dataSource);
      lg.makeListDirty("Employee");
View Full Code Here

    ArrayList resultDeleteLog = new ArrayList();
    HrFacadeHome hrFacadeHome = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome","HrFacade");
    try
    {
      //call to EJB server
      HrFacade remote =(HrFacade)hrFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
          try{
            remote.deleteEmployee(elementID);
            // TODO individualID should be passed to deleteView.  User rights is fubar here.
          }//end of try block
          catch(AuthorizationFailedException ae){
            String errorMessage = ae.getExceptionDescription();
            resultDeleteLog.add(errorMessage);
View Full Code Here

      try {
        HrFacadeHome aa = (HrFacadeHome)CVUtility.getHomeObject(
            "com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
        HashMap hm = new HashMap();

        HrFacade remote = (HrFacade)aa.create();
        remote.setDataSource(this.dataSource);
        // TODO: We need to remove this hard-coded value FOR USER ID!!!!!
        DL = remote.getEmployeeDetailList(1, hm);
        DL.setTotalNoOfRecords(DL.size());
        DL.setListType("Employee");
        DL.setSortMember(DL2.getSortMember());
        DL.setDirtyFlag(false);

      } catch (Exception e) {
        System.out.println("ListGenerator::getIndividualList" + e);
      }

      // end synchronized

      // IndividualList DL1 = new IndividualList() ;
      EmployeeList DL1 = new EmployeeList();
      DL1.setSortMember(DL2.getSortMember());
      DL1.setSortType(DL2.getSortType());
      DL1.setStartAT(DL2.getStartAT());
      DL1.setEndAT(DL2.getEndAT());
      DL1.setSearchString(searchString);
      DL1.setListType("Employee");
      DL1.setPrimaryTable("employee");
      // write the logic for begin index, endindex for this specific list type
      // here

      int beginIndex = 0;
      int endIndex = 0;
      int startAT = DL2.getStartAT();
      int EndAt = DL2.getEndAT();

      int tnorec = DL.size();

      if (tnorec > EndAt) {
        if (tnorec > EndAt + 100)
          beginIndex = startAT - 100;
        if (beginIndex < 1)
          beginIndex = 1;
        endIndex = EndAt + 100;
      } else {

        beginIndex = 1;
        endIndex = EndAt;
      }

      DL1.setBeginIndex(beginIndex);
      DL1.setEndIndex(endIndex);

      DL2.setBeginIndex(0);
      DL2.setEndIndex(0);

      // search String

      // check for serach string simple or in multiple tables
      // and if the global list is complete
      // if simple search in same GL and make DL1

      // sort

      DL1 = (EmployeeList)this.Sort(DL1, DL);

      DL1.setSearchString(searchString);
      if (!searchString.equals(""))
        DL1.search();

      DL1.setTotalNoOfRecords(DL1.size());
      DL1.setListID(DLparam.getListID());

      // this call will give u sublist from startAT to endAT
      // DL1 = ( EntityList )getFilteredList( DL1.getBeginIndex() ,
      // DL1.getEndIndex() , DL1 );

      return DL1;
    }// end of if SIMPLE :
    else // for ADVANCE:
    {
      String powerString = DLparam.getPowerString();
      try {
        HrFacadeHome aa = (HrFacadeHome)CVUtility.getHomeObject(
            "com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
        HashMap hm = new HashMap();
        hm.put("ADVANCESEARCHSTRING", searchString);
        HrFacade remote = (HrFacade)aa.create();
        remote.setDataSource(this.dataSource);

        // TODO: We need to remove this hard-coded value
        DL = remote.getEmployeeDetailList(1, hm);
        DL.setTotalNoOfRecords(DL.size());
        DL.setListType("Employee");
        DL.setPrimaryTable("employee");
        DL.setDirtyFlag(false);
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.centraview.hr.hrfacade.HrFacade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.