Package com.commander4j.db

Examples of com.commander4j.db.JDBQuery2


    typeList.addAll(t.getMaterialTypes());

    initGUI();

    ////////
    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID,Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}VIEW_PALLET_EXPIRY WHERE 1=2");
    q2.applyRestriction(false, 0);
    q2.applySort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    q2.applySQL();
    listStatement = q2.getPreparedStatement();
    ////////
   
    populateList();

    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
View Full Code Here


  }

  private PreparedStatement buildSQLr() {
       
    PreparedStatement result;
    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID,Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}APP_LOCATION");
    q2.applyWhere("location_id=", jTextFieldLocationID.getText());;
    q2.applyWhere("plant=", jTextFieldPlant.getText());
    q2.applyWhere("warehouse=", jTextFieldWarehouse.getText());
    if (jTextFieldDescription.getText().equals("") == false)
    {
      q2.applyWhere("upper(description) LIKE ", "%" + jTextFieldDescription.getText().toUpperCase() + "%");
    }
    q2.applyWhere("storage_location=", jTextFieldStorageLocation.getText());
    q2.applyWhere("storage_type=", jTextFieldStorageType.getText());
    q2.applyWhere("storage_section=", jTextFieldStorageSection.getText());
    q2.applyWhere("storage_bin=", jTextFieldStorageBin.getText());
    q2.applyWhere("gln=", jTextFieldGLN.getText());
   
    q2.applySort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    q2.applyRestriction(false, 0);
    q2.applySQL();
    result = q2.getPreparedStatement();
   
    return result;
 
View Full Code Here

    initGUI();
   
   
    ////////
    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID,Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}APP_LOCATION WHERE 1=2");
    q2.applyRestriction(false, 0);
    q2.applySort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    q2.applySQL();
    listStatement = q2.getPreparedStatement();
    ////////
   
    populateList();

    final JHelp help = new JHelp();
View Full Code Here

 
  private void buildSQL() {
   
    JDBQuery2.closeStatement(listStatement);

    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID, Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}VIEW_PALLET_HISTORY_EXPIRY");

    if (jCheckBoxTransactionDate.isSelected())
    {
      q2.applyWhere("transaction_date>=", JUtility.getTimestampFromDate(transactionDateFrom.getDate()));
      q2.applyWhere("transaction_date<=", JUtility.getTimestampFromDate(transactionDateTo.getDate()));
    }


    if (jTextFieldTransaction_Ref.getText().equals("") == false)
    {
      q2.applyWhere("transaction_ref = ", jTextFieldTransaction_Ref.getText());
    }

    if (jTextFieldSSCC.getText().equals("") == false)
    {
      q2.applyWhere("sscc = ", jTextFieldSSCC.getText());
    }

    if (jTextFieldMaterial.getText().equals("") == false)
    {
      q2.applyWhere("material = ", jTextFieldMaterial.getText());
    }

    if (jTextFieldBatch.getText().equals("") == false)
    {
      q2.applyWhere("batch_number like ", jTextFieldBatch.getText());
    }

    if (jTextFieldProcessOrder.getText().equals("") == false)
    {
      q2.applyWhere("process_order = ", jTextFieldProcessOrder.getText());
    }

    if (jTextFieldLocation.getText().equals("") == false)
    {
      q2.applyWhere("location_id = ", jTextFieldLocation.getText());
    }

    if (jTextFieldUser.getText().equals("") == false)
    {
      q2.applyWhere("user_id = ", jTextFieldUser.getText());
    }

    if (jTextFieldEAN.getText().equals("") == false)
    {
      q2.applyWhere("EAN = ", jTextFieldEAN.getText());
    }

    if (jTextFieldDespatch_No.getText().equals("") == false)
    {
      q2.applyWhere("DESPATCH_NO = ", jTextFieldDespatch_No.getText());
    }

    if (jTextFieldVariant.getText().equals("") == false)
    {
      q2.applyWhere("variant = ", jTextFieldVariant.getText());
    }

    q2.applyWhere("transaction_type=", (String) comboBoxTransactionType.getSelectedItem());

    q2.applyWhere("transaction_subtype=", (String) comboBoxTransactionSubtype.getSelectedItem());

    q2.applyWhere("uom=", ((JDBUom) jComboBoxUOM.getSelectedItem()).getInternalUom());

    q2.applyWhere("status=", ((String) jComboBoxPalletStatus.getSelectedItem()).toString());

    if (jCheckBoxQuantity.isSelected())
    {
      if (jFormattedTextFieldQuantity.getText().equals("") == false)
      {
        q2.applyWhere("quantity=",JUtility.stringToBigDecimal(jFormattedTextFieldQuantity.getText().toString()));
      }
    }

    Integer i;

    try
    {
      i = Integer.valueOf(jFormattedTextFieldQuantity.getText());
      q2.applyWhere("quantity=", i);
    }
    catch (Exception e)
    {
    }

    q2.applySort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    q2.applyRestriction(jCheckBoxLimit.isSelected(), jSpinnerLimit.getValue());
    q2.applySQL();
    listStatement = q2.getPreparedStatement();
  }
