Beispiel #1
0
        private void btn_payment_Click(object sender, RoutedEventArgs e)
        {
            int orderID = Convert.ToInt32(listOrders.SelectedValue);

            order           = db.OrdersToReservations.FirstOrDefault(x => x.Id == orderID);
            order.IsPayment = true;
            db.SaveChanges();
            GetListOrder();
        }
Beispiel #2
0
 private void listUsers_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         grdLastInfo.Visibility = System.Windows.Visibility.Visible;
         user = (Users)listUsers.SelectedItem;
         List <OrdersToReservations> ordersList = db.OrdersToReservations.Where(x => x.UserID == user.Id).ToList();
         OrdersToReservations        lastOrder  = new OrdersToReservations();
         lastOrder              = ordersList.Last();
         lbl_DateStart.Content  = lastOrder.DateStart;
         lbl_DateEnd.Content    = lastOrder.DateEnd;
         listOrders.ItemsSource = GetGridInfo(ordersList);
     }
     catch { grdLastInfo.Visibility = System.Windows.Visibility.Collapsed; }
 }