Package com.centraview.hr.helper

Examples of com.centraview.hr.helper.ExpenseFormVO


  public boolean saveForm(int indvID, DynaValidatorForm dynaform,
    HttpServletRequest request, HttpServletResponse response) throws CommunicationException,NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    ExpenseFormVOX expenseFormVOX = new ExpenseFormVOX(userobject, dynaform);
    ExpenseFormVO expenseFormVO = expenseFormVOX.getExpenseFormVO();

    //    //ProjectFacadeHome pfh = (ProjectFacadeHome)CVUtility.getHomeObject("com.centraview.projects.projectfacade.ProjectFacadeHome","ProjectFacade");
    HrFacadeHome hfh = (HrFacadeHome)
      CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
View Full Code Here


     
      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());

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

      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());

      request.setAttribute("ExpenseFormVO",expenseFormVO);
      session.setAttribute("ExpenseFormVO",expenseFormVO);
     
      //Added by Rohit to check
View Full Code Here

        //  String expenseFormIDString =(String)hrexpenseForm.getExpenseFormID();
        expenseFormID = hrexpenseForm.getExpenseFormID();
        //get("expenseFormID");
      }

      ExpenseFormVO expenseformVo = null;

      //Put all item to ItemLines
      if (expenseFormID == 0)
      {
        hrexpenseForm.convertItemLines();
      }
      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();
        if (date != null)
        {
          hrexpenseForm.setCreatedDate(date.toString());
        }
      }

      if (typeOfSave != null)
      {
        if (typeOfSave.equals("savenew") || typeOfSave.equals("saveandnew"))
        {
          // forward to jsp page
          FORWARD_final = FORWARD_savenew;

          request.setAttribute("body", "EDIT");

          request.setAttribute("HrExpenseForm", new HrExpenseForm());
          session.setAttribute("HrExpenseForm", new HrExpenseForm());
          //changed now request.setAttribute("hrexpenseform",new HrExpenseForm());

        }
        if (typeOfSave.equals("saveandclose"))
        {
          // forward to jsp page
          request.setAttribute("HrExpenseForm", hrexpenseForm);
          session.setAttribute("HrExpenseForm", hrexpenseForm);
          request.setAttribute("ExpenseFormVO", expenseFormVO);
          session.setAttribute("ExpenseFormVO", expenseFormVO);
          FORWARD_final = FORWARD_saveclose;

          request.setAttribute("body", "list");
        }

        if (typeOfSave.equals("save"))
        {

          // forward to jsp page
          FORWARD_final = FORWARD_save;

          request.setAttribute("body", "EDIT");

          if (expenseFormID > 0)
          {
            hrexpenseForm.setCreatedDate(expenseFormVO.getCreatedDate().toString());
            //set("CreatedDate",(expenseFormVO.getCreatedDate()).toString());
          }
          session.setAttribute("HrExpenseForm", hrexpenseForm);
          request.setAttribute("HrExpenseform", hrexpenseForm);
          request.setAttribute("ExpenseFormVO", expenseFormVO);
View Full Code Here

      {
        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());
        this.hrexpenseForm.setEmployeeID(expenseFormVO.getEmployeeId());
        this.hrexpenseForm.setReportto(expenseFormVO.getReportingTo());
        this.hrexpenseForm.setReporttoID(expenseFormVO.getReportingId());
        this.hrexpenseForm.setNotes(expenseFormVO.getNotes());
        this.hrexpenseForm.setStatus(expenseFormVO.getStatus());

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

          this.hrexpenseForm.setFromyear((String)fromDateSplitUp.get(0));
          this.hrexpenseForm.setFrommonth((String)fromDateSplitUp.get(1));
          this.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);
          this.hrexpenseForm.setToyear((String)toDateSplitUp.get(0));
          this.hrexpenseForm.setTomonth((String)toDateSplitUp.get(1));
          this.hrexpenseForm.setToday((String)toDateSplitUp.get(2));
        }

        this.hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());

        //request.setAttribute("expenseform",expenseForm);
        request.setAttribute("ExpenseFormVO", expenseFormVO);
        session.setAttribute("ExpenseFormVO", expenseFormVO);
View Full Code Here

  *  This method set the basicform for
  *
  */
     private void setBasicForm(HashMap hm)
     {
       this.expenseFormVO = new ExpenseFormVO();

       Long tmp = (Long)(hm.get("ExpenseFormID"));
       if(tmp!=null)
         this.expenseFormVO.setExpenseFormID(tmp.intValue());

View Full Code Here

  }


  public ExpenseFormVO getExpenseFormVO(int ExpenseFormID)
  {
    ExpenseFormVO expenseFormVO = null;
      try
      {
        InitialContext ic = CVUtility.getInitialContext();
        HrExpensesLocalHome home = (HrExpensesLocalHome)ic.lookup("local/HrExpense");
        HrExpensesLocal hrexpense = home.findByPrimaryKey(new ExpenseFormPK(ExpenseFormID,this.dataSource));
View Full Code Here

TOP

Related Classes of com.centraview.hr.helper.ExpenseFormVO

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.