Package com.swinarta.sunflower.core.model

Examples of com.swinarta.sunflower.core.model.Product


    Integer productId = RequestUtil.getInteger(request.getData().get("productId"));
    Serializable resp = null;
   
    try {
      Promo promo = coreManager.get(Promo.class, promoId);
      Product product = coreManager.get(Product.class, productId);
     
      PromoDetail det = new PromoDetail();
      det.setProduct(product);
      det.setPromo(promo);
     
View Full Code Here


      s.setSellingPrice(sellingPrice);
     
      Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
      s.setMeasurement(selm);
     
      Product prod = coreManager.get(Product.class, id);
      s.setProduct(prod);
   
      try{
        respSelling = coreManager.save(Selling.class, s);
      }catch (Exception e) {
View Full Code Here

              pm.setOverrideQty(overrideQty);
              ProductMeasurement pm1 = coreManager.save(ProductMeasurement.class, pm)
              productMeasurementMap.put(id, pm1);
            }else{
              pm = new ProductMeasurement();
              Product p = coreManager.get(Product.class, productId);
              pm.setProduct(p);
              pm.setOverrideQty(overrideQty);
              pm.setMeasurement(measurement);
             
              ProductMeasurement pm1 = coreManager.save(ProductMeasurement.class, pm)
View Full Code Here

      b.setMeasurement(selm);

      Supplier supp = coreManager.get(Supplier.class, supplierId);
      b.setSupplier(supp);
     
      Product prod = coreManager.get(Product.class, id);
      b.setProduct(prod);
           
      try{
        respBuying = coreManager.save(Buying.class, b);
      }catch (Exception e) {
View Full Code Here

    Integer poId = RequestUtil.getInteger(request.getData().get("poId"));
    Integer productId = RequestUtil.getInteger(request.getData().get("productId"));
    Serializable resp = null;
   
    try{
      Product product = coreManager.get(Product.class, productId);
      PurchasingOrder po = coreManager.get(PurchasingOrder.class, poId);
     
      PurchasingOrderDetail pod = new PurchasingOrderDetail();
      pod.setProduct(product);
      pod.setPurchasingOrder(po);
View Full Code Here

      Integer max = (Integer) request.getData().get("max");
      Integer min = (Integer) request.getData().get("min");
      Integer order = (Integer) request.getData().get("defaultOrder");
      Integer storeId = (Integer) request.getData().get("storeId");
     
      Product product = coreManager.get(Product.class, productId);
     
      Stock s = new Stock();
      s.setCurrent(current);
      s.setDefaultOrder(order);
      s.setMax(max);
View Full Code Here

    Integer toId = RequestUtil.getInteger(request.getData().get("transferId"));
    Integer productId = RequestUtil.getInteger(request.getData().get("productId"));
    Serializable resp = null;
   
    try{
      Product product = coreManager.get(Product.class, productId);
      TransferOrder to = coreManager.get(TransferOrder.class, toId);
     
      TransferOrderDetail tod = new TransferOrderDetail();
      tod.setProduct(product);
      tod.setTransferOrder(to);
View Full Code Here

    Integer retId = RequestUtil.getInteger(request.getData().get("retId"));
    Integer productId = RequestUtil.getInteger(request.getData().get("productId"));
    Serializable resp = null;
   
    try{
      Product product = coreManager.get(Product.class, productId);
      ReturnToSupplier ret = coreManager.get(ReturnToSupplier.class, retId);
     
      ReturnToSupplierDetail retd = new ReturnToSupplierDetail();
      retd.setProduct(product);
      retd.setReturnToSupplier(ret);
View Full Code Here

    String shortDescription = RequestUtil.getString(request.getData().get("shortDescription"));
    Boolean consignment = RequestUtil.getBoolean(request.getData().get("consignment"));
    Boolean scallable = RequestUtil.getBoolean(request.getData().get("scallable"));
    Integer categoryId = RequestUtil.getInteger(request.getData().get("categoryId"));     

    Product p = new Product();
    p.setSku(sku);
    p.setBarcode(barcode);
    p.setLongDescription(longDescription);
    p.setShortDescription(shortDescription);
    p.setScallable(scallable);
    p.setConsignment(consignment);
    p.setDeleteInd(false);

    Category category = coreManager.getCategory(categoryId);
    p.setCategory(category);
   
    try {
      Product savedProduct = coreManager.save(Product.class, p);
           
      resp = mapper.map(savedProduct, DisplayProduct.class);
    }catch (DataIntegrityViolationException dive){
     
      dive.printStackTrace();
View Full Code Here

    Boolean consignment = (Boolean) request.getData().get("consignment");
    Boolean scallable = (Boolean) request.getData().get("scallable");
    Boolean deleteInd = !(Boolean) request.getData().get("active");
    Integer categoryId = RequestUtil.getInteger(request.getData().get("categoryId"));     
     
    Product p = coreManager.get(Product.class, id);
    p.setSku(sku);
    p.setBarcode(barcode);
    p.setLongDescription(longDescription);
    p.setShortDescription(shortDescription);
    p.setScallable(scallable);
    p.setConsignment(consignment);
    p.setDeleteInd(deleteInd);

    Category category = coreManager.getCategory(categoryId);
    p.setCategory(category);

    try {
      Product savedProduct = coreManager.save(Product.class, p);
      resp = mapper.map(savedProduct, DisplayProduct.class);
    }catch (DataIntegrityViolationException dive){
     
      SgwtRestErrorResponse resp1 = new SgwtRestErrorResponse(-4);
     
View Full Code Here

TOP

Related Classes of com.swinarta.sunflower.core.model.Product

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.