コード例 #1
0
  public boolean checkFields() throws FieldValueException {
    FieldsChecking.checkAllRequiredFields(this);

    Date validFrom = validFromField.getDate();

    Date validTo = validToField.getDateAcceptEmpty();
    if (validTo != null) {
      if (validFrom.after(validTo)) {
        throw new FieldValueException(
            "<USER>'Valid From' should not be later than 'Valid To'</USER>");
      }
    }

    FacilityValue seaport = (FacilityValue) seaportCombo.getSelectedItem();

    Seaport2FixpointValue seaport2Fixpoint = (Seaport2FixpointValue) getModel();
    seaport2Fixpoint.setSeaportId(seaport.getId().longValue());
    seaport2Fixpoint.setValidityStart(validFrom);
    seaport2Fixpoint.setValidityEnd(validTo);

    Object selectedFixpoint = fixpointCombo.getSelectedItem();
    if (selectedFixpoint instanceof FacilityValue) {
      FacilityValue fixpoint = (FacilityValue) selectedFixpoint;
      seaport2Fixpoint.setFixpointId(fixpoint.getId());
      seaport2Fixpoint.setActive(true);
    } else {
      seaport2Fixpoint.setFixpointId(null);
      seaport2Fixpoint.setActive(false);
    }

    // Nicht verwendet.
    return true;
  }
コード例 #2
0
  public boolean checkFields() throws FieldValueException {
    log.debug("CheckFields start...");
    boolean retval = true;
    FieldsChecking.checkAllRequiredFields(this);
    checkDates();
    ((BargeTariffValue) getModel()).setIsImport(importCheckBox.isSelected());
    ((BargeTariffValue) getModel())
        .setCurrencyId(((CurrencyValue) currency.getSelectedItem()).getId().longValue());
    // ((BargeTariffValue) getModel()).setCurrencyName(((CurrencyValue)
    // currency.getSelectedItem()).getName());

    // VERSION_TOGGLE Tariff.2ExtraSurcharges Start ----------
    if (ResourceUtil.getBoolean("Tariff.2ExtraSurcharges")) {
      surchargesPanel.checkFields();
    }
    // VERSION_TOGGLE Tariff.2ExtraSurcharges End ----------

    log.debug("CheckFields end ... " + ((BargeTariffValue) getModel()));
    return retval;
  }