Exemple #1
0
        public decimal GetPrice()
        {
            decimal?rentalPrice = Rentals.GetTotalPrice();

            if (rentalPrice.HasValue)
            {
                decimal?priceAfterDiscount = Discount?.ApplyDiscount(Rentals);

                return(priceAfterDiscount.HasValue ? priceAfterDiscount.Value : rentalPrice.Value);
            }

            else
            {
                return(0);
            }
        }
Exemple #2
0
        public void ApplyDiscount()
        {
            var products = (new Product()).GetProducts();

            Discount.ApplyDiscount(products);
        }