Exemplo n.º 1
0
  @Override
  public void setRegistry(erp.lib.data.SDataRegistry registry) {
    moExchangeRate = (SDataExchangeRate) registry;

    moFieldPkCurrencyId.setFieldValue(new int[] {moExchangeRate.getPkCurrencyId()});
    moFieldPkDateId.setFieldValue(moExchangeRate.getPkDateId());
    moFieldExchangeRate.setFieldValue(moExchangeRate.getExchangeRate());
    moFieldIsDeleted.setFieldValue(moExchangeRate.getIsDeleted());

    jcbPkCurrencyId.setEnabled(false);
    jbPkCurrencyId.setEnabled(false);

    jftPkDateId.setEnabled(false);
    jbPkDateId.setEnabled(false);
    jckIsDeleted.setEnabled(true);
  }
Exemplo n.º 2
0
  @Override
  public erp.lib.data.SDataRegistry getRegistry() {
    if (moExchangeRate == null) {
      moExchangeRate = new SDataExchangeRate();
      moExchangeRate.setPkCurrencyId(moFieldPkCurrencyId.getKeyAsIntArray()[0]);
      moExchangeRate.setPkDateId(moFieldPkDateId.getDate());
      moExchangeRate.setFkUserNewId(miClient.getSession().getUser().getPkUserId());
    } else {
      moExchangeRate.setFkUserEditId(miClient.getSession().getUser().getPkUserId());
    }

    moExchangeRate.setExchangeRate(moFieldExchangeRate.getDouble());
    moExchangeRate.setIsDeleted(moFieldIsDeleted.getBoolean());

    return moExchangeRate;
  }