Пример #1
0
 private void jbtnBuscaActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jbtnBuscaActionPerformed
   try {
     if (!"".equals(this.jtxtCodigoBusca.getText())) {
       Product rec;
       String id_Product = this.jtxtCodigoBusca.getText();
       rec = pDAO.selectProduct(id_Product);
       if (rec == null) {
         valForm.msjInfo("Al articulo que desea buscar no existe en nuestra Base de Datos");
       } else {
         if (mtdTitleTable()) {
           Category c = categoryLogic.categoryId(rec.getId_category());
           modelo.addRow(
               new Object[] {
                 rec.getId_product(),
                 rec.getProduct() + " " + rec.getDescripcion(),
                 rec.getCantidad(),
                 rec.getP_compra(),
                 rec.getP_venta(),
                 c.getCategory(),
                 rec.getActivo()
               });
         }
       }
       this.jtxtCodigoBusca.setText("");
       this.jtxtCodigoBusca.requestFocus();
     } else {
       if (mtdProductTable()) {}
     }
   } catch (Exception ex) {
     System.out.println("Error Buscar: " + ex.getMessage());
     this.jtxtCodigoBusca.setText("");
     this.jtxtCodigoBusca.requestFocus();
   }
 } // GEN-LAST:event_jbtnBuscaActionPerformed
Пример #2
0
 /*
  * private boolean getNegocio(){ List<Negocio> negocioList =
  * negocioLogic.getNegocio(); for(Negocio n: negocioList){
  * this.jcmbNegocio.addItem(n.getNegocio()); } return true; }
  */
 private List<Category> getCategory() {
   List<Category> categoryList = categoryLogic.getCategory();
   return categoryList;
 }