set safety off
set talk off
Set Date To Brit
Set Hour To 24
Set Notify Off
set century on
set clock off
set bell off
set status off
set safety off
set heading off
set echo off
set step off
set scoreboard off
set cursor off
set shadow on
SET ESCAPE OFF
SET NEAR ON 
SET DELETE ON
SET SAFETY  OFF
SET SYSMENU TO
SET SYSMENU OFF
SET TALK OFF
SET EXCLUSIVE OFF
Modi Window Screen Title 'เข้าโปรแกรม' Color RGB(,,,0,128,128) Close Float Grow Mini Zoom ICon File 'Bd_Start.Ico'
Clear All
If !File('Bd_Start.Dbf')
	Create Dbf Bd_Start (ProgMess C(30),ProgSele N(3))
	For I=1 To 6
		Append Blank 
	EndFor 
Endif 
Clear 
Close All
Do While .T.
	***
	SET SYSMENU TO
	SET SYSMENU OFF
	If Not WExist("Bd_Start")
		DEFINE WINDOW Bd_Start AT 0,0 SIZE 50,80 ;
		NOFLOAT NOCLOSE	NOMINIMIZE COLOR RGB(,,,0,128,128)
		Zoom Window Bd_Start Max
	Endif 
	ACTIVATE WINDOW Bd_Start
	****
	On Error 
	m.ProgChoice=7
	@ 0.000,0.000 GET m.ProgChoice ;
	PICTURE "@*VT .;.;.;.;.;.;ออกจากระบบ" SIZE 1.958,28.900,0.042 DEFAULT 1 ;
	FONT "Tahoma",14 STYLE "B"
	Read Cycle Modal When WProgCh()
	DeACTIVATE WINDOW Bd_Start
	If !Used('Bd_Start')
		Use Bd_Start In 0 Alias Bd_Start Exclu Noupdate 
	Endif 
	If Between(m.ProgChoice,1,6)
		Go m.ProgChoice
		mProgChoic=Bd_Start.ProgSele
	Else
		mProgChoic=999
	Endif 
	Clear 
	Do Case 
	***** ระบบโรงแรม
	Case mProgChoic=111  && Front ของ HD
		ExeProgRun="Do Master With 'HFR'"
		Do \Pos\Security\Prog\Exerun With "Do MasterF.Exe With 'HFR'","Master","MasterF"
		&ExeProgRun
	Case mProgChoic=112  && Manager ของ HD
		ExeProgRun="Do Master With 'HD'"
		Do \Pos\Security\Prog\Exerun With "Do MasterHO.Exe With 'HD'","Master","MasterHO"
		&ExeProgRun
	Case mProgChoic=121  && Front ของ AM
		ExeProgRun="Do Master With 'FRAM'"
		Do \Pos\Security\Prog\Exerun With "Do MasterAM.Exe With 'FRAM'","Master","MasterAM"
		&ExeProgRun
	Case mProgChoic=122  && Manager ของ AM
		ExeProgRun="Do Master"
		Do \Pos\Security\Prog\Exerun With "Do MasterAM.Exe","Master","MasterAM"
		&ExeProgRun
	Case mProgChoic=131  && Front ของ HO
		ExeProgRun="Do Master With 'FRO'"
		Do \Pos\Security\Prog\Exerun With "Do MasterF.Exe With 'FRO'","Master","MasterF"
		&ExeProgRun
	Case mProgChoic=132  && Manager ของ HO
		ExeProgRun="Do Master"
		Do \Pos\Security\Prog\Exerun With "Do MasterHO.Exe","Master","MasterHO"
		&ExeProgRun
	Case mProgChoic=140  && SC ของ HO
		PosProgRun="Do MasTer With 'SCU'"
		&PosProgRun
	Case mProgChoic=141  && กำหนดรหัส ของ HO
		PosProgRun="Do MasTer With 'QUI'"
		&PosProgRun
	***** ระบบร้านอาหารและ FOOD
	Case mProgChoic=201  && Cashier 
		PosProgRun="Do PosWin"
		&PosProgRun
	Case mProgChoic=202  && Manager
		ExeProgRun="Do PosWin With 'Bac'"
		Do \Pos\Security\Prog\Exerun With "Do PosWinB.Exe With 'Bac'","PosWin","PosWinB"
		&ExeProgRun
	Case mProgChoic=203  && Manager ชุด Small
		ExeProgRun="Do PosWin With 'SMA'"
		Do \Pos\Security\Prog\Exerun With "Do PosWinSM.Exe With 'SMA'","PosWin","PosWinSM"
		&ExeProgRun
	Case mProgChoic=204  && Manager ชุด Sme
		ExeProgRun="Do PosWin With 'Sme'"
		Do \Pos\Security\Prog\Exerun With "Do PosWinSE.Exe With 'Sme'","PosWin","PosWinSE"
		&ExeProgRun
	Case mProgChoic=240  && SC ระบบ POS
		PosProgRun="Do PosWin With 'SCU'"
		&PosProgRun
	Case mProgChoic=241  && กำหนดรหัส ระบบ POS
		PosProgRun="Do PosWin With 'QUI'"
		&PosProgRun
	***** SC
	Case mProgChoic=444
		PosProgRun="Do SC"
		&PosProgRun
	***** ออก
	Case mProgChoic=999
		Do Exit2BcUP In \Pos\Security\Prog\Exerun.Prg
		If Empty(Sys(2000,'*.Exe'))
			Exit 
		Else && มี โปรแกรม 
			Clear 
			Clear All
			Quit	
		Endif 
	EndCase
EndDo 
Clear All
On ShutDown 
On Error 
Set SysMenu To Defa
Return 



Function WProgCh
If !Used('Bd_Start')
	Use Bd_Start In 0 Alias Bd_Start Exclu Noupdate 
Endif 
Select Bd_Start
For I=1 To 6
	Go I
	iTxt=Alltrim(Str(I))
	If !Empty(Bd_Start.ProgMess)
		Show Get m.ProgChoice,I Prompt Alltrim(Bd_Start.ProgMess)
	Else
		Show Get m.ProgChoice,I Disable
	Endif 
EndFor 
Return 
