/// <summary> /// Author: Jared Greenfield /// Created On: 2019-04-30 /// Creates the customer receipt in html /// </summary> private string generateReportHTML() { String filepath = AppDomain.CurrentDomain.BaseDirectory + @"../../../Receipts"; Reservation reservation = _reservationManager.RetrieveReservation(_reservationID); Member member = _memberManager.RetrieveMember(reservation.MemberID); List <OfferingVM> allOfferings = _offeringManager.RetrieveAllOfferingViewModels(); MemberTab tab = _tabManager.RetrieveLastMemberTabByMemberID(member.MemberID); // Removed because CSS wouldn't be included if they didn't choose correct folder. // Possible future feature, maybe specify static CSS location. //Instead of using a static folder, let the user pick folder //CommonOpenFileDialog dialog = new CommonOpenFileDialog(); //dialog.InitialDirectory = "C:\\Users"; //dialog.IsFolderPicker = true; //if (dialog.ShowDialog() == CommonFileDialogResult.Ok) //{ // filepath = dialog.FileName; //} // Create the file name string fileName = @"\" + reservation.DepartureDate.ToShortDateString().Replace("/", "-") + member.Email + ".html"; var result = _checkoutReceiptManager.generateMemberTabReceipt(reservation, member, allOfferings, tab, filepath + fileName, _allGuests); System.Diagnostics.Process.Start("IExplore.exe", filepath + fileName); return(filepath + fileName); }
/// <summary> /// Author: Matt LaMarche /// Created : 1/31/2019 /// The function which runs when a reservation is double clicked /// </summary> private void dgReservations_MouseDoubleClick(object sender, MouseButtonEventArgs 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); } } }