Example #1
0
        private List <Order> RetrieveOrderByDate(DateTime orderDate)
        {
            var ops      = new OrderOperations();
            var orders   = new List <Order>();
            var response = ops.GetOrder(orderDate);

            if (response.Success)
            {
                orders = response.OrderList;
            }
            else
            {
                Console.Clear();
                Console.WriteLine("╔═══════════════════════════════╗");
                Console.WriteLine("║            Error!             ║");
                Console.WriteLine("╚═══════════════════════════════╝");
                Console.WriteLine(response.Message);
                Console.WriteLine();
                Console.WriteLine("Press enter to go back.");
                Console.ReadLine();
                RemoveOrder();
            }

            return(orders);
        }
Example #2
0
        public void OrderInformationSearch(string dateToSearch)
        {
            OrderOperations orderOps = new OrderOperations(OrderRepositoryFactory.CreateOrderRepository());

            var returnedOrder = orderOps.GetOrder(dateToSearch);

            if (returnedOrder.IsValid)
            {
                _currentOrderList = returnedOrder.OrderInformation;

                DisplayOrderInformation();
            }
            else
            {
                Console.WriteLine();
                Console.WriteLine("No order with that date.");
                Console.WriteLine("Returning to the Main Menu.");
            }
        }