public double CalculateTotalPrice(Item item) { _discount = new DiscountHelper(); double total = _discount.AddDiscount(item); return(total); }
public ActionResult Add(DiscountVM discount) { if (ModelState.IsValid) { Mapper.Initialize(c => c.CreateMap <DiscountVM, DiscountDTO>()); DiscountDTO dto = Mapper.Map <DiscountVM, DiscountDTO>(discount); OperationDetails op = _discountService.AddDiscount(dto); return(Json(new { Succedeed = op.Succedeed, message = op.Message, prop = op.Property })); } else { return(View(discount)); } }