Пример #1
0
 public AnimalCentre()
 {
     animalFactory    = new AnimalFactory();
     hotelFactory     = new HotelFactory();
     procedureFactory = new ProcedureFactory();
     hotel            = hotelFactory.CreateHotel();
 }
Пример #2
0
        /// <summary>
        /// Create hotel on basis of user input
        /// </summary>
        static void CreateHotel()
        {
            Console.WriteLine("Creating Hotel..");
            Console.WriteLine("Enter Number of Floors");
            var floors = Console.ReadLine();

            Console.WriteLine("Main Corridors per floor");
            var mainCorridors = Console.ReadLine();

            Console.WriteLine("Sub Corridors per floor");
            var subCorridors = Console.ReadLine();

            HotelFactory.CreateHotel(Convert.ToInt32(floors), Convert.ToInt32(mainCorridors), Convert.ToInt32(subCorridors));
        }
 private void mnuItemHotelsCreate_Click(object sender, EventArgs e)
 {
     hotelFactory.CreateHotel();
 }