private void btnAcceptOngoingBookingRequest_Click(object sender, RoutedEventArgs e) { try { OngoingBooking oB = dtgRequestedOngoingBookings.SelectedItem as OngoingBooking; oBHandler.AcceptOngoingBookingRequest(oB.Id, admin.Id); dtgRequestedOngoingBookings.SelectedItem = null; dtgRequestedOngoingBookings.ItemsSource = oBHandler.GetAllPendingOngoingBookings(); } catch (ArgumentNullException) { MessageBox.Show("You need to select a booking to accept it."); } }
public AdminWindow(Admin admin) { InitializeComponent(); this.admin = admin; oBHandler = new OngoingBookingsHandler(); sBHandler = new SingleBookingsHandler(); companyHandler = new CompanyHandler(); activityHandler = new ActivitiesHandler(); dtgRequestedOngoingBookings.ItemsSource = oBHandler.GetAllPendingOngoingBookings(); dtgRequestedSingleBookings.ItemsSource = sBHandler.GetAllPendingSingleBookings(); sections = new int[6] { 1, 2, 3, 4, 5, 6 }; cboNewActivitySectionsRequired.ItemsSource = sections; }