public void Booking(Cineplex Cpl, string Day, Schedule Sch) { try { if (Sch.GetAvailSeats() == 0) { Console.WriteLine("Booking is full"); } else { int qty = SelectBooking(Sch); Booking b; int Seats = 0; if (Sch.CheckViewer(qty) && qty != -1) { b = new Booking(Cpl, Sch); b.Seats = qty; Cpl.Book(b); Seats = b.Seats; Sch.SetAvailSeats(Seats); Console.WriteLine(Seats + " Seats have been added"); da.SetSeats(Cpl.GetCineplex(), Day, Sch.GetTime(), Sch.GetMovie().GetMovieName(), Sch.GetAvailSeats()); } else if (!Sch.CheckViewer(qty)) if (qty > Sch.GetAvailSeats()) { Console.WriteLine("Seats are greater than available Seats"); } Console.WriteLine("availSeats" + Sch.GetAvailSeats()); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public void Book(Booking b) { lstbook.Add(b); }