Package com.swinarta.sunflower.core.model

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


   
    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);
     
      PromoDetail promoDetail =  coreManager.save(PromoDetail.class, det);
      promoDetail = coreManager.getPromoDetail(promoDetail.getId());
     
      DisplayPromoDetail dispDet = mapper.map(promoDetail, DisplayPromoDetail.class);
      ProductMeasurement productMeasurement = null;
      if(promoDetail.getProduct().getProductMeasurement() != null && !promoDetail.getProduct().getProductMeasurement().isEmpty()){
        productMeasurement = promoDetail.getProduct().getProductMeasurement().iterator().next();
      }
      if(productMeasurement != null){
        dispDet.getProduct().setProductMeasurement(mapper.map(productMeasurement, DisplayProductMeasurement.class));
      }
     
View Full Code Here


  @Post("json")
  public SgwtRestResponseBase add(SgwtRequest request){

    Integer id = RequestUtil.getInteger(getRequestAttributes().get("id"));
    PromoDetail detail = coreManager.get(PromoDetail.class, id);
    coreManager.remove(detail);
   
    return new SgwtRestDeleteResponse(id);
   
  }
View Full Code Here

TOP

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

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.