public decimal GetTotal( Order order ) { if ( order.GetTotal() > threshold ) { decimal temp = order.GetTotal() * discount; return order.GetTotal() - temp; } else return order.GetTotal(); }
public override IPriceStrategy GetTotal( Order order ) { decimal maxValue = decimal.MaxValue; IPriceStrategy strategyToReturn = null; foreach ( var item in strategies ) { if(item.GetTotal( order ) < maxValue ) { maxValue = item.GetTotal( order ); strategyToReturn = item; } } return strategyToReturn; }
public decimal GetTotal( Order order ) { decimal temp = order.GetTotal() * discount; return order.GetTotal() - temp; }
public abstract IPriceStrategy GetTotal( Order order );