Silvio,
What Nages wrote is a version of the IsFree() function mentioned in the psuedo code in my previous message. You still need the rest of the logic in my sample pseudo code.
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Silvio,
What Nages wrote is a version of the IsFree() function mentioned in the psuedo code in my previous message. You still need the rest of the logic in my sample pseudo code.
James
James Bott wrote:Silvio,
What Nages wrote is a version of the IsFree() function mentioned in the psuedo code in my previous message. You still need the rest of the logic in my sample pseudo code.
James
Function Search_Element(cCamera,dCheck_in,dCheck_out,cTypeRoom,oReserva)
local cSearch := oReserva:ApplyParams( "ROOMS_ID == ? .AND. ALLTRIM(TYPE) == ? .AND. RECNO() != ? .AND. (CHECK_IN > ? .OR. CHECK_OUT < ? )", ;
{ cCamera, ALLTRIM( cTypeRoom ), oReserva:RecNo(), dCheck_out, dCheck_in } )
if oReserva:LookUp( cSearch, nil, { || .T. } ) == .T.
? "room is available"
lFree:=.t.
else
? "room is not availble"
lFree:=.f.
endif
return lFreeSilvio,
Great.
Did you understand my explanation about how to handle shortening a reservation?
nageswaragunupudi wrote:No need to open oSearchDB again. We can check with the main database object itself like this.
cSearch := oReserva:ApplyParams( "ROOM_ID == ? .AND. ALLTRIM(TYPE) == ? .AND. RECNO() != ? .AND. (CHECK_IN > ? .OR. CHECK_OUT < ? )", ; { cCamera, ALLTRIM( cTypeRoom ), oReserva:RecNo(), dCheckOut, dCheckIn } ) if oReserva:LookUp( cSearch, nil, { || .T. } ) == .T. ? "room is available" else ? "room is not availble" endif