private void open() { if (form.getGlobalContext().Core.BedFloorLayout.getSelection() != null) { FloorBedSpaceLayoutVo value = domain.get(form.getGlobalContext().Core.BedFloorLayout.getSelection()); if (form.getGlobalContext().Core.getBedLayoutActionIsNotNull() && form.getGlobalContext().Core.getBedLayoutAction().equals(BedLayoutAction.CLONE)) { FloorBedSpaceLayoutVo record = new FloorBedSpaceLayoutVo(); record.setBedSpaces(value.getBedSpaces()); record.setFloorLayout(value.getFloorLayout()); record.setName(null); record.setStatus(PreActiveActiveInactiveStatus.PREACTIVE); record.setIsTemplate(true); populateScreenFromData(record); } else { populateScreenFromData(value); form.chkIsTemplate().setEnabled(false); } } else form.chkIsTemplate().setValue(true); }
public FloorBedSpaceLayoutVo listLayoutForCurrentBay(ILocation location) { if(location == null ) throw new DomainRuntimeException("Invalid ILocation"); String hql = "select layout from BayConfig as bc left join bc.bay as bay left join bc.floorBedSpaceLayout as layout where layout.status.id = " + PreActiveActiveInactiveStatus.ACTIVE.getID() + " and bay.id = " + location.getID(); List layout = getDomainFactory().find(hql); FloorBedSpaceLayoutVoCollection voColl = FloorBedSpaceLayoutVoAssembler.createFloorBedSpaceLayoutVoCollectionFromFloorBedSpaceLayout(layout); if (voColl != null && voColl.size() > 0) return voColl.get(voColl.size()-1); return null; }
private void open() { if (form.getGlobalContext().Core.BedFloorLayout.getSelection() != null) { FloorBedSpaceLayoutVo value = domain.get(form.getGlobalContext().Core.BedFloorLayout.getSelection()); if (form.getGlobalContext().Core.getBedLayoutActionIsNotNull() && form.getGlobalContext().Core.getBedLayoutAction().equals(BedLayoutAction.CLONE)) { FloorBedSpaceLayoutVo record = new FloorBedSpaceLayoutVo(); record.setBedSpaces(value.getBedSpaces()); record.setFloorLayout(value.getFloorLayout()); record.setName(null); record.setStatus(PreActiveActiveInactiveStatus.PREACTIVE); record.setIsTemplate(true); populateScreenFromData(record); } else { populateScreenFromData(value); if (FormMode.EDIT.equals(form.getMode())) form.chkIsTemplate().setEnabled(false); } } else form.chkIsTemplate().setValue(true); }
public FloorBedSpaceLayoutVo listLayoutForCurrentBay(ILocation selectedBay) { if(selectedBay == null ) throw new DomainRuntimeException("Invalid ILocation"); String hql = "select layout from BayConfig as bc left join bc.bay as bay left join bc.floorBedSpaceLayout as layout where layout.status.id = " + PreActiveActiveInactiveStatus.ACTIVE.getID() + " and bay.id = " + selectedBay.getID(); List layout = getDomainFactory().find(hql); FloorBedSpaceLayoutVoCollection voColl = FloorBedSpaceLayoutVoAssembler.createFloorBedSpaceLayoutVoCollectionFromFloorBedSpaceLayout(layout); if (voColl != null && voColl.size() > 0) return voColl.get(voColl.size()-1); return null; }
public FloorBedSpaceLayoutVo listLayoutForCurrentBay(ILocation location) { if(location == null ) throw new DomainRuntimeException("Invalid ILocation"); String hql = "select layout from BayConfig as bc left join bc.bay as bay left join bc.floorBedSpaceLayout as layout where layout.status.id = " + PreActiveActiveInactiveStatus.ACTIVE.getID() + " and bay.id = " + location.getID(); List<?> layout = getDomainFactory().find(hql); FloorBedSpaceLayoutVoCollection voColl = FloorBedSpaceLayoutVoAssembler.createFloorBedSpaceLayoutVoCollectionFromFloorBedSpaceLayout(layout); if (voColl != null && voColl.size() > 0) return voColl.get(voColl.size()-1); return null; }
private int getNumberOfOccupiedBedsInBay(LocationRefVo bay) { int occupiedBeds = 0; FloorBedSpaceLayoutVo layout = listLayoutForCurrentBay((ILocation) bay); if (layout != null && layout.getFloorLayout() != null && layout.getBedSpaces() != null) { for (int x = 0; x < layout.getBedSpaces().size(); x++) { BedSpaceVo bedVo = layout.getBedSpaces().get(x); BedSpaceStateLiteVo state = getBedSpaceState(bedVo); if (state != null && state.getCurrentBedStatus() != null && BedStatus.OCCUPIED.equals(state.getCurrentBedStatus().getBedStatus())) { occupiedBeds += 1; } } } return occupiedBeds; }
public ims.core.vo.FloorBedSpaceLayoutVo get(ims.core.layout.vo.FloorBedSpaceLayoutRefVo id) { if(id == null) throw new DomainRuntimeException("Invalid Floor Bed Layout"); return FloorBedSpaceLayoutVoAssembler.create((FloorBedSpaceLayout)getDomainFactory().getDomainObject(id)); }