Exemplo n.º 1
0
        private static void NewCustomer()
        {
            bool localrestart = true;

            while (localrestart)
            {
                Console.WriteLine("Please input your name, or what you would like to be called by!");
                Customer nCust = new Customer(Console.ReadLine());
                Console.WriteLine($"You put {nCust.Name}, is that right? 1 to continue, or 2 to re-assign your name.");
                switch (Common.Answer(1, 2))
                {
                case 1:
                {
                    PizzaBoxContext.Save <Customer>(_context, nCust);
                    nCust        = PizzaBoxContext.CustomerReadString(nCust.Name, _context.Customers);
                    localrestart = false;
                    Console.WriteLine($"Your name, {nCust.Name}, has been saved! Your ID is: {nCust.EntityID}");
                    OrderCreation(nCust);
                    break;
                }

                case 2:
                {
                    break;
                }

                default:
                {
                    Console.WriteLine("You shouldn't be here, again.");
                    break;
                }
                }
            }//end while loop
        }
Exemplo n.º 2
0
 private static void ConfirmOrder(Order MyOrder)
 {
     Console.WriteLine($"Your order for {MyOrder.Customer.Name} at the {MyOrder.Store.name} contains:");
     for (int i = 0; i < MyOrder.Items.Count; i++)
     {
         Console.WriteLine($"{i + 1}: {MyOrder.Items[i].ToString()} - {MyOrder.Items[i].Price}");
     }
     Console.WriteLine($"For a total of: {MyOrder.OrderTotal}");
     PizzaBoxContext.Save(_context, MyOrder);
 }