protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException { ServiceVoLiteVoCollection tempColl = new ServiceVoLiteVoCollection(); for(int i = 0;i < form.grdSelectedServices().getRows().size();i++) { if(form.grdSelectedServices().getRows().get(i).getColumnSelect()) tempColl.add(form.grdSelectedServices().getRows().get(i).getValue()); } if(tempColl.size() < 1) { engine.showMessage("Select at least one Service"); return; } form.getGlobalContext().RefMan.setServiceContrat(tempColl); engine.close(DialogResult.OK); }
private void populateSearchServiceGrid(ServiceVoLiteVoCollection serviceColl) { form.grdSearchService().getRows().clear(); if(serviceColl == null || serviceColl.size() < 1) return; for(int i = 0; i < serviceColl.size();i++) { ServiceVoLiteVo record = serviceColl.get(i); if (record == null) continue; grdSearchServiceRow newRow = form.grdSearchService().getRows().newRow(); newRow.setColumnServiceName(record.getServiceName()); newRow.setColumnSelect(Boolean.FALSE); newRow.setValue(record); } }
private void populateSelectedServiceGrid(ServiceVoLiteVoCollection serviceColl) { if(serviceColl == null || serviceColl.size() < 1) return; for(int i = 0; i < serviceColl.size();i++) { ServiceVoLiteVo record = serviceColl.get(i); if (record == null) continue; grdSelectedServicesRow newRow = form.grdSelectedServices().getRows().newRow(); newRow.setColumnServiceName(record.getServiceName()); newRow.setColumnSelect(Boolean.TRUE); newRow.setValue(record); } }
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException { ServiceVoLiteVoCollection tempColl = new ServiceVoLiteVoCollection(); for(int i = 0;i < form.grdSelectedServices().getRows().size();i++) { if(form.grdSelectedServices().getRows().get(i).getColumnSelect()) tempColl.add(form.grdSelectedServices().getRows().get(i).getValue()); } if(tempColl.size() < 1) { engine.showMessage("Select at least one Service"); return; } form.getGlobalContext().CareUk.setServiceContrat(tempColl); engine.close(DialogResult.OK); }
protected void onBtnAddToListClick() throws ims.framework.exceptions.PresentationLogicException { ServiceVoLiteVoCollection voColl = new ServiceVoLiteVoCollection(); boolean deleted = true; while(deleted) { deleted = false; for (int i = 0; i < form.grdSearchService().getRows().size(); i++) { if(form.grdSearchService().getRows().get(i) == null) continue; if (form.grdSearchService().getRows().get(i).getColumnSelect()) { if(checkIfServiceIsInServiceSelectedGrid(form.grdSearchService().getRows().get(i).getValue())) { engine.showMessage("The Service "+ form.grdSearchService().getRows().get(i).getValue().getServiceName()+ " is already in Selected Services Grid"); return; } voColl.add(form.grdSearchService().getRows().get(i).getValue()); form.grdSearchService().getRows().remove(i); deleted = true; break; } } } if(voColl == null || voColl.size() == 0) { engine.showMessage("Select at least one Service"); return; } populateSelectedServiceGrid(voColl); }
protected void onBtnSearchClick() throws ims.framework.exceptions.PresentationLogicException { form.grdSearchService().getRows().clear(); if(form.txtServiceName().getValue() == null || form.txtServiceName().getValue().length() == 0 || checkCharacter(form.txtServiceName().getValue())) { engine.showMessage("Please enter a Service Name search string"); return; } ServiceVoLiteVoCollection serviceColl = domain.getServices(form.txtServiceName().getValue().trim(), form.cmbServiceCategory().getValue()); populateSearchServiceGrid(serviceColl); }
void populateParentsTree(ServiceVoLiteVoCollection services) { if(services == null) return; for(int i = 0; i < services.size();i++ ) { if(checkIfParentAlreadyExistsinTree(services.get(i))) continue; ContractServiceLocationsConfigVo tempContractVo = new ContractServiceLocationsConfigVo(); ServiceVoLiteVo temVo = services.get(i); tempContractVo.setService(temVo); tempContractVo.setLocation(null); //tempContractVo.setIsActive(Boolean.TRUE); ContractServiceLocationsConfigVoCollection tempColl = form.getLocalContext().getServiceAndLocation(); if(tempColl == null) tempColl = new ContractServiceLocationsConfigVoCollection(); tempColl.add(tempContractVo); form.getLocalContext().setServiceAndLocation(tempColl); form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getNodes().add(temVo, temVo.getServiceName()); //form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().setValue(temVo); form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().setEnabled(true); } }
private void displayTree() { ServiceVoLiteVoCollection serviceCol = new ServiceVoLiteVoCollection(); ContractServiceLocationsConfigVoCollection servicelocationVoCol = form.getLocalContext().getServiceAndLocation(); form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().clear(); if(servicelocationVoCol == null || servicelocationVoCol.size() == 0) return; for(int i = 0; i < servicelocationVoCol.size();i++) { if(checkSerices(servicelocationVoCol.get(i).getService(),serviceCol)) //check if service was added in tree continue; else { serviceCol.add(servicelocationVoCol.get(i).getService()); ims.framework.controls.TreeNode nodeparent = form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getNodes().add(servicelocationVoCol.get(i).getService(), servicelocationVoCol.get(i).getService().getServiceName()); for(int j = 0; j < servicelocationVoCol.size();j++) { if(servicelocationVoCol.get(i).getServiceIsNotNull() && servicelocationVoCol.get(j).getServiceIsNotNull()) { if(servicelocationVoCol.get(i).getService().getID_Service().equals(servicelocationVoCol.get(j).getService().getID_Service())) { if(servicelocationVoCol.get(j).getLocationIsNotNull()) { nodeparent.getNodes().add(servicelocationVoCol.get(j).getLocation(), servicelocationVoCol.get(j).getLocation().getName()); } } } } } } form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().expandAll(); }
private boolean checkSerices(ServiceVoLiteVo service, ServiceVoLiteVoCollection servicecol) { if (service == null) // WDEV-13720 - Check for null services return true; if(servicecol == null || servicecol.size() == 0 ) return false; for(int i = 0; i < servicecol.size();i++) { if(service.getID_Service().equals(servicecol.get(i).getID_Service())) return true; } return false; }