CREATE PROCEDURE dbo.OnlineRoomAddress @ARoomNumber INT,  @AOnlineRoomtypenumber INT, @AHotelNumber INT AS
SET NOCOUNT ON
/*
    Created by Troels Buch Nov 2008
    
	Changes:
	TB20081111: Changed name @AOnlineRoomtypenumber
	TB20081122: Changed RoomNumber to Number
    
	

    NOTES: 	- 
    @ARoomNumber = Real room number NOT Database key. 
*/

IF @ARoomNumber <> 0
BEGIN
   SELECT RoomNumber, Number, Name, RoomTypeNumber, Description, Notes FROM Rooms WITH (NOLOCK) WHERE IsNULL(Hotelnumber, 0) = @AHotelNumber AND Number = @ARoomNumber
   --SELECT RoomNumber, Number, Name, RoomTypeNumber, Description, Notes FROM Rooms (NOLOCK) WHERE IsNULL(Hotelnumber, 0) = @AHotelNumber AND RoomNumber = @ARoomNumber
   --print 'RoomNumber'
END
ELSE
BEGIN
   SELECT RoomNumber, Number, Name, RoomTypeNumber, Description, Notes FROM Rooms WITH (NOLOCK) WHERE IsNULL(Hotelnumber, 0) = @AHotelNumber AND RoomTypeNumber = @AOnlineRoomtypenumber
   AND Name <> ''
   AND Description <> ''

   --print 'RoomTypeNumber'
END
GO
