public static void PlaceOrder()
        {
            var temp = getItem(new List <string> {
                "Place order", "Edit"
            }, "Continue");

            if (temp == "Edit")
            {
                CustomerUI();
            }
            else if (temp == "Place order")
            {
                if (order.TotalCost <= 250 && order.Pizzas.Count <= 50)
                {
                    _storeSingleton.AddOrder(order);
                    System.Console.WriteLine("Your order has been placed.");
                    order = new Order();
                }
                else
                {
                    System.Console.WriteLine("Make sure TotalCost is <= 250");
                    System.Console.WriteLine("AND pizzas count is <= 50");
                    CustomerUI();
                }
            }
            else
            {
                Console.WriteLine("Invalid input");
            }
        }
Exemple #2
0
 public static bool PlaceOrder()
 {
     if (ValidateOrderTime() == false)
     {
         System.Console.WriteLine("** ATTENTION **");
         System.Console.WriteLine("A new order can not be placed within 2 hours of your previous order");
         return(true);
     }
     else if (_orderSingleton.TotalCost <= 250 && _orderSingleton.Pizzas.Count <= 50)
     {
         _storeSingleton.AddOrder(_orderSingleton.Store, _orderSingleton);
         System.Console.WriteLine("\nThankyou " + _orderSingleton.Customer.Name + "! Your order has been placed.");
         return(false);
     }
     else
     {
         System.Console.WriteLine("\n** ATTENTION **");
         System.Console.WriteLine("Your order Exceeds order limit of $250 or the maximum of 50 pizzas, please remove Items before subbmitting your order");
         return(true);
     }
 }