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); }
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); } }
public void handleFileUpload(FileUploadEvent event) { String message = FacesUtil.getMessage("file_msg_upload", event.getFile().getFileName()); FacesUtil.addInfo(message); disabledButton = false; disabledExecuteButton = true; try { fileName = FacesUtil.getParameterTextValue("RUTA_ARCHIVOS_TEMPORALES") + "/" + event.getFile().getFileName(); copyFile(fileName, event.getFile().getInputstream()); } catch (IOException e) { e.printStackTrace(); } }