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 lFree
nageswaragunupudi wrote:No need to open oSearchDB again. We can check with the main database object itself like this.
- Code: Select all Expand view
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 58 guests