private boolean save() { ActualPlanDetailsVo record = populateDataFromScreen(); String[] uiErrors = getUiErrors(); String[] errors = record.validate(uiErrors); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { record = domain.saveRecord(record); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); ActualPlanDetailsVo updatedRecord = getAndDisplayRecord(form.getGlobalContext().Core.getCurrentCareContext()); updateRowRecord(updatedRecord); return false; } catch (DomainInterfaceException e) { e.printStackTrace(); return false; } form.getLocalContext().seteditedRecord(record); return true; }
protected ActualPlanDetailsVo populateDataFromScreen(ActualPlanDetailsVo value) { if (value == null) value = new ActualPlanDetailsVo(); value.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); value.setDateDecisionToTreat(form.dteDecisionToTreat().getValue()); value.setPlannedTreatmentType(form.cmbPlannedTreatment().getValue()); value.setOrganisationPlanned(form.cmbOrganisationPlanned().getValue()); value.setActualTreatmentDate(form.dteActualTreatment().getValue()); value.setActualTreatmentType(form.cmbActualTreatment().getValue()); value.setOrganisationOrganised(form.cmbOrganisationOrganised().getValue()); return value; }
protected void populateScreenFromData(ActualPlanDetailsVo value) { clear(); if (value == null) return; form.dteDecisionToTreat() .setValue(value.getDateDecisionToTreatIsNotNull() ? value.getDateDecisionToTreat() : null); form.cmbPlannedTreatment() .setValue( value.getPlannedTreatmentTypeIsNotNull() ? value.getPlannedTreatmentType() : null); form.cmbOrganisationPlanned() .setValue(value.getOrganisationPlannedIsNotNull() ? value.getOrganisationPlanned() : null); form.dteActualTreatment() .setValue(value.getActualTreatmentDateIsNotNull() ? value.getActualTreatmentDate() : null); form.cmbActualTreatment() .setValue(value.getActualTreatmentTypeIsNotNull() ? value.getActualTreatmentType() : null); form.cmbOrganisationOrganised() .setValue( value.getOrganisationOrganisedIsNotNull() ? value.getOrganisationOrganised() : null); }