Package com.commander4j.db

Examples of com.commander4j.db.JDBCustomer


  private JScrollPane jScrollPane1;
  private String lcustid;
  private JDBLanguage lang = new JDBLanguage(Common.selectedHostID, Common.sessionID);

  private void addrecord() {
    JDBCustomer u = new JDBCustomer(Common.selectedHostID, Common.sessionID);
    lcustid = JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Customer_Add"));
    if (lcustid != null)
    {
      if (lcustid.equals("") == false)
      {
        lcustid = lcustid.toUpperCase();
        if (u.create(lcustid, "", "Y") == false)
        {
          JUtility.errorBeep();
          JOptionPane.showMessageDialog(Common.mainForm, u.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE);
        }
        else
        {
          JLaunchMenu.runForm("FRM_ADMIN_CUSTOMER_EDIT", lcustid);
        }
View Full Code Here


  private void populateList(String defaultitem) {

    DefaultComboBoxModel DefComboBoxMod = new DefaultComboBoxModel();

    JDBCustomer tempCust = new JDBCustomer(Common.selectedHostID, Common.sessionID);

    LinkedList<JDBCustomer> tempCustomerList = tempCust.getCustomers();
    int sel = -1;
    for (int j = 0; j < tempCustomerList.size(); j++)
    {
      JDBCustomer t = (JDBCustomer) tempCustomerList.get(j);
      DefComboBoxMod.addElement(t);
      if (t.getID().equals(defaultitem))
      {
        sel = j;
      }
    }
View Full Code Here

    {
      lcustid = ((JDBCustomer) jListCustomers.getSelectedValue()).getID();
      int question = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Customer_Delete") + " " + lcustid + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION);
      if (question == 0)
      {
        JDBCustomer u = new JDBCustomer(Common.selectedHostID, Common.sessionID);
        u.setID(lcustid);
        u.delete();
        populateList("");
      }
    }
  }
View Full Code Here

      if (lcust_to != null)
      {
        if (lcust_to.equals("") == false)
        {
          lcust_to = lcust_to.toUpperCase();
          JDBCustomer u = new JDBCustomer(Common.selectedHostID, Common.sessionID);
          u.setID(lcust_from);
          if (u.renameTo(lcust_to) == false)
          {
            JUtility.errorBeep();
            JOptionPane.showMessageDialog(Common.mainForm, u.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE);
          }
          populateList(lcust_to);
        }
      }
    }
View Full Code Here

      }
    }
  }

  private void excel() {
    JDBCustomer customer = new JDBCustomer(Common.selectedHostID, Common.sessionID);
    JExcel export = new JExcel();
    export.saveAs("customers.xls", customer.getCustomerDataResultSet(), Common.mainForm);
  }
View Full Code Here

  public Boolean processMessage(GenericMessageHeader gmh) {
    Boolean result = false;

    JDBProcessOrder po = new JDBProcessOrder(getHostID(), getSessionID());
    JDBCustomer cst = new JDBCustomer(getHostID(), getSessionID());
    JDBUom uomdb = new JDBUom(getHostID(), getSessionID());
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());

    inter.getInterfaceProperties("Process Order", "Input");

    orderNo = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/orderNo").trim();
    material = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/material").trim();
    description = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/description").trim();
    status = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/status").trim();
    location = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/location").trim();
    dueDate = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/dueDate").trim();
    receipeId = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/receipeId").trim();
    requiredQuantity = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/requiredQuantity").trim();

    requiredUom = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/requiredUom").trim();
    requiredUom = uomdb.convertUom(inter.getUOMConversion(), requiredUom);

    defaultPalletStatus = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/defaultPalletStatus").trim();
    requiredResource = gmh.getXMLDocument().findXPath("//message/messageData/processOrder/requiredResource").trim();
   
    inspectionID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/processOrder/inspectionID").trim());
    customerID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/processOrder/customerID").trim());
    customerName = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/processOrder/customerName").trim());

    boolean create = false;
    if (po.getProcessOrderProperties(orderNo) == false) {
      create = true;
    }
    else {
      create = false;
    }

    po.setLocation(location);
    po.setMaterial(material);
    po.setDescription(description);
    po.setStatus(status);
    po.setDefaultPalletStatus(defaultPalletStatus);
    po.setRecipe(receipeId);
    po.setRequiredQuantity(BigDecimal.valueOf(Double.valueOf(requiredQuantity)));
    po.setRequiredUom(requiredUom);
    po.setRequiredResource(requiredResource);
    po.setInspectionID(inspectionID);

    if (customerID.equals("") == false) {
      if (cst.getCustomerProperties(customerID) == true) {
        if (customerName.equals("") == false) {
          cst.setName(customerName);
          cst.update();
        }
      }
      else {
        cst.clear();
        cst.create(customerID, customerName, "Y");
        cst.update();
      }
    }
    else
    {
      customerID = "SELF";
View Full Code Here

    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;
View Full Code Here

          jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_CUST_DATA_ADD"));
          jButtonAdd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt)
            {
              JDBMaterialCustomerData m = new JDBMaterialCustomerData(Common.selectedHostID, Common.sessionID);
              JDBCustomer u = new JDBCustomer(Common.selectedHostID, Common.sessionID);

              LinkedList<JDBCustomer> custList = u.getCustomers();
              String[] customerList = new String[custList.size()];
              for (int x = 0; x < custList.size(); x++)
              {
                customerList[x] = custList.get(x).getID();
              }

              lcustomer = (String) JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Customer_Input"), lang.get("btn_Select"), JOptionPane.PLAIN_MESSAGE, Common.icon_confirm, customerList, customerList[0]);

              if (lcustomer != null)
              {
                if (lcustomer.equals("") == false)
                {
                  lcustomer = lcustomer.toUpperCase();
                  if (u.isValidCustomer(lcustomer))
                  {
                   
                    JDBDataIDs di = new JDBDataIDs(Common.selectedHostID, Common.sessionID);
                    LinkedList<JDBDataIDs> idList = di.getDataIDs();
View Full Code Here

  private JScrollPane jScrollPane1;
  private String lcustid;
  private JDBLanguage lang = new JDBLanguage(Common.selectedHostID, Common.sessionID);

  private void addrecord() {
    JDBCustomer u = new JDBCustomer(Common.selectedHostID, Common.sessionID);
    lcustid = (String) JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Customer_Add"), null, JOptionPane.QUESTION_MESSAGE,Common.icon_confirm, null, null);
    if (lcustid != null)
    {
      if (lcustid.equals("") == false)
      {
        lcustid = lcustid.toUpperCase();
        if (u.create(lcustid, "", "Y") == false)
        {
          JUtility.errorBeep();
          JOptionPane.showMessageDialog(Common.mainForm, u.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
        }
        else
        {
          JLaunchMenu.runForm("FRM_ADMIN_CUSTOMER_EDIT", lcustid);
        }
View Full Code Here

  private void populateList(String defaultitem) {

    DefaultComboBoxModel<JDBCustomer> DefComboBoxMod = new DefaultComboBoxModel<JDBCustomer>();

    JDBCustomer tempCust = new JDBCustomer(Common.selectedHostID, Common.sessionID);

    LinkedList<JDBCustomer> tempCustomerList = tempCust.getCustomers();
    int sel = -1;
    for (int j = 0; j < tempCustomerList.size(); j++)
    {
      JDBCustomer t = (JDBCustomer) tempCustomerList.get(j);
      DefComboBoxMod.addElement(t);
      if (t.getID().equals(defaultitem))
      {
        sel = j;
      }
    }
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBCustomer

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.