Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RoomGuests room1Guests = new RoomGuests(adults: 2, childs: 1);
- RoomGuests room2Guests = new RoomGuests(adults: 2, childs: 1);
- List<RoomType> availibleRoomTypes1 = HotelSystem.Reservations.GetAvailibleRoomTypes(room1Guests);
- List<RoomType> availibleRoomTypes2 = HotelSystem.Reservations.GetAvailibleRoomTypes(room2Guests);
- //select a room type
- RoomType roomType1 = availibleRoomTypes1.First();
- RoomType roomType2 = availibleRoomTypes2.First();
- List<RoomTypeReservation> roomInterests = new List<RoomTypeReservation>
- {
- new RoomTypeReservation(roomType: roomType1, responsible: "David",guests: room1Guests),
- new RoomTypeReservation(roomType: roomType2, responsible: "Omar", guests: room2Guests)
- };
- PaymentDetails paymentDetails = new PaymentDetails();
- Reservation reservation = HotelSystem.Reservations.Create(roomInterests, paymentDetails, payNow: false);
- int reservationNumber = reservation.number;
- //Find Davids room type reservation - alternative 1
- reservation = HotelSystem.Reservations.Find(reservationNumber);
- RoomTypeReservation roomTypeReservation = reservation.GetRoomTypeReservationByResponsible("David");
- //Find Davids room type reservation - alternative 2
- roomTypeReservation = HotelSystem.Reservations.FindRoomTypeReservation(reservationNumber,"David");
- //Find Davids room type reservation - alternative 3
- roomTypeReservation = HotelSystem.Reservations.FindRoomTypeReservation(personalNumber:"930816-xxxx");
- //Check in Davids room
- RoomBooking roomBooking = HotelSystem.RoomBookings.CheckIn(roomTypeReservation);
- int roomNumber = roomBooking.Room.Number;
- //Check out Davids room
- roomBooking = HotelSystem.RoomBookings.Find(roomNumber);
- HotelSystem.RoomBookings.CheckOut(roomBooking);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement