/// <summary> /// Author: Matt LaMarche /// Created : 1/31/2019 /// The function which runs when Add Reservation is clicked /// </summary> private void btnAddReservation_Click(object sender, RoutedEventArgs e) { var createReservation = new CreateReservation(_reservationManager); createReservation.ShowDialog(); refreshAllReservations(); populateReservations(); }
/// <summary> /// Author: Matt LaMarche /// Created : 2/08/2019 /// The function which runs when the view reservation button is clicked. /// It will launch the CreateReservation window in view mode with the option of updating the /// </summary> private void btnViewReservation_Click(object sender, RoutedEventArgs e) { if (dgReservations.SelectedIndex != -1) { Reservation selectedReservation = new Reservation(); try { selectedReservation = _reservationManager.RetrieveReservation(((VMBrowseReservation)dgReservations.SelectedItem).ReservationID); var readUpdateReservation = new CreateReservation(selectedReservation, _reservationManager); readUpdateReservation.ShowDialog(); refreshAllReservations(); populateReservations(); } catch (Exception ex) { MessageBox.Show("Unable to find that Reservation\n" + ex.Message); } } }