public void save(LeisureActivitiesVo voLeisureActivities) throws StaleObjectException, UniqueKeyViolationException { if(!voLeisureActivities.isValidated()) throw new DomainRuntimeException("This Leisure Activity has not been validated"); if(voLeisureActivities.getID_LeisureActivities() == null) { if(voLeisureActivities.getCareContextIsNotNull()) { LeisureActivitiesVoCollection coll = getLeisureActivitiesVoByCareContext(voLeisureActivities.getCareContext()); if(coll != null && coll.size()>0) throw new DomainRuntimeException("A Leisure record already exists for this CareContext. "); } } DomainFactory factory = getDomainFactory(); LeisureActivities doLeisureActivities = LeisureActivitiesVoAssembler.extractLeisureActivities(factory, voLeisureActivities); factory.save(doLeisureActivities); }
private void populateInstanceControl(LeisureActivitiesVo voLeisureActivities) { if(voLeisureActivities == null) return; if(voLeisureActivities.getOnWardLeisureIsNotNull()) populateListControl(voLeisureActivities.getOnWardLeisure()); form.qmbAuthoringCP().newRow(voLeisureActivities.getAuthoringCP(), voLeisureActivities.getAuthoringCP().toString()); form.qmbAuthoringCP().setValue(voLeisureActivities.getAuthoringCP()); form.dtimAuthoring().setValue(voLeisureActivities.getAuthoringDateTime()); form.txtActive().setValue(voLeisureActivities.getActiveInterest()); form.txtPassive().setValue(voLeisureActivities.getPassiveInterest()); form.txtSocial().setValue(voLeisureActivities.getSocialInterest()); }
private void newLeisureInstance() { LeisureActivitiesVo voNewParent = new LeisureActivitiesVo(); form.getLocalContext().setUpdateChildInstance(new Boolean(true)); voNewParent.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); populateParentInstanceControls(); form.getLocalContext().setLeisureActivities(voNewParent); }
private void populateChildCollectionFromGrid(LeisureActivitiesVo voLeisureActivities) { //if (form.grdDetails().getValue() == null) return; for (int i=0; i < form.grdDetails().getRows().size(); i++) { if (voLeisureActivities.getOnWardLeisure() == null) voLeisureActivities.setOnWardLeisure(new LeisureActivityOnWardVoCollection()); voLeisureActivities.getOnWardLeisure().add(form.grdDetails().getRows().get(i).getValue()); } }
private void populateParentInstanceData(LeisureActivitiesVo voLeisureActivities) { voLeisureActivities.setAuthoringCP(form.qmbAuthoringCP().getValue()); voLeisureActivities.setAuthoringDateTime(form.dtimAuthoring().getValue()); voLeisureActivities.setActiveInterest(form.txtActive().getValue()); voLeisureActivities.setSocialInterest(form.txtSocial().getValue()); voLeisureActivities.setPassiveInterest(form.txtPassive().getValue()); }
private void populateControls(LeisureActivitiesVo voLeisureActivities) { populateInstanceControl(voLeisureActivities); }