Exemplo n.º 1
0
  public long pushBack() throws KExceptionClass {

    try {

      KBusinessObjectClass businessObject = pdcClassType.newInstance();

      KMetaUtilsClass.setProgressBarValue1(25);
      businessObject.materializeFromDisplay(
          visualWidgetContainer, nonVisibleWidgets, visualMappingMode);

      if (EventCallback != null) EventCallback.prePushBack(businessObject);

      KMetaUtilsClass.setProgressBarValue1(50);
      businessObject = persistentObjectManager.push_back4(businessObject);
      businessObjectOID = businessObject.getOID();

      KMetaUtilsClass.setProgressBarValue1(75);
      dialogMode = KDialogInterface.EDIT_MODE;

      if (EventCallback != null) EventCallback.postPushBack(businessObject);

      edit();

    } catch (Exception error) {

      throw new KExceptionClass("Could not create new object", error);
    }

    KMetaUtilsClass.setProgressBarValue1(100);

    return (businessObjectOID);
  }
Exemplo n.º 2
0
  public void update() throws KExceptionClass {

    try {

      KBusinessObjectClass businessObject = pdcClassType.newInstance();

      KMetaUtilsClass.setProgressBarValue1(33);
      businessObject.materializeFromDisplay(
          visualWidgetContainer, nonVisibleWidgets, visualMappingMode);

      if (EventCallback != null) EventCallback.preUpdate(businessObject);

      KMetaUtilsClass.setProgressBarValue1(75);
      businessObject = persistentObjectManager.update4(businessObjectOID, businessObject);

      if (EventCallback != null) EventCallback.postUpdate(businessObject);

      edit();

    } catch (Exception error) {

      throw new KExceptionClass("Could not create new object", error);
    }

    KMetaUtilsClass.setProgressBarValue1(100);
  }
Exemplo n.º 3
0
  public void newObject() throws KExceptionClass {
    try {

      if (EventCallback != null) EventCallback.preNewObject();

      KBusinessObjectClass businessObject = pdcClassType.newInstance();

      KMetaUtilsClass.setProgressBarValue1(25);
      businessObject = persistentObjectManager.createNew4(businessObject);

      // map foreing keys
      KMetaUtilsClass.setProgressBarValue1(50);
      if (buisnessObjectForeingOIDS != null) {
        Set listOfForeingKeys = buisnessObjectForeingOIDS.keySet();
        Iterator foreingKeyIterator = listOfForeingKeys.iterator();
        while (foreingKeyIterator.hasNext()) {
          String nextForeingKeyName = (String) foreingKeyIterator.next();
          businessObject.setField(
              nextForeingKeyName, buisnessObjectForeingOIDS.get(nextForeingKeyName));
        }
      }

      KMetaUtilsClass.setProgressBarValue1(75);
      businessObject.displayVisualize(visualWidgetContainer, nonVisibleWidgets, visualMappingMode);

      if (EventCallback != null) EventCallback.postNewObject(businessObject);

    } catch (Exception error) {
      throw new KExceptionClass("Could not create new object", error);
    }

    KMetaUtilsClass.setProgressBarValue1(100);
  }
Exemplo n.º 4
0
  /** Execute the query and get the results. */
  public void load(int startRow, int length) throws KExceptionClass {
    bindDBtransaction(
        dbTransactionClient,
        " SELECT " + selectSQL + " FROM " + tableName + finalWhere + finalOrder);

    // Query DB
    try {

      KMetaUtilsClass.cursorWait(parentWindow);
      KMetaUtilsClass.setProgressBarValue1(60);

      dbTransactionClient.executeQuery(startRow, length);

      KMetaUtilsClass.setProgressBarValue1(100);

    } finally {
      KMetaUtilsClass.cursorNormal(parentWindow);
    }

    if (!dbTransactionClient.columnNamesList.contains(keyField)) {
      throw new KExceptionClass(
          "*** Could not load data **** \n"
              + "Key field ["
              + keyField
              + "] was not found in result set",
          null);
    }

    firstLoadReady = true;

    log.log(this, "dbTransactionClient rowCount = " + dbTransactionClient.rowCount());
    log.log(this, "dbTransactionClient startRow = " + dbTransactionClient.resultSetStart());
  }
  private void applyButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_applyButtonActionPerformed

    try {

      KDialogController.OKbuttonActionPerformed();

    } catch (KExceptionClass error) {

      // log error
      log.log(this, KMetaUtilsClass.getStackTrace(error));

      // show error message
      KMetaUtilsClass.showErrorMessageFromException(getOwner(), error);
    }
  } // GEN-LAST:event_applyButtonActionPerformed
  private void applyButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_applyButtonActionPerformed

    try {
      LblAuditUser.setText(configuration.getField("system_user_name"));

      KDialogController.OKbuttonActionPerformed();

    } catch (KExceptionClass error) {

      // log error
      log.log(this, KMetaUtilsClass.getStackTrace(error));

      // show error message
      KMetaUtilsClass.showErrorMessageFromException(getOwner(), error);
    }
  } // GEN-LAST:event_applyButtonActionPerformed
