Package com.commander4j.db

Examples of com.commander4j.db.JDBLocation


          llocation = JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Material_Location_Input"));
          if (llocation != null)
          {
            if (llocation.equals("") == false)
            {
              JDBLocation locn = new JDBLocation(Common.selectedHostID, Common.sessionID);
              if (locn.isValidLocation(llocation))
              {
                JDBMaterialLocation matloc = new JDBMaterialLocation(Common.selectedHostID, Common.sessionID);
                if (matloc.isValidMaterialLocation(lmaterial, llocation) == false)
                {
                  JLaunchMenu.runForm("FRM_ADMIN_MATERIAL_LOCATION_EDIT", lmaterial, llocation);
View Full Code Here


    buildSQL();
    populateList();
  }

  private void addRecord() {
    JDBLocation l = new JDBLocation(Common.selectedHostID, Common.sessionID);
    llocation = JOptionPane.showInputDialog(Common.mainForm, "Enter new location");
    if (llocation != null)
    {
      if (llocation.equals("") == false)
      {
        llocation = llocation.toUpperCase();
        l.setLocationID(llocation);
        if (l.isValidLocation() == false)
        {
          JLaunchMenu.runForm("FRM_ADMIN_LOCATION_EDIT", llocation);
        }
        else
        {
View Full Code Here

    }

  }

  private void populateList() {
    JDBLocation location = new JDBLocation(Common.selectedHostID, Common.sessionID);
    JDBLocationTableModel locationtable = new JDBLocationTableModel(location.getLocationDataResultSet(listStatement));
    TableRowSorter<JDBLocationTableModel> sorter = new TableRowSorter<JDBLocationTableModel>(locationtable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(locationtable);
View Full Code Here

    {
      llocation = jTable1.getValueAt(row, 0).toString();
      int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete Location " + llocation + " ?", "Confirm", JOptionPane.YES_NO_OPTION);
      if (n == 0)
      {
        JDBLocation l = new JDBLocation(Common.selectedHostID, Common.sessionID);
        l.setLocationID(llocation);
        boolean result = l.delete();
        if (result == false)
        {
          JUtility.errorBeep();
          JOptionPane.showMessageDialog(Common.mainForm, l.getErrorMessage(), "Delete error (" + llocation + ")", JOptionPane.WARNING_MESSAGE);
        }
        else
        {
          buildSQL();
          populateList();
View Full Code Here

      e.printStackTrace();
    }
  }

  private void export() {
    JDBLocation location = new JDBLocation(Common.selectedHostID, Common.sessionID);
    JExcel export = new JExcel();
    PreparedStatement temp = buildSQLr();
    export.saveAs("locations.xls", location.getLocationDataResultSet(temp), Common.mainForm);
  }
View Full Code Here

    Boolean result = true;

    JDBMaterial mat = new JDBMaterial(getHostID(), getSessionID());
    JDBMaterialType mattype = new JDBMaterialType(getHostID(), getSessionID());
    JDBMaterialLocation matlocn = new JDBMaterialLocation(getHostID(), getSessionID());
    JDBLocation locn = new JDBLocation(getHostID(), getSessionID());
    JDBMaterialUom matuom = new JDBMaterialUom(getHostID(), getSessionID());
    JDBUom uomdb = new JDBUom(getHostID(), getSessionID());
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    JDBControl ctrl = new JDBControl(getHostID(), getSessionID());
    JDBMaterialCustomerData matcustdata = new JDBMaterialCustomerData(getHostID(), getSessionID());
    JDBCustomer cust = new JDBCustomer(getHostID(), getSessionID());

    String defaultBatchStatus = ctrl.getKeyValue("DEFAULT BATCH STATUS");

    inter.getInterfaceProperties("Material Definition", "Input");

    material = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/material").trim());
    setErrorMessage("Material " + material + " updated.");
    materialType = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/materialType").trim());

    if (mattype.isValidMaterialType(materialType) == false)
    {
      mattype.create(materialType, materialType);
    }

    description = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/description").trim());
    base_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/base_uom").trim());
    base_uom = uomdb.convertUom(inter.getUOMConversion(), base_uom);

    production_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/production_uom").trim());
    production_uom = uomdb.convertUom(inter.getUOMConversion(), production_uom);

    issue_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/issue_uom").trim());
    issue_uom = uomdb.convertUom(inter.getUOMConversion(), issue_uom);

    shelf_life_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/shelf_life_uom").trim());
    equipment_type = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/equipment_Type").trim());
    shelf_life = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/shelf_life").trim());
    shelf_life_rule = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/shelf_life_rule").trim());
    gross_weight = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/gross_weight").trim());
    net_weight = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/net_weight").trim());

    weight_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/weight_uom").trim());
    weight_uom = uomdb.convertUom(inter.getUOMConversion(), weight_uom);

    old_material = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/old_material").trim());
    inspection_id = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/inspection_id").trim());
    default_batch_status = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/default_batch_status").trim());

    /* Material Customer Data */
   
    repeat = true;
    seq = 1;
   
    do
    {
      key = "//message/messageData/materialDefinition/materialCustomerData/customer[" + String.valueOf(seq) + "]/@ID";
      customerID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

      if (customerID.length() > 0)
      {
       
        repeat2 = true;
        seq2 = 1;
        do
        {
          key = "//message/messageData/materialDefinition/materialCustomerData/customer[" + String.valueOf(seq) + "]/data[" + String.valueOf(seq2) + "]/@dataType";
          dataID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());
          key = "//message/messageData/materialDefinition/materialCustomerData/customer[" + String.valueOf(seq) + "]/data[" + String.valueOf(seq2) + "]/@value";
          dataValue = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

          if (dataID.length() > 0)
          {
            if (matcustdata.isValidMaterialCustomerData(material, customerID, dataID)==false)
            {
              matcustdata.create(material, customerID, dataID);
            }
            matcustdata.setData(dataValue);
            matcustdata.update();
           
            if (dataID.equals("NAME"))
            {
              customer_name=dataValue;
            }
           
          } else
          {
            repeat2=false;
          }
         
          seq2++;
         
        } while (repeat2);
       
        if (cust.isValidCustomer(customerID)==false)
        {
          cust.clear();
          cust.create(customerID, customer_name, "Y");
            cust.update();
        }
      }
      else
      {
        repeat=false;
      }

      seq++;

    } while (repeat);

    /* Material Locations */
   
    repeat = true;
    seq = 1;

    do
    {
      key = "//message/messageData/materialDefinition/validLocations/location[" + String.valueOf(seq) + "]/id";
      location = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());
      key = "//message/messageData/materialDefinition/validLocations/location[" + String.valueOf(seq) + "]/status";
      status = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

      if (location.length() > 0)
      {
        if (locn.isValidLocation(location) == true)
        {
          if (matlocn.isValidMaterialLocation(material, location) == false)
          {
            matlocn.create(material, location);
          }
View Full Code Here

    Boolean result = true;

    JDBMaterial mat = new JDBMaterial(getHostID(), getSessionID());
    JDBMaterialType mattype = new JDBMaterialType(getHostID(), getSessionID());
    JDBMaterialLocation matlocn = new JDBMaterialLocation(getHostID(), getSessionID());
    JDBLocation locn = new JDBLocation(getHostID(), getSessionID());
    JDBMaterialUom matuom = new JDBMaterialUom(getHostID(), getSessionID());
    JDBUom uomdb = new JDBUom(getHostID(), getSessionID());
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    JDBControl ctrl = new JDBControl(getHostID(), getSessionID());

    String defaultBatchStatus = ctrl.getKeyValue("DEFAULT BATCH STATUS");

    inter.getInterfaceProperties("Material Definition", "Input");

    material = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/material").trim());
    setErrorMessage("Material " + material + " updated.");
    materialType = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/materialType").trim());
   
    if (mattype.isValidMaterialType(materialType)==false)
    {
      mattype.create(materialType, materialType);
    }
   
    description = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/description").trim());
    base_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/base_uom").trim());
    base_uom = uomdb.convertUom(inter.getUOMConversion(), base_uom);

    production_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/production_uom").trim());
    production_uom = uomdb.convertUom(inter.getUOMConversion(), production_uom);

    issue_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/issue_uom").trim());
    issue_uom = uomdb.convertUom(inter.getUOMConversion(), issue_uom);

    shelf_life_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/shelf_life_uom").trim());
    equipment_type = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/equipment_Type").trim());
    shelf_life = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/shelf_life").trim());
    shelf_life_rule = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/shelf_life_rule").trim());
    gross_weight = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/gross_weight").trim());
    net_weight = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/net_weight").trim());

    weight_uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/weight_uom").trim());
    weight_uom = uomdb.convertUom(inter.getUOMConversion(), weight_uom);

    old_material = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/old_material").trim());
    inspection_id = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/inspection_id").trim());
    default_batch_status = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/default_batch_status").trim());
   
   
    repeat = true;
    seq = 1;

    do
    {
      key = "//message/messageData/materialDefinition/validLocations/location[" + String.valueOf(seq) + "]/id";
      location = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());
      key = "//message/messageData/materialDefinition/validLocations/location[" + String.valueOf(seq) + "]/status";
      status = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());
     
      if (location.length() > 0)
      {
        if (locn.isValidLocation(location)==true)
        {
          if (matlocn.isValidMaterialLocation(material,location)==false)
          {
            matlocn.create(material, location);
          }
View Full Code Here

    buildSQL();
    populateList();
  }

  private void addRecord() {
    JDBLocation l = new JDBLocation(Common.selectedHostID, Common.sessionID);
    llocation = (String) JOptionPane.showInputDialog(Common.mainForm, "Enter new location", null, JOptionPane.QUESTION_MESSAGE,Common.icon_confirm, null, null);
    if (llocation != null)
    {
      if (llocation.equals("") == false)
      {
        llocation = llocation.toUpperCase();
        l.setLocationID(llocation);
        if (l.isValidLocation() == false)
        {
          JLaunchMenu.runForm("FRM_ADMIN_LOCATION_EDIT", llocation);
        }
        else
        {
View Full Code Here

    }

  }

  private void populateList() {
    JDBLocation location = new JDBLocation(Common.selectedHostID, Common.sessionID);
    JDBLocationTableModel locationtable = new JDBLocationTableModel(location.getLocationDataResultSet(listStatement));
    TableRowSorter<JDBLocationTableModel> sorter = new TableRowSorter<JDBLocationTableModel>(locationtable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(locationtable);
View Full Code Here

    {
      llocation = jTable1.getValueAt(row, 0).toString();
      int n = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Location_Delete")+" " + llocation , lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
      if (n == 0)
      {
        JDBLocation l = new JDBLocation(Common.selectedHostID, Common.sessionID);
        l.setLocationID(llocation);
        boolean result = l.delete();
        if (result == false)
        {
          JUtility.errorBeep();
          JOptionPane.showMessageDialog(Common.mainForm, l.getErrorMessage(), "Delete error (" + llocation + ")", JOptionPane.WARNING_MESSAGE);
        }
        else
        {
          buildSQL();
          populateList();
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBLocation

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.