Пример #1
0
 private static void PrintOrders(Pizzeria pizzeria)
 {
     Console.Clear();
     pizzeria.PrintOrders();
     Console.WriteLine("Press any key for continue...");
     Console.ReadKey();
 }
Пример #2
0
        private static void PrintClientMenu(Pizzeria pizzeria)
        {
            Console.Clear();

            Console.WriteLine("You can: ");
            Console.WriteLine("1) Make an order");
            Console.WriteLine("2) Check status of orders");
            Console.WriteLine("3) Go back");

            switch (InsertIntRange(1, 3))
            {
            case 1:
                pizzeria.AddOrder(CreateOrder());
                PrintClientMenu(pizzeria);
                break;

            case 2:
                PrintOrders(pizzeria);
                PrintClientMenu(pizzeria);
                break;

            case 3:
                PrintMainMenu(pizzeria);
                break;

            default:
                break;
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            Pizzeria pizzeria = new Pizzeria();

            PrintMainMenu(pizzeria);
            //PrintAdminMenu(pizzeria);
            Console.ReadKey();
        }
Пример #4
0
        private static void PrintMainMenu(Pizzeria pizzeria)
        {
            Console.Clear();
            Console.WriteLine("Welcome to EPAMIZZA, my friend!");
            Console.WriteLine("You can continue like: ");
            Console.WriteLine("1) Client");
            Console.WriteLine("2) Admin(or employee)");
            switch (InsertIntRange(1, 2))
            {
            case 1:
                PrintClientMenu(pizzeria);
                break;

            case 2:
                PrintAdminMenu(pizzeria);
                break;

            default:
                break;
            }
        }
Пример #5
0
        private static void PrintAdminMenu(Pizzeria pizzeria)
        {
            Console.Clear();
            PrintOrders(pizzeria);
            Console.WriteLine("Select order for change status. ");
            int   choose        = InsertPositiveInt();
            Order selectedOrder = null;

            while (true)
            {
                foreach (var item in pizzeria.Orders)
                {
                    if (item.GetId() == choose)
                    {
                        selectedOrder = item;
                    }
                }
                if (selectedOrder != null)
                {
                    break;
                }
                else
                {
                    Console.WriteLine("Incorrect input, try again");
                    PrintOrders(pizzeria);
                    choose = InsertPositiveInt();
                }
            }
            if (selectedOrder.GetStatusOrder() == StatusOrder.Cooking)
            {
                pizzeria.ReadyOrder(selectedOrder);
            }
            else if (selectedOrder.GetStatusOrder() == StatusOrder.Done)
            {
                pizzeria.FinishOrder(selectedOrder);
            }

            Console.WriteLine("Press any key for go to main menu");
            PrintMainMenu(pizzeria);
        }
Пример #6
0
 public void MakeAnOrder(Pizza pizza)
 {
     Console.WriteLine("Making an order");
     Pizzeria.StatusOrder(this.name, pizza);
 }