SHOW:
|
|
- or go back to the newest paste.
1 | - | RoomGuests room1 = new RoomGuests(adults: 2, childs: 1); |
1 | + | RoomGuests room1Guests = new RoomGuests(adults: 2, childs: 1); |
2 | - | RoomGuests room2 = new RoomGuests(adults: 2, childs: 1); |
2 | + | RoomGuests room2Guests = new RoomGuests(adults: 2, childs: 1); |
3 | ||
4 | - | List<RoomType> availibleRoomTypes1 = HotelSystem.Reservations.GetAvailibleRoomTypes(room1); |
4 | + | List<RoomType> availibleRoomTypes1 = HotelSystem.Reservations.GetAvailibleRoomTypes(room1Guests); |
5 | - | List<RoomType> availibleRoomTypes2 = HotelSystem.Reservations.GetAvailibleRoomTypes(room2); |
5 | + | List<RoomType> availibleRoomTypes2 = HotelSystem.Reservations.GetAvailibleRoomTypes(room2Guests); |
6 | ||
7 | //select a room type | |
8 | RoomType roomType1 = availibleRoomTypes1.First(); | |
9 | RoomType roomType2 = availibleRoomTypes2.First(); | |
10 | ||
11 | List<RoomTypeReservation> roomInterests = new List<RoomTypeReservation> | |
12 | { | |
13 | - | new RoomTypeReservation(roomType: roomType1, responsible: "David", guests: 2), |
13 | + | new RoomTypeReservation(roomType: roomType1, responsible: "David",guests: room1Guests), |
14 | - | new RoomTypeReservation(roomType: roomType2, responsible: "Omar", guests: 3) |
14 | + | new RoomTypeReservation(roomType: roomType2, responsible: "Omar", guests: room2Guests) |
15 | }; | |
16 | ||
17 | PaymentDetails paymentDetails = new PaymentDetails(); | |
18 | ||
19 | Reservation reservation = HotelSystem.Reservations.Create(roomInterests, paymentDetails, payNow: false); | |
20 | ||
21 | int reservationNumber = reservation.number; | |
22 | ||
23 | //Find Davids room type reservation - alternative 1 | |
24 | reservation = HotelSystem.Reservations.Find(reservationNumber); | |
25 | RoomTypeReservation roomTypeReservation = reservation.GetRoomTypeReservationByResponsible("David"); | |
26 | ||
27 | //Find Davids room type reservation - alternative 2 | |
28 | roomTypeReservation = HotelSystem.Reservations.FindRoomTypeReservation(reservationNumber,"David"); | |
29 | ||
30 | //Find Davids room type reservation - alternative 3 | |
31 | roomTypeReservation = HotelSystem.Reservations.FindRoomTypeReservation(personalNumber:"930816-xxxx"); | |
32 | ||
33 | //Check in Davids room | |
34 | RoomBooking roomBooking = HotelSystem.RoomBookings.CheckIn(roomTypeReservation); | |
35 | int roomNumber = roomBooking.Room.Number; | |
36 | ||
37 | //Check out Davids room | |
38 | roomBooking = HotelSystem.RoomBookings.Find(roomNumber); | |
39 | HotelSystem.RoomBookings.CheckOut(roomBooking); |