예제 #1
0
  @Override
  public DDbDpsSigning getRegistry() throws Exception {
    DDbDpsSigning registry = moRegistry.createDpsSigning();

    if (registry.isRegistryNew()) {}

    registry.setSeries(moTextSeries.getValue());
    registry.setNumber(moIntNumber.getValue());
    // registry.setOrder(?);
    registry.setDate(moDateDate.getValue());
    // registry.setDeleted(?);
    registry.setFkEmissionTypeId(moKeyEmissionType.getValue()[0]);
    // registry.setFkDpsCategoryId(?);
    // registry.setFkDpsClassId(?);
    // registry.setFkDpsTypeId(?);

    return registry;
  }
예제 #2
0
  @Override
  public void setRegistry(DDbRegistry registry) throws Exception {
    moRegistry = (DDbDps) registry;

    mnFormResult = DLibConsts.UNDEFINED;
    mbFirstActivation = true;

    // Set registry:

    removeAllListeners();
    reloadCatalogues();

    if (moRegistry.isRegistryNew()) {
      throw new Exception(DGuiConsts.ERR_MSG_FORM_EXIST_REG);
    } else {
      jtfRegistryKey.setText("");
    }

    setFormEditable(true); // enable all controls before setting form values

    mtOriginalDate = moRegistry.getDate();
    mnOriginalYear = DLibTimeUtils.digestYear(mtOriginalDate)[0];

    moTextSeries.setValue(moRegistry.getSeries());
    moIntNumber.setValue(moRegistry.getNumber());
    moDateDate.setValue(mtOriginalDate);
    moKeyEmissionType.setValue(new int[] {moRegistry.getFkEmissionTypeId()});

    jtfDocType.setText(
        (String)
            miClient
                .getSession()
                .readField(
                    DModConsts.TS_DPS_TP, moRegistry.getDpsTypeKey(), DDbRegistry.FIELD_NAME));
    jtfDocType.setCaretPosition(0);

    moPanelDps.setValue(DModSysConsts.PARAM_YEAR, mnOriginalYear);
    moPanelDps.setRegistry(moRegistry);

    moTextSeries.setEditable(false);
    moDateDate.setEditable(false);

    addAllListeners();
  }