Package org.jallinone.scheduler.activities.java

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


    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;
View Full Code Here


  /**
   * Callback method invoked when the user has clicked on the insert button
   * @param valueObject empty value object just created: the user can manage it to fill some attribute values
   */
  public void createValueObject(ValueObject valueObject) throws Exception {
    ScheduledEmployeeVO vo = (ScheduledEmployeeVO)valueObject;
    ScheduledActivityPK pk = (ScheduledActivityPK)grid.getOtherGridParams().get(ApplicationConsts.SCHEDULED_ACTIVITY_PK);
    vo.setCompanyCodeSys01SCH07(pk.getCompanyCodeSys01SCH06());
    vo.setProgressiveSch06SCH07(pk.getProgressiveSCH06());
    vo.setStartDateSCH07(panel.getActVO().getStartDateSCH06());
    vo.setEndDateSCH07(panel.getActVO().getEstimatedEndDateSCH06());
    vo.setDurationSCH07(panel.getActVO().getEstimatedDurationSCH06());
  }
View Full Code Here

   * @param oldValue old cell value (before cell editing)
   * @param newValue new cell value (just edited)
   * @return <code>true</code> if cell value is valid, <code>false</code> otherwise
   */
  public boolean validateCell(int rowNumber,String attributeName,Object oldValue,Object newValue) {
    ScheduledEmployeeVO vo = (ScheduledEmployeeVO)grid.getVOListTableModel().getObjectForRow(rowNumber);
    if ((attributeName.equals("endDateSCH07")) &&
        newValue!=null && vo.getStartDateSCH07()!=null) {
      vo.setDurationSCH07(new BigDecimal(
        (((java.util.Date)newValue).getTime()-vo.getStartDateSCH07().getTime())/1000/60
      ));
    }
    else if ((attributeName.equals("startDateSCH07")) &&
        newValue!=null && vo.getEndDateSCH07()!=null) {
      vo.setDurationSCH07(new BigDecimal(
        (vo.getEndDateSCH07().getTime()-((java.util.Date)newValue).getTime())/1000/60
      ));
    }
    else if (
        attributeName.equals("durationSCH07") &&
        newValue!=null && vo.getStartDateSCH07()!=null) {
      vo.setEndDateSCH07(new java.sql.Timestamp(
        vo.getStartDateSCH07().getTime()+((BigDecimal)newValue).longValue()*1000*60
      ));
    }
    return true;
}
View Full Code Here

   * @param oldPersistentObjects old value objects, previous the changes
   * @param persistentObjects value objects relatied to the changed rows
   * @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed
   */
  public Response updateRecords(int[] rowNumbers,ArrayList oldPersistentObjects,ArrayList persistentObjects) throws Exception {
    ScheduledEmployeeVO oldVO = null;
    ScheduledEmployeeVO newVO = null;
    Response res = null;
    for(int i=0;i<oldPersistentObjects.size();i++) {
      oldVO = (ScheduledEmployeeVO)oldPersistentObjects.get(i);
      newVO = (ScheduledEmployeeVO)persistentObjects.get(i);
      if (oldVO.getEmployeeCodeSCH01()==null) {
View Full Code Here

      }

      // check if there exists a scheduled employee that has not a task with a sale activity code linked...
      DetailCallOutRequestVO vo = (DetailCallOutRequestVO)frame.getCalloutPanel().getVOModel().getValueObject();
      VOListTableModel model = frame.getResourcesPanel().getTasksGrid().getVOListTableModel();
      ScheduledEmployeeVO empVO = null;
      ArrayList tasks = null;
      TaskVO taskVO = null;
      Response res = null;
      HashMap map = new HashMap();
      map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      for(int i=0;i<model.getRowCount();i++) {
        empVO = (ScheduledEmployeeVO)model.getObjectForRow(i);
        res = ClientUtils.getData("validateTaskCode",new LookupValidationParams(empVO.getTaskCodeREG07(),map));
        if (res.isError()) {
          JOptionPane.showMessageDialog(
               ClientUtils.getParentFrame(frame),
               ClientSettings.getInstance().getResources().getResource(res.getErrorMessage()),
               ClientSettings.getInstance().getResources().getResource("Error"),
               JOptionPane.ERROR_MESSAGE
           );
           return;
        }
        tasks = new ArrayList(((VOListResponse)res).getRows());
        if (tasks.size()!=1) {
           JOptionPane.showMessageDialog(
               ClientUtils.getParentFrame(frame),
               ClientSettings.getInstance().getResources().getResource("no task defined for the scheduled employee")+" "+empVO.getEmployeeCodeSCH01(),
               ClientSettings.getInstance().getResources().getResource("Error"),
               JOptionPane.ERROR_MESSAGE
           );
           return;
        }
View Full Code Here

           */
          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;
View Full Code Here

TOP

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

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.