private void OnDeleteFlightEventRaise(object sender, FlightFieldsEventArgs e) { Flight flight = _airport.FindByNumber(e.FlightNumber); if (flight != null) { _airport.DeleteFlight(flight); } else { _view.PrintError("The flight is not exsist"); } }
public void DeleteMenu() { { Console.WriteLine("Press 1. If you want delete passenger\nPress 2. If you want delete flight"); ConsoleKeyInfo key = Console.ReadKey(); Console.Clear(); switch (key.Key) { case ConsoleKey.D1: case ConsoleKey.NumPad1: airport.DeletePassenger(); break; case ConsoleKey.D2: case ConsoleKey.NumPad2: airport.DeleteFlight(); break; } Console.ReadKey(); Menu(); } }