示例#1
0
        private static void Main(string[] args)
        {
            //ILogger log = new FileLogger("log.txt");
            ILogger log = new ConsoleLogger();

            var hotelCreator = new HotelCreator();
            var hotelManager = new HotelManager(log);

            // add hotels
            var hotel1 = hotelCreator.CreateAHotel();

            hotelManager.AddHotel(hotel1);

            log.Log($"Am citit hotel {hotel1.Name}");

            //var hotel2 = hotelCreator.CreateAHotel();
            //hotelManager.AddHotel(hotel2);

            //var hotel3 = hotelCreator.CreateAHotel();
            //hotelManager.AddHotel(hotel3);

            // delete hotel
            hotelManager.PrintHotels();
            hotelManager.DeleteHotelFromCity(hotel1.Name, hotel1.City);
            hotelManager.PrintHotels();

            log.Log("Am sters un hotel");

            // rooms below amount
            //Console.Write("Enter the min amount for rooms: ");
            //int amount = int.Parse(Console.ReadLine());
            //hotelManager.ShowRoomsBelow(amount);
        }
        private static void Main(string[] args)
        {
            var hotelCreator = new HotelCreator();
            var hotelManager = new HotelManager();

            // add hotels
            var hotel1 = hotelCreator.CreateAHotel();

            hotelManager.AddHotel(hotel1);

            var hotel2 = hotelCreator.CreateAHotel();

            hotelManager.AddHotel(hotel2);

            var hotel3 = hotelCreator.CreateAHotel();

            hotelManager.AddHotel(hotel3);

            // delete hotel
            hotelManager.PrintHotels();
            hotelManager.DeleteHotelFromCity(hotel1.Name, hotel1.City);
            hotelManager.PrintHotels();

            // rooms below amount
            Console.Write("Enter the min amount for rooms: ");
            int amount = int.Parse(Console.ReadLine());

            hotelManager.ShowRoomsBelow(amount);
        }