internal static void GetPassengerMenu(IFlight flight) { Console.WriteLine("Passenger menu."); Console.WriteLine("1. Add new passenger"); Console.WriteLine("2. Edit existed passenger"); Console.WriteLine("3. Delete passenger"); byte mode = 0;; bool TryByte = byte.TryParse(Console.ReadLine(), out mode); if (!TryByte) { Console.WriteLine("Incorrect input"); } else { switch (mode) { case 1: PassengerManager.AddPassenger(flight); break; case 2: PassengerManager.EditPassenger(flight); break; case 3: PassengerManager.DeletePassenger(flight.Passengers); break; default: Console.WriteLine("Incorrect input"); break; } } }