@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { if ( ! validateData()) return; ElectronicPrescribingConfigVo voEp = form.getGlobalContext().Admin.getElectronicPrescribingConfigVo(); voEp.setButtonText(form.txtButtonText().getValue()); voEp.setLabelText(form.txtLabelText().getValue()); voEp.setButtonExecutablePath(form.txtExePath().getValue().toLowerCase());//WDEV-14666 voEp.setButtonParameter(form.txtParameter().getValue()); form.getGlobalContext().Admin.setElectronicPrescribingConfigVo(voEp); engine.close(DialogResult.OK); }
@Override protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException { if (result.equals(DialogResult.OK) && formName.equals(form.getForms().Admin.ElectronicPrescribingConfigDialog)) { save(); } else if(formName.equals(form.getForms().Admin.RoleSelect) && result.equals(DialogResult.OK)) { AppRoleShortVoCollection voRoles = form.getGlobalContext().Admin.getSelectedRoles(); ((ElectronicPrescribingConfigVo)form.grdDetails().getValue()).setButtonDeniedRoleAccess(new AppRoleShortVoCollection()); for (int i = 0; voRoles != null && i < voRoles.size(); i++) { if(form.grdDetails().getValue() instanceof ElectronicPrescribingConfigVo) ((ElectronicPrescribingConfigVo)form.grdDetails().getValue()).getButtonDeniedRoleAccess().add(voRoles.get(i)); } form.getGlobalContext().Admin.setElectronicPrescribingConfigVo(((ElectronicPrescribingConfigVo)form.grdDetails().getValue())); save(); } open(); }
public void deleteElectronicPrescribingRecord(ElectronicPrescribingConfigVo voEP) throws StaleObjectException, ForeignKeyViolationException { if(voEP == null) throw new CodingRuntimeException("ElectronicPrescribingConfigVo is null"); if (!voEP.isValidated()) throw new DomainRuntimeException("ElectronicPrescribingConfigVo not validated"); DomainFactory factory = getDomainFactory(); ElectronicPrescribingConfig doEP = ElectronicPrescribingConfigVoAssembler.extractElectronicPrescribingConfig(factory, voEP); try { factory.delete(doEP); } catch (IllegalArgumentException e) { throw new StaleObjectException(doEP); } }
private void enableAndShowButton(boolean bEnable, boolean bVisible, Button button, Label label, ElectronicPrescribingConfigVo electronicPrescribingConfigVo) { button.setEnabled(bEnable); button.setVisible(bVisible); label.setVisible(bVisible); if (electronicPrescribingConfigVo != null) { button.setText(electronicPrescribingConfigVo.getButtonText()); label.setValue(electronicPrescribingConfigVo.getLabelText()); } }
private void denyConfig() { if (form.grdDetails().getValue() instanceof ElectronicPrescribingConfigVo) form.getGlobalContext().Admin.setSelectedRoles(((ElectronicPrescribingConfigVo)form.grdDetails().getValue()).getButtonDeniedRoleAccess()); engine.open(form.getForms().Admin.RoleSelect); }
private void editConfig() { if (form.grdDetails().getValue() instanceof ElectronicPrescribingButton) { ElectronicPrescribingConfigVo voElect = new ElectronicPrescribingConfigVo(); voElect.setButton((ElectronicPrescribingButton)form.grdDetails().getValue()); form.getGlobalContext().Admin.setElectronicPrescribingConfigVo(voElect); } else if (form.grdDetails().getValue() instanceof ElectronicPrescribingConfigVo) form.getGlobalContext().Admin.setElectronicPrescribingConfigVo((ElectronicPrescribingConfigVo)form.grdDetails().getValue()); engine.open(form.getForms().Admin.ElectronicPrescribingConfigDialog); }
private void updateContextMenu() { form.getContextMenus().Admin.hideAllElectronicPrescribingMenuMenuItems(); form.getContextMenus().Admin.getElectronicPrescribingMenuEditButtonConfigurationItem().setVisible(form.grdDetails().getValue() != null); form.getContextMenus().Admin.getElectronicPrescribingMenuRemoveButtonConfigurationItem().setVisible(form.grdDetails().getValue() != null && form.grdDetails().getValue() instanceof ElectronicPrescribingConfigVo); form.getContextMenus().Admin.getElectronicPrescribingMenuDenyRoleAccessItem().setVisible(form.grdDetails().getValue() != null && form.grdDetails().getValue() instanceof ElectronicPrescribingConfigVo); }