示例#1
0
        private IFinalPrice UseNoDiscount(IFinalPrice cart, ref string view)
        {
            var noDiscount = new NoDiscount(cart);

            noDiscount.CalculatePriceWithoutDiscount();
            view += "Price without any discount  : $" + cart.GetFinalPrice() + " \n";

            return(noDiscount.AdjustedCart);
        }
示例#2
0
        private IFinalPrice UseCouponDiscount(IFinalPrice cart, ref string view)
        {
            var coupon = new CouponDiscount(cart, _discountVariablesRepository);

            coupon.AdjustPriceByCouponDiscount();
            view += "Coupon discount adjustment  : $" + cart.GetAdjustment() * -1 + " \n";
            view += "Price after coupon discount : $" + cart.GetFinalPrice() + " \n";

            return(coupon.AdjustedCart);
        }
示例#3
0
        private IFinalPrice UseBulkDiscount(IFinalPrice cart, ref string view)
        {
            var bulkDiscount = new BulkDiscount(cart, _discountVariablesRepository);

            bulkDiscount.AdjustPriceByBulkDiscount();
            view += "Bulk discount adjustment    : $" + cart.GetAdjustment() * -1 + " \n";
            view += "Price after bulk discount   : $" + cart.GetFinalPrice() + " \n";

            return(bulkDiscount.AdjustedCart);
        }
示例#4
0
 public BulkDiscount(IFinalPrice adjustedCart, IDiscountVariablesRepository discountVariablesRepository) : base(adjustedCart)
 {
     _discountVariablesRepository = discountVariablesRepository;
 }
 public NoDiscount(IFinalPrice adjustedCart) : base(adjustedCart)
 {
 }
示例#6
0
 protected PriceAdjustment(IFinalPrice adjustedCart)
 {
     AdjustedCart = adjustedCart;
 }