@Override public GpLiteWithNameVo getGpByTaxonomyCode(String code, TaxonomyType type) { String hql = "select g1 from Gp as g1 left join g1.codeMappings as t1 left join t1.taxonomyName as l1\r\n" + "where t1.taxonomyCode = :taxonomyCode and l1.id = :type order by g1.id"; List<?> list = getDomainFactory().find(hql, new String[] {"taxonomyCode", "type"}, new Object[] {code, type.getID()}); if(list != null && list.size() > 0) return GpLiteWithNameVoAssembler.create((Gp) list.get(0)); return null; }
private void verifyGpCotract(GpLiteWithNameVo registeredGP, Date dateRegistered) { if(registeredGP == null || dateRegistered == null) return; GpContractVo gpContract = domain.getGPContract(registeredGP, dateRegistered); if(gpContract == null) { engine.showMessage("The registered GP does not have a valid contract on " + dateRegistered); } }
public void open() throws ims.framework.exceptions.PresentationLogicException { if(form.qmbGPSearch().getValue() instanceof GpLiteWithNameVo || (form.txtContractIDSearch().getValue() != null && form.txtContractIDSearch().getValue().length() > 0)) { search(); } else { populateScreenFromData(null); form.getLocalContext().setlastRecord(null); } form.setMode(FormMode.VIEW); }
public void newInstance() throws ims.framework.exceptions.PresentationLogicException { form.getLocalContext().setlastRecord(new GpContractVo()); form.grdResultGrid().setValue(null); populateScreenFromData(null); if(form.qmbGPSearch().getValue() instanceof GpLiteWithNameVo) { form.ctnContractDetails().qmbGPSelected().newRow(form.qmbGPSearch().getValue(), form.qmbGPSearch().getValue().getName() == null ? null : form.qmbGPSearch().getValue().getName().toShortForm()); form.ctnContractDetails().qmbGPSelected().setValue(form.qmbGPSearch().getValue()); } form.setMode(FormMode.EDIT); }
protected ims.pci.vo.GpContractVo populateDataFromScreen(ims.pci.vo.GpContractVo gpContract) { gpContract = super.populateDataFromScreen(gpContract); if(form.ctnContractDetails().qmbGPSelected().getValue() instanceof GpLiteWithNameVo)//form.getLocalContext().getgpSelectedIsNotNull()) { gpContract.setGP(form.ctnContractDetails().qmbGPSelected().getValue()); } return gpContract; }
public GpLiteWithNameVo getGP(Integer id) { DomainFactory factory = getDomainFactory(); Gp doGP = (Gp) factory.getDomainObject(Gp.class, id); return GpLiteWithNameVoAssembler.create(doGP); }
public void search() { GpContractVoCollection listGpContracts = null; form.grdResultGrid().getRows().clear(); populateScreenFromData(null); //search by contractID if(form.txtContractIDSearch().getValue() != null && form.txtContractIDSearch().getValue().length() > 0) { form.qmbGPSearch().setValue(null); try { listGpContracts = domain.listGPContractsById(form.txtContractIDSearch().getValue()); } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); return; } } //search by GP name else if(form.qmbGPSearch().getValue() instanceof GpLiteWithNameVo) { listGpContracts = domain.listGpContract(form.qmbGPSearch().getValue()); } if(listGpContracts !=null && listGpContracts.size() > 0) { listGpContracts = sortGPContracts(listGpContracts); populateGrid(listGpContracts); if(form.grdResultGrid().getValue() != null) { populateScreenFromData(domain.getGpContract(form.grdResultGrid().getValue())); } } if(form.qmbGPSearch().getValue() instanceof GpLiteWithNameVo && form.ctnContractDetails().qmbGPSelected().getValue() instanceof GpLiteWithNameVo && !form.qmbGPSearch().getValue().equals(form.ctnContractDetails().qmbGPSelected().getValue())) { populateScreenFromData(null); form.getLocalContext().setlastRecord(null); } updateControlsState(); }
private void fillGPSearch(String value) { if (value == null || value.length() < 3) { engine.showMessage("Please enter at least 3 characters for search criteria"); return; } GpLiteWithNameVoCollection coll = null; try { coll = domain.listGP(value); } catch (DomainInterfaceException e) { e.printStackTrace(); } form.qmbGPSearch().setValue(null); form.qmbGPSearch().clear(); if(coll != null) { for(int i=0; i<coll.size(); i++) { GpLiteWithNameVo gp = coll.get(i); if(gp == null) continue; form.qmbGPSearch().newRow(gp, gp.getName() == null ? null : gp.getName().toString()); } } if (coll.size() == 1) { form.qmbGPSearch().setValue(coll.get(0)); } else if (coll.size() > 1) { form.qmbGPSearch().showOpened(); } }
private void fillGPSelected(String value) { if (value == null || value.length() < 3) { engine.showMessage("Please enter at least 3 characters for search criteria"); return; } GpLiteWithNameVoCollection coll = null; try { coll = domain.listGP(value); } catch (DomainInterfaceException e) { e.printStackTrace(); } form.ctnContractDetails().qmbGPSelected().setValue(null); form.ctnContractDetails().qmbGPSelected().clear(); if(coll != null) { for(int i=0; i<coll.size(); i++) { GpLiteWithNameVo gp = coll.get(i); if(gp == null) continue; form.ctnContractDetails().qmbGPSelected().newRow(gp, gp.getName() == null ? null : gp.getName().toString()); } } if (coll.size() == 1) { form.ctnContractDetails().qmbGPSelected().setValue(coll.get(0)); } else if (coll.size() > 1) { form.ctnContractDetails().qmbGPSelected().showOpened(); } }