예제 #1
0
  /** Descripción de Método */
  private void actionOK() {
    if (fCreateNew.isSelected()) {

      // Get Warehouse Info

      KeyNamePair pp = (KeyNamePair) fWarehouse.getSelectedItem();

      if (pp != null) {
        getWarehouseInfo(pp.getKey());
      }

      // Check mandatory values

      String mandatoryFields = "";

      if (m_M_Warehouse_ID == 0) {
        mandatoryFields += lWarehouse.getText() + " - ";
      }

      if (fValue.getText().length() == 0) {
        mandatoryFields += lValue.getText() + " - ";
      }

      if (fX.getText().length() == 0) {
        mandatoryFields += lX.getText() + " - ";
      }

      if (fY.getText().length() == 0) {
        mandatoryFields += lY.getText() + " - ";
      }

      if (fZ.getText().length() == 0) {
        mandatoryFields += lZ.getText() + " - ";
      }

      if (mandatoryFields.length() != 0) {
        ADialog.error(
            m_WindowNo,
            this,
            "FillMandatory",
            mandatoryFields.substring(0, mandatoryFields.length() - 3));

        return;
      }

      MLocator loc =
          MLocator.get(
              Env.getCtx(),
              m_M_Warehouse_ID,
              fValue.getText(),
              fX.getText(),
              fY.getText(),
              fZ.getText());

      m_M_Locator_ID = loc.getM_Locator_ID();
      fLocator.addItem(loc);
      fLocator.setSelectedItem(loc);
    } // createNew

    //

    log.config("M_Locator_ID=" + m_M_Locator_ID);
  } // actionOK