Exemplo n.º 1
0
 /// <summary>
 /// отмена заказа
 /// </summary>
 /// <param name="customer"></param>
 /// <returns></returns>
 public virtual bool CancelOrder(Customer customer)
 {
     List<Coin> change = CountChange(null, DBalance);
     if (customer.GetCoins(change))
     {
         Wallet.RemoveItems(a => change.Contains(a));
         DBalance = 0;
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 /// <summary>
 /// продаем товар
 /// </summary>
 /// <param name="sellItem"></param>
 /// <param name="customer"></param>
 /// <returns></returns>
 private bool _SellTheItem(GoodsItem sellItem, Customer customer)
 {
     List<Coin> change;
     if (customer.GetTheGood(sellItem))
     {
         GoodsStorage.RemoveItems(a => a == sellItem);
         change = CountChange(sellItem, DBalance);
     }
     else
     {
         change = CountChange(null, DBalance);
     }
     if (customer.GetCoins(change))
     {
         Wallet.RemoveItems(a => change.Contains(a));
         DBalance = 0;
         NewMessage("Thank you!");
         return true;
     }
     return false;
 }