Esempio n. 1
0
 public void CalculateDiscount(Order order)
 {
     if (discountStrategy.CanDiscount(order))
     {
         discountStrategy.ApplyDiscount(order);
     }
 }
Esempio n. 2
0
 public decimal CalculateDiscount(Order order)
 {
     if (discountStrategy.CanDiscount(order))
     {
         return(discountStrategy.GetDiscount(order));
     }
     else
     {
         return(0);
     }
 }
Esempio n. 3
0
 public decimal CalculateDiscount(Order order)
 {
     //1.Predykat
     if (discountStrategy.CanDiscount(order))
     {
         // 2. Wartosc rabatu
         return(discountStrategy.CalculateDiscount(order));
     }
     else
     {
         return(noDiscount);
     }
 }
Esempio n. 4
0
 public decimal CalculateDiscount(Order order)
 {
     // 1. Warunek
     if (discountStrategy.CanDiscount(order))
     {
         // 2. Zniżka
         return(discountStrategy.Discount(order));
     }
     else
     {
         return(0);
     }
 }
 public virtual bool CanDiscount(Order order)
 {
     return(strategy.CanDiscount(order));
 }