public TrackingAreaLiteVo getRegistrationAreaByLocation(LocationRefVo locationRef) { if(locationRef == null) throw new CodingRuntimeException("Can not get TrackingArea value on null locationID."); StringBuffer hql = new StringBuffer(); hql.append("select trackArea from TrackingArea as trackArea "); hql.append("where trackArea.eDLocation.id = :locationID and trackArea.isRegistrationArea = 1"); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"locationID"}, new Object[] {locationRef.getID_Location()}); if (list!=null && list.size()>0) { return TrackingAreaLiteVoAssembler.create((TrackingArea)list.get(0)); } return null; }
private void newInstanceNewClick() { clear(); form.getLocalContext().setCurrentTracking(domain.getTracking(form.getGlobalContext().Emergency.getTracking())); //WDEV-15827 form.getLocalContext().setCurrentCubicleAllocation(new CubicleAllocationVo()); MemberOfStaffLiteVo temp = null; if(domain.getMosUser() instanceof MemberOfStaffLiteVo) { temp = (MemberOfStaffLiteVo) domain.getMosUser(); } form.ccAllocatedBy().setValue(temp); if(form.getLocalContext().getCurrentTrackingIsNotNull()) { TrackingAreaLiteVo trackingArea = form.getLocalContext().getCurrentTracking().getCurrentArea(); form.lblNameOfTrackingArea().setValue(trackingArea != null ? trackingArea.getAreaDisplayName():""); } else { form.lblNameOfTrackingArea().setValue(""); } form.dtimAllocatedCubicle().setValue(new DateTime()); initializeCubiclesRoomsBedsCombo(); //wdev-16011 //wdev-16068 if( form.cmbCubicle().getValues().size() == 1) { TrackingCubicleRoomBedVo tempvo = (TrackingCubicleRoomBedVo) form.cmbCubicle().getValues().get(0); form.cmbCubicle().setValue(tempvo); } //---------------- form.setMode(FormMode.EDIT); }
public TrackingAreaLiteVo getTrackingAreaLite(TrackingAreaRefVo trackingAreaRef) { if(trackingAreaRef == null) throw new CodingRuntimeException("Cannot get TrackingArea on null Id."); return TrackingAreaLiteVoAssembler.create((TrackingArea) getDomainFactory().getDomainObject(TrackingArea.class, trackingAreaRef.getID_TrackingArea())); }