public static void ListTouristsByCountry(string countryName) { Console.Clear(); Console.WriteLine(Header()); Console.WriteLine(ListTouristsMenu()); Console.WriteLine($"Tourists from {countryName}:" + Environment.NewLine); Services.TouristService touristService = new Services.TouristService(); foreach (Tourist tourist in touristService.ShowAllTouristsByCountryTheyComeFrom(countryName)) { Console.WriteLine(tourist.ToString()); } Console.WriteLine(GoBackMessage()); }
//finished private void RunListTouristsByCountry() { Display.PrintListTouristsByCountry(); string country = Console.ReadLine(); Services.TouristService touristService = new Services.TouristService(); try { touristService.ShowAllTouristsByCountryTheyComeFrom(country); Display.ListTouristsByCountry(country); } catch (Exception ex) { Display.PrintErrorScreen(); Console.WriteLine(ex.Message); Console.WriteLine(Display.GoBackMessage()); } Console.ReadKey(true); }