private static void Billing(IPercentageDiscount percentageDiscount) { var billingService = new BillingService(percentageDiscount, new BillDiscount()); billingService.AddItem(new OtherItem { Name = "Laptop", Price = 50000 }); billingService.AddItem(new OtherItem { Name = "Mobile", Price = 20000 }); billingService.AddItem(new GroceryItem { Name = "Rice", Price = 1000 }); Console.WriteLine(billingService.PrintBill()); }
public Bill(IPercentageDiscount percentageDiscount) { _percentageDiscount = percentageDiscount; Items = new HashSet <Item>(); }
public void Start() { _percentageDiscount = new Employee(); _billingService = new BillingService(_percentageDiscount, new BillDiscount()); }
public BillingService(IPercentageDiscount percentageDiscount, IBillDiscount billDiscount) { _bill = new Bill(percentageDiscount); _billDiscount = billDiscount; }
public void Start() { _percentageDiscount = new RegularCustomer(); _billingService = new BillingService(_percentageDiscount, new BillDiscount()); }
public BillCalculator(IPercentageDiscount percentageDiscountCalculator, IFixedDiscount fixedDiscountCalculator) { FixedDiscountCalculator = fixedDiscountCalculator; PercentageDiscountCalculator = percentageDiscountCalculator; }
public void Start() { _percentageDiscount = new Affiliate(); _billingService = new BillingService(_percentageDiscount, new BillDiscount()); }