Package org.jallinone.scheduler.activities.java

Examples of org.jallinone.scheduler.activities.java.ScheduledActivityVO


    ValueObject newValueObject = (ValueObject)newValueObjects.get(0);
    if (!checkTimes((EmployeeActivityVO)newValueObject)) {
      return new ErrorResponse(ClientSettings.getInstance().getResources().getResource("start time must be less than end time"));
    }
    EmployeeActivityVO vo = (EmployeeActivityVO)newValueObject;
    ScheduledActivityVO actVO = new ScheduledActivityVO();
    actVO.setCompanyCodeSys01SCH06(vo.getCompanyCodeSys01SCH06());
    actVO.setCompletionPercSCH06(new BigDecimal(0));
    actVO.setDescriptionSCH06(vo.getDescriptionSCH06());
    actVO.setEstimatedDurationSCH06(vo.getDurationSCH07());
    actVO.setEstimatedEndDateSCH06(vo.getEndDateSCH07());
    actVO.setPrioritySCH06(ApplicationConsts.PRIORITY_NORMAL);
    actVO.setStartDateSCH06(vo.getStartDateSCH07());
    actVO.setActivityTypeSCH06(vo.getActivityTypeSCH06());
    actVO.setActivityStateSCH06(ApplicationConsts.OPENED);
    Response res = ClientUtils.getData("insertScheduledActivity",actVO);
    if (res.isError())
      return res;
    actVO = (ScheduledActivityVO)((VOResponse)res).getVo();
    ScheduledEmployeeVO schEmpVO = new ScheduledEmployeeVO();
    schEmpVO.setCompanyCodeSys01SCH07(actVO.getCompanyCodeSys01SCH06());
    schEmpVO.setProgressiveReg04SCH07(vo.getProgressiveReg04SCH07());
    schEmpVO.setDurationSCH07(vo.getDurationSCH07());
    schEmpVO.setStartDateSCH07(actVO.getStartDateSCH06());
    schEmpVO.setEndDateSCH07(vo.getEndDateSCH07());
    schEmpVO.setProgressiveSch06SCH07(actVO.getProgressiveSCH06());
    ArrayList list = new ArrayList();
    list.add(schEmpVO);
    res = ClientUtils.getData("insertScheduledEmployees",list);
    if (res.isError())
      return res;
    vo.setProgressiveSCH06(actVO.getProgressiveSCH06());

    return res;
  }
View Full Code Here


      frame.setButtonsEnabled(true);
      frame.getTab().setEnabledAt(2,true);
      frame.getActPanel().insert();
      frame.getActPanel().getControlActType().setValue(ApplicationConsts.ACT_CALL_OUT);
      frame.getActPanel().getControlDescr().setValue(vo.getDescriptionSCH03());
      ScheduledActivityVO actVO = (ScheduledActivityVO)frame.getActPanel().getVOModel().getValueObject();
      actVO.setCompanyCodeSys01SCH06(vo.getCompanyCodeSys01SCH03());

      frame.getConfirmButton().setEnabled(true);
      frame.getInvoiceButton().setEnabled(false);
      frame.getViewInvoiceButton().setEnabled(false);
    }
View Full Code Here

          );
          return;
        }
      }

      ScheduledActivityVO actVO = (ScheduledActivityVO)frame.getActPanel().getVOModel().getValueObject();
      DetailSaleDocVO docVO = new DetailSaleDocVO();
      docVO.setCompanyCodeSys01DOC01(vo.getCompanyCodeSys01SCH03());
      docVO.setDocYearDOC01(vo.getRequestYearSCH03());
      docVO.setDocTypeDOC01(ApplicationConsts.SALE_INVOICE_DOC_TYPE);
      docVO.setDocDateDOC01(new java.sql.Date(vo.getRequestDateSCH03().getTime()));
