public static void FillBooking(Booking booking, SqlDataReader reader) { booking.BookingId = reader.GetInt32(reader.GetOrdinal("Booking_id")); booking.HotelNo = reader.GetInt32(reader.GetOrdinal("Hotel_No")); int id = reader.GetInt32(reader.GetOrdinal("Guest_No")); booking.Guest = DataBases.Access <Guest>(BaseNames.BaseHotel, "Guest").GetOne(FillGuest, GuestsController.PrimaryKeys(id)); booking.DateFrom = reader.GetDateTime(reader.GetOrdinal("Date_From")); booking.DateTo = reader.GetDateTime(reader.GetOrdinal("Date_To")); int roomNo = reader.GetInt32(reader.GetOrdinal("Room_No")); booking.Room = DataBases.Access <Room>(BaseNames.BaseHotel, "Room") .GetOne(FillRoom, RoomsController.PrimaryKeys(roomNo, booking.HotelNo)); }