Exemple #1
0
        private void AddSingleAirportToList(List <Airport> listOfAirports)
        {
            bool isAirportCorrect = false;

            while (isAirportCorrect == false)
            {
                var airport = airportService.GetAirportByName
                              (
                    communicator.AskUserForString("NAZWA LOTNISKA")
                              );
                if (airport != null)
                {
                    isAirportCorrect = true;
                    listOfAirports.Add(airport);
                    Console.WriteLine($"Dodano lotnisko {airport.Name} do trasy przelotu");
                }
                else
                {
                    communicator.PrintWrongInputMessage();
                }
            }
        }