コード例 #1
0
 public bool ApplyDiscount(ShoppingCart shoppingCart)
 {
     if (shoppingCart.TotalAmount > MinimumAmount)
     {
         DiscountStrategy.ApplyDiscount(shoppingCart, DiscountQuantity);
         return(true);
     }
     return(false);
 }
コード例 #2
0
        public bool ApplyDiscount(ShoppingCart shoppingCart)
        {
            uint productQuantity = shoppingCart.GetProductQuantityOfCategory(Category);

            if (productQuantity > MinimumItems)
            {
                DiscountStrategy.ApplyDiscount(shoppingCart, DiscountQuantity);
                return(true);
            }
            return(false);
        }