Пример #1
0
        public void Execute()
        {
            var userQuestions = new UserQuestions();
            var orderManager = new OrderManager();
            var displayWF = new DisplayOrdersWF();

            var date = userQuestions.GetDateIfValidFile();

            var orderNumber = userQuestions.GetOrderNumberIfExists(date);

            var order = orderManager.LoadOrder(orderNumber, date);

            Console.WriteLine("This is the order you wish to remove:");
            Console.WriteLine("-----------------------------------");
            displayWF.PrintSingleOrder(order);

            bool wishToRemove = userQuestions.Confirmation("\nAre you sure you wish to delete this order?");

            if (wishToRemove)
            {
                orderManager.RemoveOrder(orderNumber, date);
                Console.WriteLine("You successfully removed the order.");
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
            }
            else
            {
                Console.WriteLine("The order was not removed.");
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
            }
        }