View Full Code Here

           * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
           */
          public Response insertRecord(ValueObject newPersistentObject) throws Exception {
            Response response = super.insertRecord(newPersistentObject);
            if (!response.isError()) {
              ScheduledActivityVO vo = (ScheduledActivityVO)((VOResponse)response).getVo();
              ScheduledEmployeeVO schEmpVO = new ScheduledEmployeeVO();
              schEmpVO.setCompanyCodeSys01SCH07(vo.getCompanyCodeSys01SCH06());
              schEmpVO.setDescriptionSYS10(empVO.getTaskDescriptionSYS10());
              schEmpVO.setDurationSCH07(vo.getEstimatedDurationSCH06());
              schEmpVO.setEmployeeCodeSCH01(empVO.getEmployeeCodeSCH01());
              schEmpVO.setEndDateSCH07(vo.getEstimatedEndDateSCH06());
              schEmpVO.setProgressiveReg04SCH07(empVO.getProgressiveReg04SCH01());
              schEmpVO.setProgressiveSch06SCH07(vo.getProgressiveSCH06());
              schEmpVO.setStartDateSCH07(vo.getStartDateSCH06());
              schEmpVO.setTaskCodeREG07(empVO.getTaskCodeReg07SCH01());
              ArrayList list = new ArrayList();
              list.add(schEmpVO);
              Response res = ClientUtils.getData("insertScheduledEmployees",list);
              if (res.isError())
                return res;
              else
                setEmployeeVO(empVO);
            }
            return response;
          }

        };
        ScheduledActivityVO vo = (ScheduledActivityVO)c.getDetailFrame().getMainForm().getVOModel().getValueObject();

        int h = newApp[1]/hourH;
        int m = (newApp[1]-h*hourH)*69/hourH;
        Calendar cal = Calendar.getInstance();
        cal.setTime(currentDay);
        cal.set(cal.HOUR_OF_DAY,h);
        cal.set(cal.MINUTE,m);
        vo.setStartDateSCH06(new java.sql.Timestamp(cal.getTimeInMillis()));

        h = newApp[3]/hourH;
        m = (newApp[3]-h*hourH)*60/hourH;
        cal.setTime(currentDay);
        cal.set(cal.HOUR_OF_DAY,h);
        cal.set(cal.MINUTE,m);
        vo.setEstimatedEndDateSCH06(new java.sql.Timestamp(cal.getTimeInMillis()));
        vo.setEstimatedDurationSCH06(new BigDecimal((vo.getEstimatedEndDateSCH06().getTime()-vo.getStartDateSCH06().getTime())/60000));

        c.getDetailFrame().getMainForm().getForm().pull();

        newApp = null;
        repaint();
      }


      public void mouseClicked(MouseEvent e) {
        if (SwingUtilities.isLeftMouseButton(e) &&
            (e.getClickCount()==1 || e.getClickCount()==2)) {
          Enumeration en = appointments.keys();
          int[] app = null;
          selectedApp = null;
          while(en.hasMoreElements()) {
            app = (int[])en.nextElement();
            if (e.getX()>=app[0] && e.getX()<=app[2] && e.getY()>=app[1] && e.getY()<=app[3]) {
              selectedApp = app;
              break;
            }
          }
          Day.this.repaint();
          if (selectedApp!=null && e.getClickCount()==2) {
            EmployeeActivityVO vo = (EmployeeActivityVO)appointments.get(selectedApp);
            ScheduledActivityController c = new ScheduledActivityController(null,null,new ScheduledActivityPK(
              vo.getCompanyCodeSys01SCH06(),
              vo.getProgressiveSCH06()
            ),false) {
              public void afterInsertData() {
                super.afterInsertData();
                setEmployeeVO(empVO);
              }
View Full Code Here

                if (controlSubjectType.getValue().equals(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER)) {
                  OrganizationCustomerVO model = (OrganizationCustomerVO)customerPanel.getVOModel().getValueObject();
                  c.getControlName_1Subject().setValue(model.getName_1REG04());
                  c.getControlName_2Subject().setValue(model.getName_2REG04());
                  ScheduledActivityVO actVO = (ScheduledActivityVO)c.getVOModel().getValueObject();
                  actVO.setProgressiveReg04SubjectSCH06(model.getProgressiveREG04());
                  c.getDetailFrame().getMainForm().getForm().pull("progressiveReg04SubjectSCH06");
                }
                else {
                  PeopleCustomerVO model = (PeopleCustomerVO)customerPanel.getVOModel().getValueObject();
                  c.getControlName_1Subject().setValue(model.getName_1REG04());
                  c.getControlName_2Subject().setValue(model.getName_2REG04());
                  ScheduledActivityVO actVO = (ScheduledActivityVO)c.getVOModel().getValueObject();
                  actVO.setProgressiveReg04SubjectSCH06(model.getProgressiveREG04());
                  c.getDetailFrame().getMainForm().getForm().pull("progressiveReg04SubjectSCH06");
                }

              }
              return false;
View Full Code Here

                if (controlSubjectType.getValue().equals(ApplicationConsts.SUBJECT_ORGANIZATION_CONTACT)) {
                  OrganizationVO model = (OrganizationVO)getCurrentForm().getVOModel().getValueObject();
                  c.getControlName_1Subject().setValue(model.getName_1REG04());
                  c.getControlName_2Subject().setValue(model.getName_2REG04());
                  ScheduledActivityVO actVO = (ScheduledActivityVO)c.getVOModel().getValueObject();
                  actVO.setProgressiveReg04SubjectSCH06(model.getProgressiveREG04());
                  c.getDetailFrame().getMainForm().getForm().pull("progressiveReg04SubjectSCH06");
                }
                else {
                  PeopleVO model = (PeopleVO)getCurrentForm().getVOModel().getValueObject();
                  c.getControlName_1Subject().setValue(model.getName_1REG04());
                  c.getControlName_2Subject().setValue(model.getName_2REG04());
                  ScheduledActivityVO actVO = (ScheduledActivityVO)c.getVOModel().getValueObject();
                  actVO.setProgressiveReg04SubjectSCH06(model.getProgressiveREG04());
                  c.getDetailFrame().getMainForm().getForm().pull("progressiveReg04SubjectSCH06");
                }

              }
              return false;
View Full Code Here

TOP

Related Classes of org.jallinone.scheduler.activities.java.ScheduledActivityVO

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.