Ejemplo n.º 1
0
 private void loadProduct() {
   try {
     BeanContainer<Long, ProductDM> beanVendor =
         new BeanContainer<Long, ProductDM>(ProductDM.class);
     beanVendor.setBeanIdProperty("prodid");
     beanVendor.addAll(
         serviceProduct.getProductList(companyid, null, null, null, "Active", null, null, "P"));
     lsProduct.setContainerDataSource(beanVendor);
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }
Ejemplo n.º 2
0
 private void loadProductList() {
   try {
     List<ProductDM> productlist =
         servicebeanproduct.getProductList(companyid, null, null, null, null, null, null, "F");
     BeanContainer<Long, ProductDM> prodList = new BeanContainer<Long, ProductDM>(ProductDM.class);
     prodList.setBeanIdProperty("prodid");
     prodList.addAll(productlist);
     cbproduct.setContainerDataSource(prodList);
   } catch (Exception e) {
     e.printStackTrace();
     logger.error("fn_loadProductList_Exception Caught->" + e);
   }
 }
Ejemplo n.º 3
0
 private void saveEnqDtl() {
   logger.info(
       "Company ID : " + companyid + " | User Name : " + username + " > " + "Saving Data... ");
   try {
     int count = 0;
     String[] split =
         lsProduct.getValue().toString().replaceAll("\\[", "").replaceAll("\\]", "").split(",");
     for (String obj : split) {
       if (obj.trim().length() > 0) {
         for (SmsPurEnqDtlDM smsPurEnqDtlDM : listEnqDtls) {
           if (smsPurEnqDtlDM.getProductId().equals(Long.valueOf(obj.trim()))) {
             count++;
             break;
           }
         }
         if (tblSmsEnqDtl.getValue() != null) {
           count = 0;
         }
         if (count == 0) {
           SmsPurEnqDtlDM enqDtlObj = new SmsPurEnqDtlDM();
           if (tblSmsEnqDtl.getValue() != null) {
             enqDtlObj = beanPurEnqDtlDM.getItem(tblSmsEnqDtl.getValue()).getBean();
             listEnqDtls.remove(enqDtlObj);
           }
           if (lsProduct.getValue() != null) {
             enqDtlObj.setProductId(Long.valueOf(obj.trim()));
             enqDtlObj.setPordName(
                 serviceProduct
                     .getProductList(
                         null, Long.valueOf(obj.trim()), null, null, null, null, null, "P")
                     .get(0)
                     .getProdname());
           }
           if (cbUom.getValue() != null) {
             cbUom.setReadOnly(false);
             enqDtlObj.setProductUom(cbUom.getValue().toString());
             cbUom.setReadOnly(true);
           }
           enqDtlObj.setRemarks(taEnqDtlRem.getValue().toString());
           if (tfEnqQty.getValue() != null && tfEnqQty.getValue().trim().length() > 0) {
             enqDtlObj.setEnquiryQty(Long.valueOf(tfEnqQty.getValue()));
           }
           if (cbEnqDtlStatus.getValue() != null) {
             enqDtlObj.setEnqDtlStaus((cbEnqDtlStatus.getValue().toString()));
           }
           enqDtlObj.setLastUpdateddt(DateUtils.getcurrentdate());
           enqDtlObj.setLastUpdatedby(username);
           listEnqDtls.add(enqDtlObj);
           loadPurDtl();
           btnaddSpec.setCaption("Add");
           count = 0;
         } else {
           lsProduct.setComponentError(new UserError("Product Already Exist.."));
         }
       }
     }
     enqDtlresetFields();
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }