protected void onGrdEquipmentSelectionChanged() throws PresentationLogicException { if(form.grdEquipment().getValue() instanceof EquipmentVo) { form.getLocalContext().setVoEquipment(domain.getEquipment(form.grdEquipment().getValue())); clearScreen();// WDEV881 populateEquipmentDetails(form.getLocalContext().getVoEquipment()); } updateControlsState(); }
private void populateEquipmentDetails(EquipmentVo vo) { if (vo != null) { if (vo.getAuthoringInformationIsNotNull()) form.ctnDetails().customControlAuthoringInfo().setValue(vo.getAuthoringInformation()); if (vo.getType() != null) { form.ctnDetails().cmbEquipment1().setValue(vo.getType().getParent()); try { onCmbEquipment1ValueChanged(); } catch (PresentationLogicException e) {} form.ctnDetails().cmbEquipment2().setValue(vo.getType()); } if (vo.getSupplier() != null) form.ctnDetails().cmbSupplier().setValue(vo.getSupplier()); if (vo.getDateRequired() != null) form.ctnDetails().dteRequired().setValue(vo.getDateRequired()); if (vo.getDateSupplied() != null) form.ctnDetails().dteSupplied().setValue(vo.getDateSupplied()); if (vo.getSuppliedFor() != null) form.ctnDetails().cmbSuppliedFor().setValue(vo.getSuppliedFor()); if (vo.getLoan() != null) form.ctnDetails().cmbLoan().setValue(vo.getLoan()); if (vo.getFundedBy() != null) form.ctnDetails().cmbFunded().setValue(vo.getFundedBy()); } }
public EquipmentVo saveEquipmentDetails(EquipmentVo equipment) throws DomainInterfaceException, StaleObjectException { if (!equipment.isValidated()) { throw new DomainRuntimeException("Equipment has not been validated"); } DomainFactory factory = getDomainFactory(); Equipment doEquipment = EquipmentVoAssembler.extractEquipment(factory, equipment); factory.save(doEquipment); return EquipmentVoAssembler.create(doEquipment); }
public EquipmentVo getEquipment(EquipmentRefVo equipmentId) { if(equipmentId == null || !equipmentId.getID_EquipmentIsNotNull()) throw new CodingRuntimeException("Can not get Equipment on null Id."); return EquipmentVoAssembler.create((Equipment) getDomainFactory().getDomainObject(Equipment.class, equipmentId.getID_Equipment())); }