On Restaurant Appliation I control id the reservation day is equal to the day inserted from user ( when he want create the a new reservation)
Now the problem is another because on a day we can have many reservation for a table
sample if I have a reservation for the table 11 on the same day 13:45 of 22/008/2011
I cannot have a reservation for the same day for 14.30 or 12:45 because I must have a interval max of two hours for each customer
how I can make this control ?
CONTROL an HOUR
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Re: CONTROL an HOUR
Hello,
a suggestion:
convert the time reservation in day seconds o minutes period, then a new reservation period (2 hours) can't be inside the period of any previous reservation,
regards
Marcelo
a suggestion:
convert the time reservation in day seconds o minutes period, then a new reservation period (2 hours) can't be inside the period of any previous reservation,
regards
Marcelo
Re: CONTROL an HOUR
Do you think about use DateTime variables?
- MdaSolution
- Posts: 401
- Joined: Tue Jan 05, 2010 2:33 pm
Re: CONTROL an HOUR
HOw ?
Any sample please ?
I make
IF RESERVATION->(DbSeek( nTable))
IF RESERVATION->DATAIN==cday
msgAlert( i18n( "there is allready a reservation for this day." ))
IF RESERVATION->hor==aHour
msgAlert( i18n( "there is allready a reservation for this day.and for this Hour" ))
ENDIF
oBtnTav:Refresh( .T. )
RETURN lreg
ENDIF
ELSE
APPEND BLANK
RESERVATION->STATE :=5
RESERVATION->CUSTOMER:= cCustomer
RESERVATION->DATAIN := cday
RESERVATION->DATAFIN := cday
RESERVATION->HOR := aHour
RESERVATION->NUMTABLE := ntable
RESERVATION->TIPO := "O"
RESERVATION->(DbCommit())
cCaption_est := "Table n."+ str(ntable)+CRLF+;
"reservation day "+cf( cday)
oBtnTav:SetFile( TABLE_RESERVATION, TABLE_RESERVATION )
oBtnTav:cToolTip:= cCaption_est
Any sample please ?
I make
IF RESERVATION->(DbSeek( nTable))
IF RESERVATION->DATAIN==cday
msgAlert( i18n( "there is allready a reservation for this day." ))
IF RESERVATION->hor==aHour
msgAlert( i18n( "there is allready a reservation for this day.and for this Hour" ))
ENDIF
oBtnTav:Refresh( .T. )
RETURN lreg
ENDIF
ELSE
APPEND BLANK
RESERVATION->STATE :=5
RESERVATION->CUSTOMER:= cCustomer
RESERVATION->DATAIN := cday
RESERVATION->DATAFIN := cday
RESERVATION->HOR := aHour
RESERVATION->NUMTABLE := ntable
RESERVATION->TIPO := "O"
RESERVATION->(DbCommit())
cCaption_est := "Table n."+ str(ntable)+CRLF+;
"reservation day "+cf( cday)
oBtnTav:SetFile( TABLE_RESERVATION, TABLE_RESERVATION )
oBtnTav:cToolTip:= cCaption_est
FWH .. BC582.. xharbour