示例#1
0
        public string Order(Order order)
        {
            Drink drink = DrinkFactory.Create(order.Boisson);

            if (IsEnoughMoney(drink, order.Money))
            {
                _report.Add(order.Boisson);
                return(BuildCommand(drink, order.Sugar, order.Hot));
            }
            else
            {
                return(Message("Not enough money"));
            }
        }
示例#2
0
 public double CA()
 {
     return((from i in _dictionary let drink = DrinkFactory.Create(i.Key) select i.Value *drink.Price).Sum());
 }