Package com.commander4j.db

Examples of com.commander4j.db.JDBMaterialUom


    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);
          }
          matlocn.setStatus(status);
          matlocn.update();
        }

      } else
      {
        repeat = false;
      }
      seq++;

    } while (repeat);

    /* Material Units of Measure */
   
    repeat = true;
    seq = 1;
    String matUOMError = "";

    do
    {
      key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/uom";
      uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());
      uom = uomdb.convertUom(inter.getUOMConversion(), uom);

      if (uom.length() > 0)
      {

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/numerator";
        numerator = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/denominator";
        denominator = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/ean";
        ean = gmh.getXMLDocument().findXPath(key).trim();

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/variant";
        variant = gmh.getXMLDocument().findXPath(key).trim();

        if (uomdb.isValidInternalUom(uom) == false)
        {
          uomdb.create(uom, uom, uom, "Auto created UOM");
        }

        if (matuom.getMaterialUomProperties(material, uom) == false)
        {
          matuom.setMaterial(material);
          matuom.setUom(uom);
          if (matuom.create() == false)
          {
            result = false;
            matUOMError = "Material " + material + " UOM [" + uom + "] create error. " + matuom.getErrorMessage();
            setErrorMessage(matUOMError);
          } else
          {
            setErrorMessage("Material " + material + " created.");
          }
        }

        try
        {
          matuom.setNumerator(Integer.valueOf(JUtility.getDefaultValue(numerator, String.valueOf(matuom.getNumerator()), "0")));
          matuom.setDenominator(Integer.valueOf(JUtility.getDefaultValue(denominator, String.valueOf(matuom.getDenominator()), "0")));

          matuom.setEan(ean);
          matuom.setVariant(variant);

          if (matuom.getNumerator() == 0)
          {
            result = false;
            setErrorMessage("Material " + material + " UOM [" + uom + "]. Numerator cannot be zero.");
          } else
          {
            if (matuom.getDenominator() == 0)
            {
              result = false;
              setErrorMessage("Material " + material + " UOM [" + uom + "]. Denominator cannot be zero.");
            } else
            {
              if (matuom.update() == false)
              {
                result = false;
                setErrorMessage("Material " + material + " UOM [" + uom + "] update error. " + matuom.getErrorMessage());
              }
            }
          }

        } catch (Exception ex)
View Full Code Here


    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);
          }
          matlocn.setStatus(status);
          matlocn.update();
        }
     
      } else
      {
        repeat = false;
      }
      seq++;
     
    } while (repeat);

    repeat = true;
    seq = 1;
    String matUOMError = "";
   
    do
    {
      key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/uom";
      uom = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());
      uom = uomdb.convertUom(inter.getUOMConversion(), uom);

      if (uom.length() > 0)
      {

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/numerator";
        numerator = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/denominator";
        denominator = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/ean";
        ean = gmh.getXMLDocument().findXPath(key).trim();

        key = "//message/messageData/materialDefinition/materialUOMDefinition[" + String.valueOf(seq) + "]/variant";
        variant = gmh.getXMLDocument().findXPath(key).trim();

        if (uomdb.isValidInternalUom(uom)==false)
        {
          uomdb.create(uom, uom, uom, "Auto created UOM");
        }
       
        if (matuom.getMaterialUomProperties(material, uom) == false)
        {
          matuom.setMaterial(material);
          matuom.setUom(uom);
          if (matuom.create() == false)
          {
            result = false;
            matUOMError = "Material " + material + " UOM [" + uom + "] create error. " + matuom.getErrorMessage();
            setErrorMessage(matUOMError);
          } else
          {
            setErrorMessage("Material " + material + " created.");
          }
        }

        try
        {
          matuom.setNumerator(Integer.valueOf(JUtility.getDefaultValue(numerator, String.valueOf(matuom.getNumerator()), "0")));
          matuom.setDenominator(Integer.valueOf(JUtility.getDefaultValue(denominator, String.valueOf(matuom.getDenominator()), "0")));

          matuom.setEan(ean);
          matuom.setVariant(variant);

          if (matuom.getNumerator() == 0)
          {
            result = false;
            setErrorMessage("Material " + material + " UOM [" + uom + "]. Numerator cannot be zero.");
          } else
          {
            if (matuom.getDenominator() == 0)
            {
              result = false;
              setErrorMessage("Material " + material + " UOM [" + uom + "]. Denominator cannot be zero.");
            } else
            {
              if (matuom.update() == false)
              {
                result = false;
                setErrorMessage("Material " + material + " UOM [" + uom + "] update error. " + matuom.getErrorMessage());
              }
            }
          }

        } catch (Exception ex)
View Full Code Here

    query.appendSort("material,uom", "asc");
    query.applyRestriction(false, "none", 0);
    query.bindParams();
    listStatement = query.getPreparedStatement();
   
    JDBMaterialUom materialuom = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
    JDBMaterialUomTableModel materialuomtable = new JDBMaterialUomTableModel(materialuom.getMaterialDataResultSet(listStatement));
    TableRowSorter<JDBMaterialUomTableModel> sorter = new TableRowSorter<JDBMaterialUomTableModel>(materialuomtable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(materialuomtable);
    jScrollPane1.setViewportView(jTable1);
View Full Code Here

          jButtonAdd.setMnemonic(lang.getMnemonicChar());
          jButtonAdd.setBounds(483, 7, 126, 32);
          jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_UOM_ADD"));
          jButtonAdd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JDBMaterialUom m = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
              JDBUom u = new JDBUom(Common.selectedHostID, Common.sessionID);
              luom = (String) JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Material_UOM_Input"), null, JOptionPane.QUESTION_MESSAGE,Common.icon_confirm, null, null);
              if (luom != null)
              {
                if (luom.equals("") == false)
                {
                  luom = luom.toUpperCase();
                  u.setInternalUom(luom);
                  if (u.isValidInternalUom())
                  {
                    m.setMaterial(lmaterial);
                    m.setUom(luom);
                    if (m.isValidMaterialUom() == false)
                    {
                      JLaunchMenu.runForm("FRM_ADMIN_MATERIAL_UOM_EDIT", lmaterial, luom);
                    }
                    else
                    {
                      JOptionPane.showMessageDialog(Common.mainForm, "Material [" + lmaterial + "] Uom [" + luom + "] already exists", lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
                    }
                    populateList(lmaterial);
                  }
                  else
                  {
                    JOptionPane.showMessageDialog(Common.mainForm, "Invalid Uom [" + luom + "] does not exist", lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE);
                  }
                }
              }

            }
          });
        }
        {
          jButtonEdit = new JButton4j(Common.icon_edit);
          jDesktopPane1.add(jButtonEdit);
          jButtonEdit.setText(lang.get("btn_Edit"));
          jButtonEdit.setMnemonic(lang.getMnemonicChar());
          jButtonEdit.setBounds(483, 35, 126, 32);
          jButtonEdit.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_UOM_EDIT"));
          jButtonEdit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              editRecord();

            }
          });
        }
        {
          jButtonDelete = new JButton4j(Common.icon_delete);
          jDesktopPane1.add(jButtonDelete);
          jButtonDelete.setText(lang.get("btn_Delete"));
          jButtonDelete.setMnemonic(lang.getMnemonicChar());
          jButtonDelete.setBounds(483, 63, 126, 32);
          jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_UOM_EDIT"));
          jButtonDelete.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              int row = jTable1.getSelectedRow();
              if (row >= 0)
              {
                luom = jTable1.getValueAt(row, 1).toString();
                int question = JOptionPane.showConfirmDialog(Common.mainForm, "Delete Material [" + lmaterial + "] Uom [" + luom + "] ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
                if (question == 0)
                {
                  JDBMaterialUom m = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
                  m.setMaterial(lmaterial);
                  m.setUom(luom);
                  boolean result = m.delete();
                  if (result == false)
                  {
                    JUtility.errorBeep();
                    JOptionPane.showMessageDialog(Common.mainForm, m.getErrorMessage(), "Delete error Material [" + lmaterial + "] Uom [" + luom + "]", JOptionPane.WARNING_MESSAGE);
                  }
                  else
                  {
                    populateList(lmaterial);
                  }
View Full Code Here

    try
    {
      if (cache.containsKey(row)==false)
      {
        mResultSet.absolute(row + 1);
        final JDBMaterialUom prow = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
        prow.getPropertiesfromResultSet(mResultSet);
        cache.put(row, prow);
      }

      switch (col)
      {
View Full Code Here

    query.appendSort("material,uom", "asc");
    query.applyRestriction(false, "none", 0);
    query.bindParams();
    listStatement = query.getPreparedStatement();
   
    JDBMaterialUom materialuom = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
    JDBMaterialUomTableModel materialuomtable = new JDBMaterialUomTableModel(materialuom.getMaterialDataResultSet(listStatement));
    TableRowSorter<JDBMaterialUomTableModel> sorter = new TableRowSorter<JDBMaterialUomTableModel>(materialuomtable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(materialuomtable);
    jScrollPane1.setViewportView(jTable1);
View Full Code Here

          jButtonAdd.setMnemonic(lang.getMnemonicChar());
          jButtonAdd.setBounds(483, 7, 126, 28);
          jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_UOM_ADD"));
          jButtonAdd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JDBMaterialUom m = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
              JDBUom u = new JDBUom(Common.selectedHostID, Common.sessionID);
              luom = JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Material_UOM_Input"));
              if (luom != null)
              {
                if (luom.equals("") == false)
                {
                  luom = luom.toUpperCase();
                  u.setInternalUom(luom);
                  if (u.isValidInternalUom())
                  {
                    m.setMaterial(lmaterial);
                    m.setUom(luom);
                    if (m.isValidMaterialUom() == false)
                    {
                      JLaunchMenu.runForm("FRM_ADMIN_MATERIAL_UOM_EDIT", lmaterial, luom);
                    }
                    else
                    {
                      JOptionPane.showMessageDialog(Common.mainForm, "Material [" + lmaterial + "] Uom [" + luom + "] already exists", lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE);
                    }
                    populateList(lmaterial);
                  }
                  else
                  {
                    JOptionPane.showMessageDialog(Common.mainForm, "Invalid Uom [" + luom + "] does not exist", lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE);
                  }
                }
              }

            }
          });
        }
        {
          jButtonEdit = new JButton4j(Common.icon_edit);
          jDesktopPane1.add(jButtonEdit);
          jButtonEdit.setText(lang.get("btn_Edit"));
          jButtonEdit.setMnemonic(lang.getMnemonicChar());
          jButtonEdit.setBounds(483, 35, 126, 28);
          jButtonEdit.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_UOM_EDIT"));
          jButtonEdit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              editRecord();

            }
          });
        }
        {
          jButtonDelete = new JButton4j(Common.icon_delete);
          jDesktopPane1.add(jButtonDelete);
          jButtonDelete.setText(lang.get("btn_Delete"));
          jButtonDelete.setMnemonic(lang.getMnemonicChar());
          jButtonDelete.setBounds(483, 63, 126, 28);
          jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_UOM_EDIT"));
          jButtonDelete.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              int row = jTable1.getSelectedRow();
              if (row >= 0)
              {
                luom = jTable1.getValueAt(row, 1).toString();
                int question = JOptionPane.showConfirmDialog(Common.mainForm, "Delete Material [" + lmaterial + "] Uom [" + luom + "] ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION);
                if (question == 0)
                {
                  JDBMaterialUom m = new JDBMaterialUom(Common.selectedHostID, Common.sessionID);
                  m.setMaterial(lmaterial);
                  m.setUom(luom);
                  boolean result = m.delete();
                  if (result == false)
                  {
                    JUtility.errorBeep();
                    JOptionPane.showMessageDialog(Common.mainForm, m.getErrorMessage(), "Delete error Material [" + lmaterial + "] Uom [" + luom + "]", JOptionPane.WARNING_MESSAGE);
                  }
                  else
                  {
                    populateList(lmaterial);
                  }
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBMaterialUom

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.