コード例 #1
0
  public void executeAction(ActionEvent event) {
    if (mode.equals(Constant.SCHEDULE_REMOVE)) {
      for (ScheduleBranch row : listScheduleBranch) {
        if (row.getState() == 1) {
          tableService.removeSchedule(
              row.getCrmDoctorSchedule().getCrmBranch().getId(),
              row.getCrmDoctorSchedule().getCrmDoctor().getId());
        }
      }
    }

    int count = 0;
    for (ScheduleBranch row : listScheduleBranch) {
      if (row.getState() == 1) {
        String message = FacesUtil.getMessage("msg_record_ok");
        row.setMessage(message);
        tableService.saveDoctorSchedule(row.getCrmDoctorSchedule());
        count++;
      }
    }

    disabledButton = true;
    disabledExecuteButton = true;
    String message = FacesUtil.getMessage("msg_load_ok", String.valueOf(count));
    FacesUtil.addInfo(message);
  }
コード例 #2
0
  public void saveAction() {
    String message = null;

    int result = tablesService.saveProfile(selected);
    if (result == 0) {
      list = tablesService.getListProfile();
      model = new ProfileDataModel(list);
      message = FacesUtil.getMessage("msg_record_ok");
      FacesUtil.addInfo(message);
    } else if (result == -1) {
      String paramValue = FacesUtil.getMessage("pro_code");
      message = FacesUtil.getMessage("msg_record_unique_exception", paramValue);
      FacesUtil.addError(message);
    }
  }
コード例 #3
0
  public ProfileDataModel getModel() {
    if (model == null) {
      list = tablesService.getListProfile();
      model = new ProfileDataModel(list);

      if (list.size() > 0) {
        selected = list.get(0);
      }
    }
    return model;
  }