Ejemplo n.º 1
0
        /// <summary>
        /// Handles adding orders to the database using the dataAccessService
        /// </summary>
        void AddOrder()
        {
            //fill out the new order before sending it off
            Order NewOrder = new Order();

            NewOrder.Customer   = SelectedCustomer;
            NewOrder.CustomerID = SelectedCustomer.CustomerID;
            NewOrder.ItemsTotal = NewOrderTotal;
            NewOrder.OrderDate  = NewOrderDate;
            if (SelectedNewOrderStatus == OrderStatusChoices[0])
            {
                NewOrder.OrderStatus = 1;
            }
            else if (SelectedNewOrderStatus == OrderStatusChoices[1])
            {
                NewOrder.OrderStatus = 2;
            }
            else
            {
                NewOrder.OrderStatus = 3;
            }

            _dataAccessService.AddNewOrder(NewOrder);
            GetCustomerOrders();
        }