Exemplo n.º 7
0
  public void OKbuttonActionPerformed() throws KExceptionClass {

    try {

      KMetaUtilsClass.cursorWait((JDialog) dialog);

      KMetaUtilsClass.setProgressBarValue1(25);
      dialog.saveBrowserChanges();

      if (dialogMode == KDialogInterface.CREATE_NEW_MODE) {

        KMetaUtilsClass.setProgressBarValue1(50);
        pushBack();

        KMetaUtilsClass.setProgressBarValue1(75);
        dialog.setupTables(businessObjectOID);

      } else if (dialogMode == KDialogInterface.EDIT_MODE) {

        KMetaUtilsClass.setProgressBarValue1(75);
        update();
      }

    } finally {

      KMetaUtilsClass.setProgressBarValue1(100);
      KMetaUtilsClass.cursorNormal((JDialog) dialog);
    }
  }
  private void jButton2ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton2ActionPerformed
    try {
      ThreadBrowserClass ThreadBrowser =
          new ThreadBrowserClass(configuration, log, new javax.swing.JTable(), this);

      ThreadBrowser.initializeTable();

      selectDialogClass selector =
          new selectDialogClass(configuration, log, this, ThreadBrowser, "Select Thread");

      // dont want to allow this, for example
      selector.getNewButton().setEnabled(false);
      selector.getDeleteButton().setEnabled(false);
      parentID = selector.showDialog();

      if (parentID < 0) {
        throw new KExceptionClass("You must select a Thread !", null);

      } else {

        LblThreadID.setText(Long.toString(parentID));

        persistentObjectManagerClass persistentObjectManager =
            new persistentObjectManagerClass(configuration, log);

        ThreadClass Thread = new ThreadClass();

        Thread = (ThreadClass) persistentObjectManager.copy4(parentID, ThreadClass.class);

        LblThreadName.setText(Thread.getThread());

        LblSize.setText(Thread.getUkuran());
        LblPart.setText(Thread.getPart());
      }

    } catch (Exception error) {
      log.log(this, KMetaUtilsClass.getStackTrace(error));
      KMetaUtilsClass.showErrorMessageFromException(this, error);
    }
  } // GEN-LAST:event_jButton2ActionPerformed
  private void okButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_okButtonActionPerformed

    // calculate
    // qtyneedLabel.setText(Long.toString( String.valueOf("s") ));
    // qtyneedLabel.setText((qtyLabel.getText() * compLabel.getText() * toleranceLabel.getText());

    try {
      LblAuditUser.setText(configuration.getField("system_user_name"));

      KDialogController.OKbuttonActionPerformed();

      setVisible(false);
      dispose();

    } catch (KExceptionClass error) {

      // log error
      log.log(this, KMetaUtilsClass.getStackTrace(error));

      // show error message
      KMetaUtilsClass.showErrorMessageFromException(getOwner(), error);
    }
  } // GEN-LAST:event_okButtonActionPerformed
Exemplo n.º 10
0
  /** Creates new form facturaEditDialogClass */
  public stocktypeEditDialogClass(
      KConfigurationClass configurationParam, KLogClass logParam, java.awt.Window parentWindow)
      throws KExceptionClass {

    super(parentWindow, java.awt.Dialog.ModalityType.DOCUMENT_MODAL);
    initComponents();
    pack();
    //        setSize( 630, 600 );
    KMetaUtilsClass.centerInScreen(this);

    // uses
    configuration = configurationParam;
    log = logParam;

    // has - defaulted
    KDialogController =
        new KDialogControllerClass(
            configuration, log, stocktypeClass.class, this, getContentPane());
  }