Package com.swinarta.sunflower.core.model

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


     
      Selling s = coreManager.get(Selling.class, id);
      s.setSellingPrice(sellingPrice);
     
      if(measurementSelectionId.intValue() != s.getMeasurement().getId().intValue()){
        Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
        s.setMeasurement(selm);
      }
     
      try{
        respSelling = coreManager.save(Selling.class, s);
      }catch (Exception e) {
        SgwtRestErrorResponse resp = new SgwtRestErrorResponse(SgwtRestResponseBase.RESPONSE_FAILURE);
        resp.addError("exception", e.getMessage());
        return resp;
      }
     
    }else if(request.getOperationType() == OPERATION_TYPE.ADD){
                 
      Double sellingPrice = RequestUtil.getDouble(request.getData().get("sellingPrice"));
      Integer measurementSelectionId = RequestUtil.getInteger(request.getData().get("measurementSelectionId"));
     
      Selling s = new Selling();
      s.setSellingPrice(sellingPrice);
     
      Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
      s.setMeasurement(selm);
     
      Product prod = coreManager.get(Product.class, id);
      s.setProduct(prod);
   
View Full Code Here


      b.setDisc4(disc4);
      b.setTaxIncluded(taxIncluded);
      b.setDiscPrice(discPrice);

      if(measurementSelectionId.intValue() != b.getMeasurement().getId().intValue()){
        Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
        b.setMeasurement(selm);
      }
     
      if(supplierId.intValue() != b.getSupplier().getId().intValue()){
        Supplier supp = coreManager.get(Supplier.class, supplierId);
        b.setSupplier(supp);
      }
           
      try{
        respBuying = coreManager.save(Buying.class, b);
      }catch (Exception e) {
        SgwtRestErrorResponse resp = new SgwtRestErrorResponse(SgwtRestResponseBase.RESPONSE_FAILURE);
        resp.addError("exception", e.getMessage());
        return resp;
      }
     
    }else if(request.getOperationType() == OPERATION_TYPE.ADD){
     
      Double buyingPrice = RequestUtil.getDouble(request.getData().get("buyingPrice"));
      Double disc1 = RequestUtil.getDouble(request.getData().get("disc1"));
      Double disc2 = RequestUtil.getDouble(request.getData().get("disc2"));
      Double disc3 = RequestUtil.getDouble(request.getData().get("disc3"));
      Double disc4 = RequestUtil.getDouble(request.getData().get("disc4"));     
      Boolean taxIncluded = RequestUtil.getBoolean(request.getData().get("taxIncluded"));     
      Double discPrice = RequestUtil.getDouble(request.getData().get("discPrice"));
     
      Integer measurementSelectionId = RequestUtil.getInteger(request.getData().get("measurementSelectionId"));
      Integer supplierId = RequestUtil.getInteger(request.getData().get("supplierId"));

      Buying b = new Buying();
      b.setId(id);
      b.setBuyingPrice(buyingPrice);
      b.setDisc1(disc1);
      b.setDisc2(disc2);
      b.setDisc3(disc3);
      b.setDisc4(disc4);
      b.setTaxIncluded(taxIncluded);
      b.setDiscPrice(discPrice);
     
      Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
      b.setMeasurement(selm);

      Supplier supp = coreManager.get(Supplier.class, supplierId);
      b.setSupplier(supp);
     
View Full Code Here

TOP

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

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.