CONTROL an HOUR

CONTROL an HOUR

Postby MdaSolution » Mon Aug 22, 2011 8:52 am

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 ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: CONTROL an HOUR

Postby Marcelo Via Giglio » Mon Aug 22, 2011 2:19 pm

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
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: CONTROL an HOUR

Postby Patrizio » Mon Aug 22, 2011 3:34 pm

Do you think about use DateTime variables?
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: CONTROL an HOUR

Postby MdaSolution » Mon Aug 22, 2011 3:52 pm

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
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests