private void initialise() { form.grdLayouts().setEnabled(false); form.getContextMenus().Core.getWardBayConfigDialogADDItem().setVisible(false); form.getContextMenus().Core.getWardBayConfigDialogREMOVEItem().setVisible(false); prepopulateSpecialties(); //available floor layouts form.getLocalContext().setActiveLayouts(domain.listFloorBedLayouts()); //load templates combo if(form.getLocalContext().getActiveLayoutsIsNotNull()) { form.cmbTemplates().clear(); for(FloorBedSpaceLayoutLiteVo voItem : form.getLocalContext().getActiveLayouts()) { form.cmbTemplates().newRow(voItem, voItem.getName()); } } }
private void addAvailableFloorLayouts(grdLayoutsRow row) { FloorBedSpaceLayoutLiteVoCollection voCollLayout = form.getLocalContext().getActiveLayouts(); if(voCollLayout != null) { for (FloorBedSpaceLayoutLiteVo voFloorBedSpace : voCollLayout) { if(voFloorBedSpace != null) row.getBayBedSpaceLayout().newRow(voFloorBedSpace, voFloorBedSpace.getName()); } if (voCollLayout.size() > 0 && row.getValue() != null && row.getValue().getID_BayConfig() == null) { if (voCollLayout.size() == 1) row.getBayBedSpaceLayout().setValue(voCollLayout.get(0)); else { row.getBayBedSpaceLayout().showOpened(); } } } }
private DynamicGridRow addBay(DynamicGridRow parentRow, BayConfigVo bayConfigVo) { if(parentRow == null || bayConfigVo == null) return null; DynamicGridRow row = parentRow.getRows().newRow(); if(bayConfigVo.getBayIsNotNull()) { DynamicGridCell cell = row.getCells().newCell(getNameColumn(), DynamicCellType.LABEL); cell.setValue(bayConfigVo.getBay().getName()); cell.setIdentifier(bayConfigVo); } row.setExpandedImage(form.getImages().Admin.Location); row.setCollapsedImage(form.getImages().Admin.Location); row.setSelectable(false); if(bayConfigVo.getFloorBedSpaceLayoutIsNotNull()) { DynamicGridCell floorCell = row.getCells().newCell(getFloorColumn(), DynamicCellType.LABEL); FloorBedSpaceLayoutLiteVo floorLayout = bayConfigVo.getFloorBedSpaceLayout(); if(floorLayout != null) { floorCell.setValue(floorLayout.getName()); floorCell.setIdentifier(floorLayout); } } return row; }
private void add(FloorBedSpaceLayoutLiteVo value) { if(value == null) return; ims.core.forms.bedspacelayoutlist.GenForm.grdDetailsRow row = form.grdDetails().getRows().newRow(value.equals(form.getGlobalContext().Core.BedFloorLayout.getSelection())); row.setcolName(value.getName()); row.setcolStatus(value.getStatus()); row.setcolTemplate(value.getIsTemplate()); row.setValue(value); }
private void addAvailableFloorLayouts(grdLayoutsRow row) { FloorBedSpaceLayoutLiteVoCollection voCollLayout = form.getLocalContext().getActiveLayouts(); if(voCollLayout != null) { for (FloorBedSpaceLayoutLiteVo voFloorBedSpace : voCollLayout) { if(voFloorBedSpace != null) row.getBayBedSpaceLayout().newRow(voFloorBedSpace, voFloorBedSpace.getName()); } } }
private void initialise() { form.grdLayouts().setEnabled(false); form.getContextMenus().Core.getWardBayConfigDialogADDItem().setVisible(false); form.getContextMenus().Core.getWardBayConfigDialogREMOVEItem().setVisible(false); form.getLocalContext().setLCTotalNoOfBeds(0); prepopulateSpecialties(); //available floor layouts form.getLocalContext().setActiveLayouts(domain.listFloorBedLayouts()); //load templates combo if(form.getLocalContext().getActiveLayoutsIsNotNull()) { form.cmbTemplates().clear(); for(FloorBedSpaceLayoutLiteVo voItem : form.getLocalContext().getActiveLayouts()) { form.cmbTemplates().newRow(voItem, voItem.getName()); } if (form.getLocalContext().getActiveLayouts() != null && form.getLocalContext().getActiveLayouts().size() > 0) { if (form.getGlobalContext().STHK.getWardBayConfigVo() != null && form.getGlobalContext().STHK.getWardBayConfigVo().getID_WardBayConfig() == null) { if (form.getLocalContext().getActiveLayouts().size() == 1) { form.cmbTemplates().setValue(form.getLocalContext().getActiveLayouts().get(0)); } else { form.cmbTemplates().showOpened(); } } } } }
private void calculateNrOfBeds() { int numberOfBeds = 0; WardBayConfigVo voWardBayConf = form.getGlobalContext().STHK.getWardBayConfigVo(); if(voWardBayConf == null) return; if (YesNo.YES.equals(form.ansYesNo().getValue())) { for(int i = 0; i < form.grdLayouts().getRows().size(); i++) { if (Boolean.TRUE.equals(form.grdLayouts().getRows().get(i).getActive()) && form.grdLayouts().getRows().get(i).getBayBedSpaceLayout().getValue() != null) { FloorBedSpaceLayoutLiteVo floorBedSpaceLayoutLite = (FloorBedSpaceLayoutLiteVo) form.grdLayouts().getRows().get(i).getBayBedSpaceLayout().getValue(); numberOfBeds = numberOfBeds + getNrOfBeds(floorBedSpaceLayoutLite); } } } else if (Boolean.TRUE.equals(form.cmbTemplates().getVisible()) && form.cmbTemplates().getValue() != null) { numberOfBeds =getNrOfBeds( form.cmbTemplates().getValue()); } String numberOfBedSpaces = " (Total Number of Bed Spaces: " + numberOfBeds + ")"; form.getLocalContext().setLCTotalNoOfBeds(numberOfBeds); form.lblWard().setValue(voWardBayConf.getWard() != null ? voWardBayConf.getWard().getName() + numberOfBedSpaces : ""); }
private int getNrOfBeds(FloorBedSpaceLayoutLiteVo floorLayout) { int noOfBeds = 0; if (floorLayout == null || (floorLayout != null && !floorLayout.getBedSpacesIsNotNull()) ) return noOfBeds; return noOfBeds = floorLayout.getBedSpaces().size(); }