private void search() { AvailableBedsVo beds = populateDataFromScreen(); form.getGlobalContext().STHK.setAvailableBedsListFilter(beds); form.getContextMenus().hideAllGenericGridMenuItems(); form.grdAvailableBeds().getRows().clear(); form.lbl6().setValue("Total : 0"); // WDEV-18099 BedSpaceStateLiteVoCollection availableBeds = null; if (beds.countFieldsWithValue() > 0) { availableBeds = domain.listAvailableBeds(beds); } else { engine.showMessage("Please enter some valid search criteria.", "Invalid search criteria", MessageButtons.OK, MessageIcon.ERROR); return; } if (availableBeds == null || availableBeds.size() == 0) { engine.showMessage("No Bed records match your search criteria.", "No data found", MessageButtons.OK, MessageIcon.WARNING); return; } if (availableBeds != null) form.lbl6().setValue("Total : " + String.valueOf(availableBeds.size())); populateGrid(availableBeds); }
private AvailableBedsVo populateDataFromScreen() { AvailableBedsVo beds=new AvailableBedsVo(); if (form.qmbWard()!=null) beds.setWard(form.qmbWard().getValue()); if (form.cmbBedStatus()!=null) beds.setBedStatus(form.cmbBedStatus().getValue()); if (form.cmbBedType()!=null) beds.setBedType(form.cmbBedType().getValue()); if (form.cmbSideRoom()!=null) beds.setWardType(form.cmbSideRoom().getValue()); if (form.cmbHospital()!=null) beds.setHospital(form.cmbHospital().getValue()); return beds; }
private void refreshSearchCriteria() { AvailableBedsVo voFilter = form.getGlobalContext().STHK.getAvailableBedsListFilter(); if (voFilter != null) { form.cmbSideRoom().setValue(voFilter.getWardType()); form.cmbBedType().setValue(voFilter.getBedType()); form.cmbBedStatus().setValue(voFilter.getBedStatus()); form.cmbHospital().setValue(voFilter.getHospital()); form.qmbWard().setValue(null); for(int i = 0 ; voFilter.getWardIsNotNull() && i < form.qmbWard().getValues().size() ; i++) { LocationLiteVo voWard = (LocationLiteVo)form.qmbWard().getValues().get(i); if (voWard.getID_Location().equals(voFilter.getWard().getID_Location())) form.qmbWard().setValue((LocationLiteVo)form.qmbWard().getValues().get(i)); } if ( form.qmbWard().getValue() == null&& voFilter.getWardIsNotNull()) { form.qmbWard().newRow(voFilter.getWard(), voFilter.getWard().getName()); form.qmbWard().setValue(voFilter.getWard()); } search(); } }
private void search() { AvailableBedsVo beds = populateDataFromScreen(); form.getGlobalContext().STHK.setAvailableBedsListFilter(beds); form.getContextMenus().hideAllGenericGridMenuItems(); form.grdAvailableBeds().getRows().clear(); form.lbl6().setValue("Total: 0"); // WDEV-18099 BedSpaceStateLiteVoCollection availableBeds = null; form.getLocalContext().setSortOrderBedNo(null); if (beds.countFieldsWithValue() > 0) { availableBeds = domain.listAvailableBeds(beds); } else { engine.showMessage("Please enter some valid search criteria.", "Invalid search criteria", MessageButtons.OK, MessageIcon.ERROR); return; } if (availableBeds == null || availableBeds.size() == 0) { engine.showMessage("No bed records match your search criteria.", "No data found", MessageButtons.OK, MessageIcon.WARNING); return; } if (availableBeds != null) form.lbl6().setValue("Total: " + String.valueOf(availableBeds.size())); if (availableBeds.size() >1) { form.getLocalContext().setSortOrderBedNo(SortOrder.ASCENDING); availableBeds.sort(BedSpaceStateLiteVo.getBedNumberComparator(form.getLocalContext().getSortOrderBedNo())); } populateGrid(availableBeds); }