예제 #1
0
        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());
        }
예제 #2
0
        //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);
        }