예제 #1
0
        public ShoppingCart Sell <T>(T requestedItem, int quantity) where T : BaseItem
        {
            var discount = DiscountHelper.GetDiscount(quantity);

            return(new ShoppingCart
            {
                Item = requestedItem,
                PurchaseQuantity = quantity,
                PurchaseDiscount = discount,
                PurchaseAmount = requestedItem.Price * DiscountHelper.ApplyDiscount(discount) * quantity
            });
        }
예제 #2
0
 public override decimal CalculateDeduction(string name)
 {
     return(DiscountHelper.CanApplyNameDiscount(name) ? DiscountHelper.ApplyDiscount(500.00M) : 500.00M);
 }