コード例 #1
0
 public void OrderHistory()
 {
     foreach (var item in _orderBL.GetOrder())
     {
         Console.WriteLine(item.ToString());
     }
     Console.WriteLine("Press any key to continue");
     Console.ReadLine();
 }
コード例 #2
0
        private void PlaceOrders()
        {
            //Customer customer = SearchCustomer();
            Location location = SearchBranch();

            //loction --> inventory --> product (locationId)

            //Todo
            //Display a list of product avaiable products in the selected store
            DisplayProducts(location);

            //ToDo - change date to timestamp instead of input
            DateTime orderDate = _validate.ValidateDate("Enter the order date [yyyy-mm-dd]:");
            //DateTime orderDate = new DateTime();
            Order newOrder     = new Order(orderDate);
            Order createdOrder = _orderBL.AddOrder(customer, location, newOrder);
            Order curOrder     = _orderBL.GetOrder(customer, location, newOrder);

            decimal total = 0;
            string  input;

            total += AddItem(curOrder);
            Console.WriteLine($"Current Total: {total}");
            input = _validate.ValidateValidCommand("More items to add? \n\t[Y] - continue \n\t[N] - proceed order");

            while (input.ToLower() != "n")
            {
                total += AddItem(curOrder);
                Console.WriteLine($"Current Total: {total}");
                input = _validate.ValidateValidCommand("More items to add? \n\t[Y] - continue \n\t[N] - proceed order");
            }

            //To-Do add timestamp to find the order
            _orderBL.UpdateOrderTotal(curOrder, total);
            Console.WriteLine("Order has been placed successfully");
            Console.WriteLine("====================================================");
            Console.WriteLine($"Here is the Order Details for {customer.FullName} \n\tOrderID: {curOrder.Id} Total: ${total} Location: {location.Name}");
            ViewOrderDetails(curOrder);
            Console.WriteLine("====================================================");
        }