Exemple #1
0
  private NAESReferralNoteVo populateDataFromScreen(NAESReferralNoteVo referralNote) {

    referralNote.setReferral(form.getGlobalContext().Naes.getReferral().toNAESReferralRefVo());
    referralNote.setRecordingDateTime(form.dtimRecDT().getValue());
    referralNote.setNote(form.txtNote().getValue());
    referralNote.setRecordingUser(form.qmbRecUser().getValue());
    return referralNote;
  }
Exemple #2
0
  protected void onBtnSaveClicked() throws ims.framework.exceptions.PresentationLogicException {

    NAESReferralNoteVo referralNote =
        populateDataFromScreen(form.getGlobalContext().Naes.getReferralNote());
    String[] errors = referralNote.validate();

    if (errors != null) {
      engine.showErrors(errors);
      return;
    }
    try {
      domain.save(referralNote);
    } catch (DomainInterfaceException e) {
      engine.showMessage(e.getMessage());
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
    } catch (ForeignKeyViolationException e) {
      engine.showMessage(e.getMessage());
    } catch (UniqueKeyViolationException e) {
      engine.showMessage(e.getMessage());
    }

    engine.close(DialogResult.OK);
  }
Exemple #3
0
  private void populateScreenFromData(NAESReferralNoteVo referralNote) {
    clear();

    if (referralNote.getRecordingDateTimeIsNotNull())
      form.dtimRecDT().setValue(referralNote.getRecordingDateTime());
    else form.dtimRecDT().setValue(new DateTime());

    if (referralNote.getNoteIsNotNull()) form.txtNote().setValue(referralNote.getNote());

    if (referralNote.getRecordingUserIsNotNull()) {
      form.qmbRecUser()
          .newRow(referralNote.getRecordingUser(), referralNote.getRecordingUser().getIMosName());
      form.qmbRecUser().setValue(referralNote.getRecordingUser());
    } else {
      MemberOfStaffLiteVo loggedUser = (MemberOfStaffLiteVo) domain.getMosUser();
      if (loggedUser != null) {
        form.qmbRecUser().newRow(loggedUser, loggedUser.getIMosName());
        form.qmbRecUser().setValue(loggedUser);
      }
    }
  }