// GET: Seats/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var seat = await _context.Seat .SingleOrDefaultAsync(m => m.Id == id); //Pass information over so it can be sent to database and used in other categories BookingSystemDTO bookingsystemdto = new BookingSystemDTO(); mySeat mySeat = new mySeat(); mySeat.Id = seat.Id; DatabaseManager.BookingId = seat.BookingId; mySeat.SeatNumber = seat.SeatNumber; var allseats = _context.Seat.ToList(); bookingsystemdto.seats = allseats; bookingsystemdto.mySeat = mySeat; if (seat == null) { return(NotFound()); } return(View(bookingsystemdto)); }
// GET: Performances/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var performances = await _context.Performances .SingleOrDefaultAsync(m => m.Id == id); //Pass information over so it can be sent to database and used in other categories BookingSystemDTO bookingsystemdto = new BookingSystemDTO(); myPerformance myPerformances = new myPerformance(); DatabaseManager.PerformanceId = performances.Id; DatabaseManager.ShowId = performances.ShowId; var allperformances = _context.Performances.ToList(); bookingsystemdto.performances = allperformances; bookingsystemdto.myPerformances = myPerformances; if (performances == null) { return(NotFound()); } return(View(performances)); }
// GET: Bookings/Details/5 public async Task<IActionResult> Details(int? id) { if (id == null) { return NotFound(); } var booking = await _context.Booking .SingleOrDefaultAsync(m => m.Id == id); //Pass information over so it can be sent to database and used in other categories BookingSystemDTO bookingsystemdto = new BookingSystemDTO(); myBooking myShows = new myBooking(); DatabaseManager.BookingId = booking.Id; myShows.PerformanceId = booking.PerformanceId; myShows.Name = booking.Name; myShows.Email = booking.Email; myShows.NumberFullPrice = booking.NumberFullPrice; myShows.NumberConcessionPrice = booking.NumberConcessionPrice; myShows.StoreEmail = booking.StoreEmail; myShows.TotalCost = (booking.NumberFullPrice * 30) + (booking.NumberConcessionPrice * 25); DatabaseManager.NumberOfSeats = booking.NumberFullPrice + booking.NumberConcessionPrice; //DatabaseManager.BookingId = (int)id; var allbookings = _context.Booking.ToList(); bookingsystemdto.bookings = allbookings; bookingsystemdto.myBooking = myShows; if (booking == null) { return NotFound(); } return View(bookingsystemdto); }
public async Task<IActionResult> Create([Bind("Id,PerformanceId,Name,Email,NumberFullPrice,NumberConcessionPrice,StoreEmail,TotalCost")] Booking booking) { BookingSystemDTO bookingsystemdto = new BookingSystemDTO(); myBooking myShows = new myBooking(); if (ModelState.IsValid) { _context.Add(booking); await _context.SaveChangesAsync(); return RedirectToAction("Details", new {booking.Id }); } return View(booking); }
// GET: Shows/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var shows = await _context.Shows .SingleOrDefaultAsync(m => m.Id == id); //Pass information over so it can be sent to database and used in other categories BookingSystemDTO bookingsystemdto = new BookingSystemDTO(); myShow myShows = new myShow(); DatabaseManager.ShowId = shows.Id; DatabaseManager.ShowName = shows.Name; myShows.EndDate = shows.EndDate; DatabaseManager.FullPrice = shows.FullPrice; DatabaseManager.ConcessionPrice = shows.ConcessionPrice; var allshows = _context.Shows.ToList(); bookingsystemdto.shows = allshows; bookingsystemdto.myShows = myShows; //var shows = await _context.Shows // .SingleOrDefaultAsync(m => m.Id == id); if (shows == null) { return(NotFound()); } return(View(shows)); }