I am modifying a reservation
in the reservation I have two datepick controls dFirst and dLast
in Insertion I have no problems but
in modification if the operator changes a date I always have to carry out a search to see if there is a reservation and the function always restores me a true value because it also sees the same reservation which, however, is in modification.
If the operator enters dlast - 1 day the search function tells me that it is already in the archive
if the operator enters dLast + 1 the search function tells me that it is already in the archive
if the operator changes the whole period and the search finds a reservation, it returns me a true value
how can i make sure that the modification does not fall into this error?
this is the function
the dbf is index on oSearchDb:SetOrder("room_in" ) (ROOMS_ID + DToS( CHECK_IN ))
Someone can help me please ?
in the reservation I have two datepick controls dFirst and dLast
in Insertion I have no problems but
in modification if the operator changes a date I always have to carry out a search to see if there is a reservation and the function always restores me a true value because it also sees the same reservation which, however, is in modification.
If the operator enters dlast - 1 day the search function tells me that it is already in the archive
if the operator enters dLast + 1 the search function tells me that it is already in the archive
if the operator changes the whole period and the search finds a reservation, it returns me a true value
how can i make sure that the modification does not fall into this error?
this is the function
Function Search_Element(cCamera,dCheck_in,dCheck_out,cTypeRoom)
Local cRoom
local lFree:=.T.
local nBottomScope, nTopScope
local oSearchDb
local afatture:={}
oSearchDb:=TReserva():New()
oSearchDb:SetOrder("room_in" )
oSearchDb:GoTop()
nTopScope:=oSearchDb:ordScope( 0, cCamera )
nBottomScope:=oSearchDb:ordScope( 1, cCamera )
oSearchDb:GoTop()
do while ! oSearchDb:Eof()
IF ( dCheck_in <= oSearchDb:CHECK_OUT .AND. dCheck_out >= oSearchDb:CHECK_IN ;
.AND. AllTrim(oSearchDb:TYPE ) == AllTrim( cTypeRoom ))
lFree:=.f.
ENDIF
oSearchDb:Skip()
enddo
oSearchDb:ordScope(0,nTopScope)
oSearchDb:ordScope(1,nBottomScope)
oSearchDb:Close()
return lFreethe dbf is index on oSearchDb:SetOrder("room_in" ) (ROOMS_ID + DToS( CHECK_IN ))
Someone can help me please ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com