Hello James,
>available rooms are added to an array
I also need the exact dates when the room is available.
Sometimes guests have to make a room transfer. Saturday to Wednesday in room 100 the rest of the week in 1010, etc. .
Best regards,
Otto
Otto wrote:Hello James,
thank you for your answer.
The valid is on the Zimmer-Nr: - field (engl. Room number).
If the room is occupied the valid returns false and you can’t navigate back to change the
“Anreise” or “Abreise” (arrival/departure) .
Best regards,
Otto
#include "FiveWin.ch"
# include "common.ch"
function Main()
LOCAL oDlg, oGet[3]
LOCAL cCad := "Testing "
LOCAL nNum := 0
LOCAL dDat := Date(), lOk
Local LastGet
Set century On
Set Date Ansi
Set Date format "mm/dd/yyyy"
SET _3DLOOK ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet[1] VAR cCad OF oDlg SIZE 60, 10 COLOR "W/G" PICTURE "@K"
@ 1.8, 2 SAY "Number:" OF oDlg
@ 2, 6 GET oGet[2] VAR nNum OF oDlg SIZE 60, 10 PICTURE "9999999.99"
@ 2.6, 2 SAY "Date:" OF oDlg
@ 3, 6 GET oGet[3] VAR dDat PICTURE "@E" OF oDlg SIZE 60, 10 VALID (lOk .OR. ! EMPTY(dDat))
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
oGet[1]:bGotFocus := {||lOk := Test(oDlg,oGet[1],Lastget),Lastget:=oGet[1]}
oGet[2]:bGotFocus := {||lOk := Test(oDlg,oGet[2],Lastget),Lastget:=oGet[2]}
oGet[3]:bGotFocus := {||Test(oDlg,oGet[3],Lastget),Lastget:=oGet[3]}
ACTIVATE DIALOG oDlg CENTERED ON INIT LastGet:= oGet[1]
return nil
FUNC Test(oDlg,oGet,Lastget)
LOCAL Obj , i , j , k
FOR EACH Obj IN oDlg:aControls
i := Hb_EnumIndex()
IF Obj==oGet
j := i
END
IF Obj==Lastget
k := i
END
NEXT
IF k == 6 .AND. j < k // or ASCAN({2,4},j) > 0
RETURN .T.
END
RETURN .F. //(k<=j)
REDEFINE BUTTON oBtnEnd ID 2 OF oDlg ACTION (oDlg:end()) CANCEL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 90 guests