private DynamicGridRow getRowByValue(LocSvcProviderSysLiteVo providerService) { if(providerService == null) return null; for(int i=0; i<form.dyngrdPrint().getRows().size(); i++) { DynamicGridRow row = form.dyngrdPrint().getRows().get(i); if(providerService.equals(row.getValue())) return row; } return null; }
@SuppressWarnings("rawtypes") public LocSvcProviderSysLiteVo getProviderServiceForOrderInv(OrderInvestigationRefVo orderInv) { if(orderInv == null || orderInv.getID_OrderInvestigation() == null) throw new CodingRuntimeException("orderInv parameter is null in method getProviderServiceForOrderInv"); DomainFactory factory = getDomainFactory(); String hql = "select inv.providerService from OrderInvestigation as orderInv left join orderInv.investigation as inv left join inv.providerService as provSer where orderInv.id = :idOrderInv"; List providers = factory.find(hql,new String[] {"idOrderInv"},new Object[] {orderInv.getID_OrderInvestigation()}); if(providers != null && providers.size() == 1) return LocSvcProviderSysLiteVoAssembler.create((LocSvcProviderSys) providers.get(0)); return null; }
private void addOrCreateProviderServiceRow(OrderInvestigationListVo voInvestigation) { boolean bNewParentRow = false; DynamicGridRow parRow = getRowByValue(voInvestigation.getInvestigation().getProviderService()); if(parRow == null) { bNewParentRow = true; parRow = form.dyngrdPrint().getRows().newRow(); parRow.setSelectable(false); } DynamicGridCell cell = null; LocSvcProviderSysLiteVo provider = voInvestigation!=null && voInvestigation.getInvestigation()!=null && voInvestigation.getInvestigation().getProviderService()!=null ?voInvestigation.getInvestigation().getProviderService():null; if(provider != null) { cell = parRow.getCells().newCell(getColumn(COL_INVESTIGATION), DynamicCellType.STRING); cell.setReadOnly(true); cell.setValue(voInvestigation!=null && voInvestigation.getInvestigation()!=null && voInvestigation.getInvestigation().getProviderService()!=null && voInvestigation.getInvestigation().getProviderService().getLocationService()!=null && voInvestigation.getInvestigation().getProviderService().getLocationService().getServiceIsNotNull() && voInvestigation.getInvestigation().getProviderService().getLocationService().getService().getServiceNameIsNotNull()? "Provider service: " + voInvestigation.getInvestigation().getProviderService().getLocationService().getService().getServiceName():null);//WDEV-16361); parRow.setTextColor(ims.framework.utils.Color.Green); parRow.setValue(provider); } if(bNewParentRow) { cell = parRow.getCells().newCell(getColumn(COL_PRINTER), DynamicCellType.ENUMERATION); populateLocalPrinters(cell); } DynamicGridRow childRoW = null; if(provider != null) { childRoW = parRow.getRows().newRow(); childRoW.setSelectable(false); } else { childRoW = parRow; } cell = childRoW.getCells().newCell(getColumn(COL_INVESTIGATION), DynamicCellType.STRING); cell.setValue(voInvestigation.getInvestigation().getInvestigationIndex().getName()); cell.setTooltip(voInvestigation.getInvestigation().getInvestigationIndex().getName()); cell.setReadOnly(true); cell = childRoW.getCells().newCell(getColumn(COL_PREVIEW), DynamicCellType.IMAGEBUTTON); cell.setValue(form.getImages().Core.ZoomInEnabled16); cell.setAutoPostBack(true); childRoW.setValue(voInvestigation); if(provider != null) { parRow.setExpanded(true); } }