Exemple #1
0
        static void Main(string[] args)
        {
            HotelRoomBase hrb = new HotelRoomBase();
            var rooms = hrb.GetRooms();
            var availableRooms = hrb.GetAvailableRooms(DateTime.Today.AddDays(1), DateTime.Today.AddDays(51));

            Parallel.ForEach(rooms, room =>
                Console.WriteLine("Found Room : " + room.Name + "..." + "Available: " + availableRooms.Contains(room))
                );

            Console.ReadLine();
            //RoomType rt = new RoomType();
               // rt.HotelRoomType = "Double Room";

            //HotelBase ho = new HotelBase();
            //Console.WriteLine("Creating Hotel...");
            //Hotel.Monitor.Entities.Hotel h = new Hotel.Monitor.Entities.Hotel();

            //Console.WriteLine("Enter the hotel Name you want to create");
            //string hName = Console.ReadLine();
            //h.Name = hName;

            //ho.CreateHotel(h);

            //Console.WriteLine("Hotel Created with Name " + h.Name);

            //h.Name = "Huli Test Hotel";
            //h.HotelDescription = "Hotel in the bundus";
            //ho.CreateHotel(h);
            Console.WriteLine("Finished Creating Hotel");
            Console.ReadLine();
        }
        public MainWindowViewModel()
        {
            HotelRoomBase hrb = new HotelRoomBase();
            FullReservationList = hrb.GetRooms();
            //FullReservationList = new List<Room>()
            //{
            //    new Room { ReservationId = 1, viewModel = this, Breakfast = false, Description = "Beautifull double bedroom overlooking the ocean sunset", Parking = false, Price = 500, Reserved = false, Type = "Double", CanReserve = true},
            //    new Room { ReservationId = 2, viewModel = this, Breakfast = false, Description = "Deluxe room overlooking the ocean sunset. Sleeps maximum of 2 people. Has shower, fridge and DSTV", Parking = false, Price = 250, Reserved = false, Type = "Single", CanReserve = true},
            //    new Room { ReservationId = 3, viewModel = this, Breakfast = false, Description = "Beautifull double bedroom overlooking the ocean sunset", Parking = false, Price = 500, Reserved = false, Type = "Double", CanReserve = true},
            //    new Room { ReservationId = 4, viewModel = this, Breakfast = false, Description = "Beautifull family bedroom overlooking the ocean sunset", Parking = false, Price = 750, Reserved = false, Type = "Family", CanReserve = true},
            //    new Room { ReservationId = 5, viewModel = this, Breakfast = false, Description = "Beautifull single bedroom overlooking the ocean sunset", Parking = false, Price = 200, Reserved = false, Type = "Single", CanReserve = true}
            //};

            NumRoomsAvailable = FullReservationList.Count;

            RoomReservations = FullReservationList;
            this.NewCustomer = new Hotel.Monitor.Entities.Customer();

            NumberOfPersonsList = new List<int>()
            {
                1,2,3,4,5,6
            };

            TitlesList = new List<string>()
            {
                "Mr", "Mrs", "Miss", "Dr"
            };

            RoomTypeBase rtb = new RoomTypeBase();
            ReservationTypes = rtb.GetTypes();
            //ReservationTypes = new List<string>()
            //{
            //    "All", "Single", "Double", "Family", "Deluxe"
            //};

            this.NewReservation = new Hotel.Monitor.Entities.Reservation();
            NewReservation.FromDate = DateTime.Today;
            NewReservation.ToDate = DateTime.Today;
        }
 private void CheckAvailability()
 {
     HotelRoomBase hrb = new HotelRoomBase();
     FullReservationList = hrb.GetAvailableRooms(NewReservation.FromDate, NewReservation.ToDate);
     RoomReservations = FullReservationList;
     NumRoomsAvailable = FullReservationList.Count;
 }