Пример #1
0
        public AdminOrdersWindow()
        {
            InitializeComponent();
            UniversalFunctions.setUpWindow(this);
            btnConfirmOrder.IsEnabled         = false;
            btnSeeUnconfirmedOrders.IsEnabled = false;

            dgOrders.DataContext = ServiceOrders.getOrdersToDisplay();
        }
Пример #2
0
        private void btnConfirmOrder_Click(object sender, RoutedEventArgs e)
        {
            DataRowView data        = (DataRowView)((Button)e.Source).DataContext;
            int         OrderID     = int.Parse(data["OrderID"].ToString());
            Boolean     isSuccesful = ServiceOrders.UpdateIsConfirmed(OrderID);

            if (isSuccesful)
            {
                dgOrderSpecs.DataContext  = null;
                btnConfirmOrder.IsEnabled = false;
                dgOrders.DataContext      = ServiceOrders.getOrdersToDisplay().DefaultView;
            }
            else
            {
                Console.WriteLine("error with confirming order");
            }
        }
Пример #3
0
 private void btnSeeAllOrders_Click(object sender, RoutedEventArgs e)
 {
     dgOrders.DataContext = ServiceOrders.getOrdersToDisplay().DefaultView;
 }