View Full Code Here

    expiryMode = ctrl.getKeyValue("EXPIRY DATE MODE");

    initGUI();

    ////////
    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID,Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}VIEW_PALLET_HISTORY_EXPIRY WHERE 1=2");
    q2.applyRestriction(false, 0);
    q2.applySort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    q2.applySQL();
    listStatement = q2.getPreparedStatement();
    ////////
   
    populateList();

    final JHelp help = new JHelp();
View Full Code Here

  }

  private PreparedStatement buildSQLr() {
   
    PreparedStatement result;
    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID,Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}VIEW_PALLET_HISTORY_EXPIRY");
   

    if (jCheckBoxTransactionDate.isSelected())
    {
      q2.applyWhere("transaction_date>=", JUtility.getTimestampFromDate(transactionDateFrom.getDate()));
      q2.applyWhere("transaction_date<=", JUtility.getTimestampFromDate(transactionDateTo.getDate()));
    }


    if (jTextFieldTransaction_Ref.getText().equals("") == false)
    {
      q2.applyWhere("transaction_ref = ", jTextFieldTransaction_Ref.getText());
    }

    if (jTextFieldSSCC.getText().equals("") == false)
    {
      q2.applyWhere("sscc = ", jTextFieldSSCC.getText());
    }

    if (jTextFieldMaterial.getText().equals("") == false)
    {
      q2.applyWhere("material = ", jTextFieldMaterial.getText());
    }

    if (jTextFieldBatch.getText().equals("") == false)
    {
      q2.applyWhere("batch_number like ", jTextFieldBatch.getText());
    }

    if (jTextFieldProcessOrder.getText().equals("") == false)
    {
      q2.applyWhere("process_order = ", jTextFieldProcessOrder.getText());
    }

    if (jTextFieldLocation.getText().equals("") == false)
    {
      q2.applyWhere("location_id = ", jTextFieldLocation.getText());
    }

    if (jTextFieldUser.getText().equals("") == false)
    {
      q2.applyWhere("user_id = ", jTextFieldUser.getText());
    }

    if (jTextFieldEAN.getText().equals("") == false)
    {
      q2.applyWhere("EAN = ", jTextFieldEAN.getText());
    }

    if (jTextFieldDespatch_No.getText().equals("") == false)
    {
      q2.applyWhere("DESPATCH_NO = ", jTextFieldDespatch_No.getText());
    }

    if (jTextFieldVariant.getText().equals("") == false)
    {
      q2.applyWhere("variant = ", jTextFieldVariant.getText());
    }

    q2.applyWhere("transaction_type=", (String) comboBoxTransactionType.getSelectedItem());

    q2.applyWhere("transaction_subtype=", (String) comboBoxTransactionSubtype.getSelectedItem());

    q2.applyWhere("uom=", ((JDBUom) jComboBoxUOM.getSelectedItem()).getInternalUom());

    q2.applyWhere("status=", ((String) jComboBoxPalletStatus.getSelectedItem()).toString());

    if (jCheckBoxQuantity.isSelected())
    {
      if (jFormattedTextFieldQuantity.getText().equals("") == false)
      {
        q2.applyWhere("quantity=",JUtility.stringToBigDecimal(jFormattedTextFieldQuantity.getText().toString()));
      }
    }

    Integer i;

    try
    {
      i = Integer.valueOf(jFormattedTextFieldQuantity.getText());
      q2.applyWhere("quantity=", i);
    }
    catch (Exception e)
    {
    }

    q2.applySort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    q2.applyRestriction(jCheckBoxLimit.isSelected(), jSpinnerLimit.getValue());
    q2.applySQL();
   
    result = q2.getPreparedStatement();
   
    return result;
  }
View Full Code Here

  }

  private PreparedStatement buildSQLr() {
   
    PreparedStatement result;
    JDBQuery2 q2 = new JDBQuery2(Common.selectedHostID,Common.sessionID);
    q2.applyWhat("*");
    q2.applyFrom("{schema}APP_LABEL_DATA");
    q2.applyWhere("LINE=", selectedLine);
    q2.applyWhere("LABEL_TYPE=", selectedGroup);
    q2.applySort("PRINT_DATE", true);
    q2.applyRestriction(true, 50);
    q2.applySQL();
    result = q2.getPreparedStatement();
   
    return result;
 
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBQuery2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.