Assignment 2
Create Detail Page to Book a Room

Create the ‘BookingDetail’ web screen.


  • Besides the Booking, add also the Room to the aggregate;
  • Add the 'New Booking' link to 'Bookings';
  • Use a Form to get booking inputs;
  • The Get Available Room button tries to get the cheapest room for the booking conditions and shows the information about the room:

SELECT {Room}.*

FROM {Room}

WHERE @NumberOfAdults > 0

and {Room}.[AdultsCapacity] >= @NumberOfAdults

and {Room}.[AdultsCapacity] + {Room}.[ChildrenCapacity] >= @NumberOfAdults + @NumberOfChildren

and not exists

    (SELECT 1

    FROM {Booking}

    WHERE {Booking}.[RoomId] = {Room}.[Id]

    and (@CheckInDate between {Booking}.[CheckInDate] and {Booking}.[CheckOutDate]-1

        or @CheckOutDate between {Booking}.[CheckInDate]+1 and {Booking}.[CheckOutDate])

    and {Booking}.[StatusId] <> @CanceledStatus)

ORDER BY {Room}.[Price] ASC

  • Add input parameters to pass the values from the Form variable;

 Doubts about the meaning of CanceledStatus? Check Checkpoint Q&A #1 to know more!

  • Set the room information in the Form variable:
    • Bookings: set the RoomId and Room Price;
    • Room: set the Room Number.

Want to recap what should go into a complete Booking record? Check Checkpoint Q&A #1 to know more.

Checkpoint Q&amp;A #1
Checkpoint Q&amp;A #2
Checkpoint Q&amp;A #3
Checkpoint Q&amp;A #4
Reuse Functionality between Application Modules (cont.)