예제 #1
0
        //private List<Order> myVar = Orders;
        public void Execute()
        {
            CommonIO.ShowHeader("Lookup an order");

            List <Order> _allOrders = new List <Order>();
            DateTime     OrderDate  = ConsoleIO.AskForOrderDate();

            OrdrLkpResponses AllOrders = new OrdrLkpResponses();

            AllOrders = _manager.LoadOrders(OrderDate);

            _allOrders = AllOrders.Orders;

            Console.Clear();

            if (AllOrders.Success)
            {
                foreach (Order OneOrder in _allOrders)
                {
                    ConsoleIO.DisplayOrderDetails(OneOrder);
                }
                CommonIO.Continue();
            }
            else
            {
                CommonIO.MessageToUserInBlue(AllOrders.Message);
            }
        }
예제 #2
0
        public void Execute()
        {
            CommonIO.ShowHeader("Delete Order");
            DateTime OrderDateToDelete = ConsoleIO.AskForOrderDate();

            OrdrLkpResponses AllOrders = new OrdrLkpResponses();

            AllOrders = _manager.LoadOrders(OrderDateToDelete);

            if (AllOrders.Success)
            {
                _orders = AllOrders.Orders;
                int orderNumtoDelete = CommonIO.GetIntFromUser(1, 999, 0, "What order number would you like to delete?");
                DeleteOrder(OrderDateToDelete, orderNumtoDelete);
            }
            else
            {
                CommonIO.MessageToUserInBlue(AllOrders.Message);
            }
        }