public ActionResult Edit(long Id) { DiscountDTO discountDto = _discountService.GetDiscount(Id, CurrentLanguage, CurrentCurrency); Mapper.Initialize(c => c.CreateMap <DiscountDTO, DiscountVM>()); DiscountVM discountVM = Mapper.Map <DiscountDTO, DiscountVM>(discountDto); return(View(discountVM)); }
public virtual decimal GetDiscount(Order order) { if (discount != null) { return(discount.GetDiscount(order)); } else { return(0); } }
static void NewMain(string[] args, ICalculator calculator, IParts parts, IService service, IDiscount discount) { var p = parts.GetParts(Decimal.Parse(args[0])); var s = service.GetService(Decimal.Parse(args[1])); var d = discount.GetDiscount(Decimal.Parse(args[2])); var total = calculator.GetTotal(p, s, d); Console.WriteLine("Total testy Price: $" + total); }
public decimal ValueProducts(IEnumerable <Product> products) { decimal sumOfProduct = 0; foreach (var product in products) { sumOfProduct += product.Price; } sumOfProduct *= rate.GetRatio(); sumOfProduct -= sumOfProduct * (discount.GetDiscount() / 100M); return(sumOfProduct); }
public bool ApplyDiscount(IDiscount applyDiscount) { if (applyDiscount is IDeliveryDiscount) { return(false); } if (!_discounts.Contains(applyDiscount)) { var currentDiscount = applyDiscount.GetDiscount(this); if (currentDiscount > 0) { _discounts.Add(applyDiscount); Discount += currentDiscount; if (Discount > Price) { Discount = Price; } return(true); } } return(false); }
public void ApplyDiscount(IDiscount discount) { BillDiscount = TotalAmount * discount.GetDiscount(); }
public decimal GetPrice() { var multiplier = 1 - _discount.GetDiscount() / 100m; return(multiplier * GetFullPrice()); }
public decimal CalculateDiscount(Order order) { return(discount.GetDiscount(order)); }
public decimal CalculatePrice(decimal price) { return(_decorator.CalculatePrice(_discount.GetDiscount(price))); }
public void ApplyDiscount(IDiscount discount) { Discount = Price * discount.GetDiscount(); }