示例#1
0
 public void AddCartBeverage(int beverageId)
 {
     if (_beverage.ValidateIfBeverageExist(beverageId))
     {
         _customer.Beverages.Add(_beverage.AddCartBeverage(beverageId));
         GetCustomerAddedCart(_customer);
         Console.Write("\n Added to cart. Want to add more?  [press y for yes/press any to cancel] ");
         var tryAgain = Console.ReadLine();
         if (tryAgain == "y")
         {
             OrderBeverages();
         }
         else
         {
             CalculateTheOrder(_customer.GetTotalAmount(_customer), _customer.GetAllBeveragePriceAdded(_customer));
         }
     }
     else
     {
         Console.Write("\n Your order is not on the list: ");
         OrderBeverages();
     }
 }