//finished private void RunListHotels() { Display.PrintListHotels(); Services.CountryService countryService = new Services.CountryService(); Services.TownService townService = new Services.TownService(); Services.HotelService hotelService = new Services.HotelService(); try { string countryName = Console.ReadLine(); countryService.GetCountryByName(countryName); Display.PrintListHotelsMiddle(); string townName = Console.ReadLine(); townService.GetTownByName(countryName, townName); Display.PrintListHotelsBottom(countryName, townName); hotelService.ShowAllHotelsInTown(countryName, townName); } catch (Exception ex) { Display.PrintErrorScreen(); Console.WriteLine(ex.Message); Console.WriteLine(Display.GoBackMessage()); } Console.ReadKey(true); }
public static void PrintListHotelsBottom(string countryName, string townName) { Console.Clear(); Console.WriteLine(Header()); Console.WriteLine(ListHotelsMenu()); Console.WriteLine($"Hotels in {townName}:" + Environment.NewLine); Services.HotelService hotelService = new Services.HotelService(); foreach (Data.Models.Hotel hotel in hotelService.ShowAllHotelsInTown(countryName, townName)) { Console.WriteLine(hotel.ToString()); } Console.WriteLine(GoBackMessage()); }