예제 #1
0
        public int GetOrderNumberIfExists(DateTime date)
        {
            var orderManager = new OrderManager();

            do
            {
                int orderNumber = AskOrderNumber();

                var orderIsThere = orderManager.OrderExists(orderNumber, date);

                if (orderIsThere)
                {
                    return orderNumber;
                }
                else
                {
                    Console.WriteLine("Order does not exist.");
                    var answer = Confirmation("Would you like to try again?");

                    if (answer == true)
                    {
                        continue;
                    }
                    else
                    {
                        MainMenuWF mainMenu = new MainMenuWF();
                        mainMenu.Execute();
                    }
                }
            } while (true);
        }