Exemplo n.º 1
0
 protected void processEditModel(
     String actionCode, String actionObject, HttpServletRequest request) throws SQLException {
   WorkCenterMgr workCenterMgr = (WorkCenterMgr) this.getManagerFromSession(request);
   workCenterMgr.setFunctionMode(Constant.UPDATE);
   String key = actionCode.split("-")[2];
   if (actionObject.equals("WorkCenter")) {
     WorkCenter workCenter =
         (WorkCenter)
             Utility.getObject(workCenterMgr.getCurrentWorkCenterMeta().getWorkCenterList(), key);
     workCenterMgr.setCurrentWorkCenter(workCenter);
   } else if (actionObject.equals("WorkerGroup")) {
     WorkerGroup workerGroup =
         (WorkerGroup)
             Utility.getObject(
                 workCenterMgr.getCurrentWorkerGroupMeta().getWorkerGroupList(), key);
     workCenterMgr.setCurrentWorkerGroup(workerGroup);
   } else if (actionObject.equals("Worker")) {
     Worker worker =
         (Worker)
             Utility.getObject(workCenterMgr.getCurrentWorkerGroupMeta().getWorkerList(), key);
     workCenterMgr.setCurrentWorker(worker);
     workCenterMgr
         .getCurrentWorkerGroupMeta()
         .refreshDepartment(worker.getEmployee().getEmployeeId());
     worker.setDepartment(
         (SelectionOption)
             Utility.getObject(
                 workCenterMgr.getCurrentWorkerGroupMeta().getDepartmentList(),
                 worker.getDepartment().getAttributeId()));
   }
 }
Exemplo n.º 2
0
 protected void processSendModel(
     String actionCode, String actionObject, HttpServletRequest request) throws SQLException {
   WorkCenterMgr workCenterMgr = (WorkCenterMgr) this.getManagerFromSession(request);
   if (actionObject.equals("Working")) {
     workCenterMgr.setFunctionMode(Constant.SEND);
     workCenterMgr
         .getCurrentWorking()
         .saveStatus(workCenterMgr.getFunctionMode(), this.getLogin(request));
   }
 }
Exemplo n.º 3
0
 protected void processDeleteModel(
     String actionCode, String actionObject, HttpServletRequest request) throws SQLException {
   WorkCenterMgr workCenterMgr = (WorkCenterMgr) this.getManagerFromSession(request);
   if (actionObject.equals("Assignment")) {
     String key = actionCode.split("-")[2];
     this.setHttpParameterWorking(request, workCenterMgr);
     WorkingDetail workingDetail =
         (WorkingDetail)
             Utility.getObject(workCenterMgr.getCurrentWorking().getWorkingDetailList(), key);
     workCenterMgr.getCurrentWorking().getWorkingDetailList().remove(workingDetail);
     workCenterMgr.getCurrentWorking().setDetailListRowNo();
   } else if (actionObject.equals("Working")) {
     workCenterMgr.setFunctionMode(Constant.DELETE);
     workCenterMgr
         .getCurrentWorking()
         .saveStatus(workCenterMgr.getFunctionMode(), this.getLogin(request));
   }
 }
Exemplo n.º 4
0
  protected void initModel(String page, HttpServletRequest request) throws SQLException {
    WorkCenterMgr workCenterMgr = new WorkCenterMgr();
    this.putManagerToSession(request, workCenterMgr);

    workCenterMgr.setFunctionMode(Constant.CREATE);
    if (page.equals("workCenter")) {
      workCenterMgr.setEntryMode(Constant.WORKCENTER);
      workCenterMgr.getCurrentWorkCenterMeta().refreshFactory();
      workCenterMgr.getCurrentWorkCenterMeta().populateWorkCenterList();
    } else if (page.equals("createWorkerGroup")) {
      workCenterMgr.setEntryMode(Constant.WORKER_GROUP);
      workCenterMgr.getCurrentWorkCenterMeta().refreshFactory();
      workCenterMgr.getCurrentWorkerGroupMeta().populateWorkerGroupList(workCenterMgr);
    } else if (page.equals("createWorker")) {
      workCenterMgr.setEntryMode(Constant.CREATE_WORKER);
      workCenterMgr.getCurrentWorkCenterMeta().refreshFactory();
      workCenterMgr.getCurrentWorkerGroupMeta().refreshDepartment(null);
      workCenterMgr.getCurrentWorkerGroupMeta().populateWorkerList(workCenterMgr);
    } else if (page.endsWith("Working")) {
      if (page.equals("createWorking")) {
        workCenterMgr.setEntryMode(Constant.CREATE_WORKING);
      } else if (page.equals("updateWorking")) {
        workCenterMgr.setEntryMode(Constant.UPDATE_WORKING);
      } else if (page.equals("deleteWorking")) {
        workCenterMgr.setEntryMode(Constant.DELETE_WORKING);
      } else if (page.equals("confirmWorking")) {
        workCenterMgr.setEntryMode(Constant.CONFIRM_WORKING);
      } else if (page.equals("reportWorking")) {
        workCenterMgr.setEntryMode(Constant.REPORT_WORKING);
      }
      workCenterMgr.getCurrentWorkCenterMeta().refreshFactory();
      workCenterMgr.getCurrentWorkerGroupMeta().refreshDepartment(null);
      //        } else if (page.equals("paymentReport")) {
      //            workCenterMgr.setEntryMode(Constant.PAYMENT_WORKING_REPORT);
      //            workCenterMgr.setCurrentWorkCenterMeta(new WorkCenterMeta());
      //            workCenterMgr.getCurrentWorkCenterMeta().refreshFactory();
    }
  }