public void AddSchedule(String Day, Schedule Schd) { try { if (Sch.Contains(Schd)) Console.WriteLine(Schd.GetSchedule() + "object exists"); this.Sch.Add(Schd); if (movSchedule == null) this.movSchedule.Add(Day, Sch); else if (movSchedule != null) movSchedule[Day] = Sch; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public int SelectBooking(Schedule Sch) { Console.WriteLine("how many tickets do you want to book (" + Sch.GetAvailSeats() + ") are available"); int Seats; string inp = Console.ReadLine(); while (!Int32.TryParse(inp.Trim(), out Seats)) { Console.WriteLine("select an integer from the list only"); inp = Console.ReadLine(); } Console.WriteLine("do you want to confirm " + Seats + "yes/no"); inp = Console.ReadLine(); while (!inp.ToLower().Equals("yes") && !inp.ToLower().Equals("no")) { Console.WriteLine("select yes or no only"); inp = Console.ReadLine().Trim(); } if (inp.Equals("yes")) { Console.WriteLine(Sch.GetSchedule()); } else { Console.WriteLine("selection dropped"); Seats = -1; } return Seats; }
public void PrintSchedule1(Schedule Sch) { // Sch.ToString(); Console.WriteLine(Sch.GetSchedule()); }