1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759 |
- $PBExportHeader$w_set_init.srw
- forward
- global type w_set_init from w_publ_base
- end type
- type cb_ok from uo_imflatbutton within w_set_init
- end type
- type st_1 from statictext within w_set_init
- end type
- type sle_bookname from singlelineedit within w_set_init
- end type
- type st_2 from statictext within w_set_init
- end type
- type sle_database from singlelineedit within w_set_init
- end type
- type st_10 from statictext within w_set_init
- end type
- type rb_1 from radiobutton within w_set_init
- end type
- type rb_2 from radiobutton within w_set_init
- end type
- type cb_1 from commandbutton within w_set_init
- end type
- type st_11 from statictext within w_set_init
- end type
- type sle_fjname from singlelineedit within w_set_init
- end type
- type cb_ch3 from commandbutton within w_set_init
- end type
- type sle_filename from singlelineedit within w_set_init
- end type
- type cb_ch2 from commandbutton within w_set_init
- end type
- type st_13 from statictext within w_set_init
- end type
- type sle_folder from singlelineedit within w_set_init
- end type
- type cb_2 from commandbutton within w_set_init
- end type
- type st_8 from statictext within w_set_init
- end type
- type cbx_fj from checkbox within w_set_init
- end type
- type cbx_yj from checkbox within w_set_init
- end type
- type sle_yjname from singlelineedit within w_set_init
- end type
- type cb_ch4 from commandbutton within w_set_init
- end type
- type st_12 from statictext within w_set_init
- end type
- type ddlb_1 from dropdownlistbox within w_set_init
- end type
- type cbx_modify from checkbox within w_set_init
- end type
- type sle_sqldb_mdf_sor from singlelineedit within w_set_init
- end type
- type sle_sqldb_ldf_sor from singlelineedit within w_set_init
- end type
- type sle_bookcode from singlelineedit within w_set_init
- end type
- type st_7 from statictext within w_set_init
- end type
- type sle_server from singlelineedit within w_set_init
- end type
- type sle_logid from singlelineedit within w_set_init
- end type
- type st_5 from statictext within w_set_init
- end type
- type st_6 from statictext within w_set_init
- end type
- type sle_logpass from singlelineedit within w_set_init
- end type
- type cb_connect from uo_imflatbutton within w_set_init
- end type
- type gb_3 from groupbox within w_set_init
- end type
- type gb_1 from groupbox within w_set_init
- end type
- type gb_2 from groupbox within w_set_init
- end type
- type gb_4 from groupbox within w_set_init
- end type
- end forward
- global type w_set_init from w_publ_base
- integer width = 2245
- integer height = 1936
- string title = "帐套设置"
- boolean minbox = false
- windowtype windowtype = response!
- long backcolor = 16777215
- boolean center = true
- cb_ok cb_ok
- st_1 st_1
- sle_bookname sle_bookname
- st_2 st_2
- sle_database sle_database
- st_10 st_10
- rb_1 rb_1
- rb_2 rb_2
- cb_1 cb_1
- st_11 st_11
- sle_fjname sle_fjname
- cb_ch3 cb_ch3
- sle_filename sle_filename
- cb_ch2 cb_ch2
- st_13 st_13
- sle_folder sle_folder
- cb_2 cb_2
- st_8 st_8
- cbx_fj cbx_fj
- cbx_yj cbx_yj
- sle_yjname sle_yjname
- cb_ch4 cb_ch4
- st_12 st_12
- ddlb_1 ddlb_1
- cbx_modify cbx_modify
- sle_sqldb_mdf_sor sle_sqldb_mdf_sor
- sle_sqldb_ldf_sor sle_sqldb_ldf_sor
- sle_bookcode sle_bookcode
- st_7 st_7
- sle_server sle_server
- sle_logid sle_logid
- st_5 st_5
- st_6 st_6
- sle_logpass sle_logpass
- cb_connect cb_connect
- gb_3 gb_3
- gb_1 gb_1
- gb_2 gb_2
- gb_4 gb_4
- end type
- global w_set_init w_set_init
- type prototypes
- Subroutine Sleep(ulong dwMilliseconds) LIBRARY "kernel32.dll"
- Function long ShellExecuteA (long hwnd, string lpOperation ,String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library "shell32.dll" alias for "ShellExecuteA;Ansi"
- Function long GetFullPathName (String lpFileName ,Long nBufferLength,ref string lpBuffer,ref long lpFilePart) library "kernel32" ALIAS FOR "GetFullPathNameA;Ansi"
- end prototypes
- type variables
- long ins_bookid = 0
- string ins_servername
- string ins_logid
- string ins_logpass
- string masterpath
- //string mssqlpath
- long ins_rslt = 0
- long ins_ifguid = 0
- end variables
- forward prototypes
- public subroutine wf_facechange ()
- public function integer wf_buildsqldb (ref string arg_msg)
- public function integer wf_chk_database (string arg_databasename, transaction arg_transaction)
- public function integer wf_create_database (string arg_folder, string arg_databasename, string arg_filename, string arg_sqldb_mdf_sor, string arg_sqldb_ldf_sor, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg)
- public function integer wf_drop_database (string arg_databasename, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg)
- end prototypes
- public subroutine wf_facechange ();IF rb_2.Checked THEN
- cb_1.Text = '︾'
- cb_1.Visible = false
- st_11.Visible = false
- ELSE
- cb_1.Visible = true
- st_11.Visible = true
- END IF
- long ph
- ph = 200
- IF cb_1.Text = '︽' THEN
- This.Height = 1550 + ph
-
- gb_2.Visible = True
- st_12.Visible = True
- ddlb_1.Visible = True
- cbx_modify.Visible = True
- st_8.Visible = True
- sle_filename.Visible = true
- cb_ch2.Visible = true
- cbx_fj.Visible = true
- sle_fjname.visible = true
- cb_ch3.visible = true
- cbx_yj.visible = true
- sle_yjname.visible = true
- cb_ch4.visible = true
- st_13.visible = true
- sle_folder.visible = true
- cb_2.visible = true
-
- cb_ok.Y = 1520
- cb_exit.Y = 1520
- cb_connect.Y = 1520
- ELSE
- This.Height = 892 + ph
-
- gb_2.Visible = false
- st_12.Visible = false
- ddlb_1.Visible = false
- cbx_modify.Visible = false
- st_8.Visible = false
- sle_filename.Visible = false
- cb_ch2.Visible = false
- cbx_fj.Visible = false
- sle_fjname.visible = false
- cb_ch3.visible = false
- cbx_yj.visible = false
- sle_yjname.visible = false
- cb_ch4.visible = false
- st_13.visible = false
- sle_folder.visible = false
- cb_2.visible = false
-
- cb_ok.Y = 876
- cb_exit.Y = 876
- cb_connect.Y =876
- END IF
- end subroutine
- public function integer wf_buildsqldb (ref string arg_msg);//wf_buildsqldb
- Integer li_FileNum,rslt = 1
- String comm,msg
- Long i,j,lu_return
- String ls_test
- String ls_dat
- String ls_databasename
- String ls_filename
- Transaction db_Transaction
- db_Transaction = Create Transaction
- Open(w_sys_wait)
- IF Trim(sle_folder.Text) = '' THEN
- arg_msg = '请输入目标文件路径!'
- rslt = 0
- GOTO ext
- END IF
- Int ll_result
- ll_result = createdirectory(sle_folder.Text)
- //IF ll_result = -1 THEN
- // arg_msg = '目标文件路径创建失败!'
- // rslt = 0
- // GOTO ext
- //END IF
- ls_dat = sle_filename.Text
- IF Not FileExists ( ls_dat ) THEN
- arg_msg = "主数据库文件不存在!"
- rslt = 0
- GOTO ext
- END IF
- IF rb_1.Checked THEN
- ls_dat = Trim(sle_fjname.Text)
- IF Not FileExists ( ls_dat ) THEN
- arg_msg = "附件数据库文件不存在!"
- rslt = 0
- GOTO ext
- END IF
- END IF
- IF cbx_yj.Checked THEN
- ls_dat = Trim(sle_yjname.Text)
- IF Not FileExists ( ls_dat ) THEN
- arg_msg = "邮件数据库文件不存在!"
- rslt = 0
- GOTO ext
- END IF
- END IF
- w_sys_wait.wf_set_msg("正在尝试新建数据库,此过程预计需要用时1分钟...")
- db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
- db_Transaction.Database = 'master'
- db_Transaction.UserID = ins_logid
- db_Transaction.DBPass = ins_logpass
- db_Transaction.LogID = ins_logid
- db_Transaction.LogPass = ins_logpass
- db_Transaction.ServerName = ins_servername
- db_Transaction.Lock = "RU"
- db_Transaction.AutoCommit = False
- db_Transaction.DBParm = "Database= 'master' ,PBTrimCharColumns='YES'"
- IF db_Transaction.Database = '' Or db_Transaction.ServerName = '' THEN
- arg_msg = "连接数据库失败!"
- rslt = 0
- GOTO ext
- END IF
- CONNECT Using db_Transaction;
- db_Transaction.AutoCommit = True
- IF db_Transaction.SQLCode <> 0 THEN
- DISCONNECT Using db_Transaction;
- arg_msg = '服务器连接失败!!'
- rslt = 0
- GOTO ext
- END IF
- //检查主数据库
- ls_databasename = Trim(sle_database.Text)
- IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
- IF MessageBox ("询问","主数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
- rslt = 2
- GOTO ext
- ELSE
- IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- END IF
- //检查附件数据库
- ls_databasename = Trim(sle_database.Text)+ '_fj'
- IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
- IF MessageBox ("询问","附件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
- rslt = 2
- GOTO ext
- ELSE
- IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- END IF
- //检查邮件数据库
- ls_databasename = Trim(sle_database.Text) + '_yj'
- IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
- IF MessageBox ("询问","邮件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
- rslt = 2
- GOTO ext
- ELSE
- IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- END IF
- //新建主数据库
- ls_databasename = Trim(sle_database.Text)
- ls_filename = Trim(sle_filename.Text)
- //st_jd.Text = '正在新建主数据库'
- IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, sle_sqldb_mdf_sor.Text, sle_sqldb_ldf_sor.Text, db_Transaction, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- comm = "DELETE FROM " + Trim(sle_database.Text) + ".dbo.U_OuterConnection"
- EXECUTE Immediate :comm Using db_Transaction;
- //新建附件数据库
- IF cbx_fj.Checked THEN
- ls_databasename = Trim(sle_database.Text)+ '_fj'
- ls_filename = Trim(sle_fjname.Text)
-
- // st_jd.Text = '正在新建附件数据库'
-
- IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, 'filemanage_Data', 'filemanage_Log', db_Transaction, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- String ls_MDF,ls_ldf
- ls_MDF = ls_databasename + ".MDF"
- ls_ldf = ls_databasename + ".ldf"
-
- comm = "INSERT INTO " + Trim(sle_database.Text) + ".dbo.U_OuterConnection ("+&
- "ConnectionID ,"+&
- "DBMS ,"+&
- "ConnectionName ,"+&
- "ConnectionType ,"+&
- "DataBaseName ,"+&
- "ServerName ,"+&
- "LogId ,"+&
- "LogPass ,"+&
- "mdf_name ,"+&
- "ldf_name ,"+&
- "opdate"+&
- ")"+&
- "VALUES"+&
- "("+&
- "11,"+&
- "'MSS Microsoft SQL Server 6.x',"+&
- "'附件数据库',"+&
- "0,"+&
- "'" + ls_databasename + "',"+&
- "'" + db_Transaction.ServerName+"',"+&
- "'" + db_Transaction.LogID + "',"+&
- "'" + db_Transaction.LogPass + "',"+&
- "'" + ls_MDF + "',"+&
- "'" + ls_ldf + "',"+&
- "getdate()"+&
- ");"
- EXECUTE Immediate :comm Using db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '设置附件数据库连接失败,请手动设置,' + db_Transaction.SQLErrText
- GOTO ext
- END IF
- END IF
- //新建邮件数据库
- IF cbx_yj.Checked THEN
- ls_databasename = Trim(sle_database.Text) + '_yj'
- ls_filename = Trim(sle_yjname.Text)
-
- // st_jd.Text = '正在新建邮件数据库'
-
- IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, 'filemanage_Data', 'filemanage_Log', db_Transaction, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
-
- ls_MDF = ls_databasename + ".MDF"
- ls_ldf = ls_databasename + ".ldf"
-
- comm = "INSERT INTO " + Trim(sle_database.Text) + ".dbo.U_OuterConnection ("+&
- "ConnectionID ,"+&
- "DBMS ,"+&
- "ConnectionName ,"+&
- "ConnectionType ,"+&
- "DataBaseName ,"+&
- "ServerName ,"+&
- "LogId ,"+&
- "LogPass ,"+&
- "mdf_name ,"+&
- "ldf_name ,"+&
- "opdate"+&
- ")"+&
- "VALUES"+&
- "("+&
- "12,"+&
- "'MSS Microsoft SQL Server 6.x',"+&
- "'邮件数据库',"+&
- "2,"+&
- "'" + ls_databasename + "',"+&
- "'" + db_Transaction.ServerName+"',"+&
- "'" + db_Transaction.LogID + "',"+&
- "'" + db_Transaction.LogPass + "',"+&
- "'" + ls_MDF + "',"+&
- "'" + ls_ldf + "',"+&
- "getdate()"+&
- ");"
- EXECUTE Immediate :comm Using db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '设置邮件数据库连接失败,请手动设置,' + db_Transaction.SQLErrText
- GOTO ext
- END IF
-
- END IF
- ext:
- w_sys_wait.Hide()
- Close(w_sys_wait)
- IF rslt = 1 THEN
- COMMIT Using db_Transaction;
- ELSE
- ROLLBACK Using db_Transaction;
- END IF
- DISCONNECT Using db_Transaction;
- Destroy db_Transaction
- RETURN rslt
- end function
- public function integer wf_chk_database (string arg_databasename, transaction arg_transaction);String ls_test
- ls_test = "if exists(select 1 from master..sysdatabases where name='" + arg_databasename + "') raiserror('Database existed',18,1) else raiserror('Database not existed',18,1) "
- EXECUTE Immediate :ls_test Using arg_transaction;
- IF pos(arg_transaction.SQLErrText , 'Database existed' ) > 0 THEN
- RETURN 1
- ELSE
- RETURN 0
- END IF
- end function
- public function integer wf_create_database (string arg_folder, string arg_databasename, string arg_filename, string arg_sqldb_mdf_sor, string arg_sqldb_ldf_sor, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg);Integer rslt = 1
- String comm
- comm = ' create DATABASE '+arg_databasename+&
- " on(name='"+arg_sqldb_mdf_sor+"',FILENAME= '"+arg_folder + '\' + arg_databasename+'_data.ldf'+"') log on (name='"+arg_sqldb_ldf_sor+"',FILENAME= '"+arg_folder + '\' + arg_databasename+'_log.ldf'+"')"
- EXECUTE Immediate :comm Using arg_transaction;
- IF arg_transaction.SQLCode <> 0 THEN
- arg_msg = '建立数据库['+arg_databasename+']失败,请手动建立及恢复>'+arg_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- // st_jd.Text = '正在恢复主数据库...'
- comm = 'RESTORE DATABASE '+arg_databasename+" from DISK= '"+arg_filename+"'"+&
- " WITH MOVE '"+arg_sqldb_mdf_sor+"' TO '"+arg_folder + '\' + arg_databasename+'_data.ldf'+"',"+&
- " MOVE '"+arg_sqldb_ldf_sor+"' TO '"+arg_folder + '\' + arg_databasename+'_log.ldf'+"',"+'REPLACE'
- EXECUTE Immediate :comm Using arg_transaction;
- IF arg_transaction.SQLCode <> 0 THEN
- arg_msg = '恢复数据库['+arg_databasename+']失败,请手动恢复>'+arg_transaction.SQLErrText
- rslt = 0
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using arg_transaction;
- ELSEIF arg_ifcommit THEN
- COMMIT Using arg_transaction;
- END IF
- RETURN rslt
- end function
- public function integer wf_drop_database (string arg_databasename, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg);Integer rslt = 1
- String comm
- comm = " IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'" + arg_databasename + "') DROP DATABASE [" + arg_databasename + "]"
- EXECUTE Immediate :comm Using arg_Transaction;
- IF arg_Transaction.SQLCode <> 0 THEN
- arg_msg = '删除数据库失败,请手动删除['+arg_databasename+']>'+arg_Transaction.SQLErrText
- rslt = 0
- ELSE
- rslt = 1
- END IF
- IF rslt = 0 THEN
- ROLLBACK Using arg_Transaction;
- ELSEIF arg_ifcommit THEN
- COMMIT Using arg_Transaction;
- END IF
- RETURN rslt
- end function
- on w_set_init.create
- int iCurrent
- call super::create
- this.cb_ok=create cb_ok
- this.st_1=create st_1
- this.sle_bookname=create sle_bookname
- this.st_2=create st_2
- this.sle_database=create sle_database
- this.st_10=create st_10
- this.rb_1=create rb_1
- this.rb_2=create rb_2
- this.cb_1=create cb_1
- this.st_11=create st_11
- this.sle_fjname=create sle_fjname
- this.cb_ch3=create cb_ch3
- this.sle_filename=create sle_filename
- this.cb_ch2=create cb_ch2
- this.st_13=create st_13
- this.sle_folder=create sle_folder
- this.cb_2=create cb_2
- this.st_8=create st_8
- this.cbx_fj=create cbx_fj
- this.cbx_yj=create cbx_yj
- this.sle_yjname=create sle_yjname
- this.cb_ch4=create cb_ch4
- this.st_12=create st_12
- this.ddlb_1=create ddlb_1
- this.cbx_modify=create cbx_modify
- this.sle_sqldb_mdf_sor=create sle_sqldb_mdf_sor
- this.sle_sqldb_ldf_sor=create sle_sqldb_ldf_sor
- this.sle_bookcode=create sle_bookcode
- this.st_7=create st_7
- this.sle_server=create sle_server
- this.sle_logid=create sle_logid
- this.st_5=create st_5
- this.st_6=create st_6
- this.sle_logpass=create sle_logpass
- this.cb_connect=create cb_connect
- this.gb_3=create gb_3
- this.gb_1=create gb_1
- this.gb_2=create gb_2
- this.gb_4=create gb_4
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_ok
- this.Control[iCurrent+2]=this.st_1
- this.Control[iCurrent+3]=this.sle_bookname
- this.Control[iCurrent+4]=this.st_2
- this.Control[iCurrent+5]=this.sle_database
- this.Control[iCurrent+6]=this.st_10
- this.Control[iCurrent+7]=this.rb_1
- this.Control[iCurrent+8]=this.rb_2
- this.Control[iCurrent+9]=this.cb_1
- this.Control[iCurrent+10]=this.st_11
- this.Control[iCurrent+11]=this.sle_fjname
- this.Control[iCurrent+12]=this.cb_ch3
- this.Control[iCurrent+13]=this.sle_filename
- this.Control[iCurrent+14]=this.cb_ch2
- this.Control[iCurrent+15]=this.st_13
- this.Control[iCurrent+16]=this.sle_folder
- this.Control[iCurrent+17]=this.cb_2
- this.Control[iCurrent+18]=this.st_8
- this.Control[iCurrent+19]=this.cbx_fj
- this.Control[iCurrent+20]=this.cbx_yj
- this.Control[iCurrent+21]=this.sle_yjname
- this.Control[iCurrent+22]=this.cb_ch4
- this.Control[iCurrent+23]=this.st_12
- this.Control[iCurrent+24]=this.ddlb_1
- this.Control[iCurrent+25]=this.cbx_modify
- this.Control[iCurrent+26]=this.sle_sqldb_mdf_sor
- this.Control[iCurrent+27]=this.sle_sqldb_ldf_sor
- this.Control[iCurrent+28]=this.sle_bookcode
- this.Control[iCurrent+29]=this.st_7
- this.Control[iCurrent+30]=this.sle_server
- this.Control[iCurrent+31]=this.sle_logid
- this.Control[iCurrent+32]=this.st_5
- this.Control[iCurrent+33]=this.st_6
- this.Control[iCurrent+34]=this.sle_logpass
- this.Control[iCurrent+35]=this.cb_connect
- this.Control[iCurrent+36]=this.gb_3
- this.Control[iCurrent+37]=this.gb_1
- this.Control[iCurrent+38]=this.gb_2
- this.Control[iCurrent+39]=this.gb_4
- end on
- on w_set_init.destroy
- call super::destroy
- destroy(this.cb_ok)
- destroy(this.st_1)
- destroy(this.sle_bookname)
- destroy(this.st_2)
- destroy(this.sle_database)
- destroy(this.st_10)
- destroy(this.rb_1)
- destroy(this.rb_2)
- destroy(this.cb_1)
- destroy(this.st_11)
- destroy(this.sle_fjname)
- destroy(this.cb_ch3)
- destroy(this.sle_filename)
- destroy(this.cb_ch2)
- destroy(this.st_13)
- destroy(this.sle_folder)
- destroy(this.cb_2)
- destroy(this.st_8)
- destroy(this.cbx_fj)
- destroy(this.cbx_yj)
- destroy(this.sle_yjname)
- destroy(this.cb_ch4)
- destroy(this.st_12)
- destroy(this.ddlb_1)
- destroy(this.cbx_modify)
- destroy(this.sle_sqldb_mdf_sor)
- destroy(this.sle_sqldb_ldf_sor)
- destroy(this.sle_bookcode)
- destroy(this.st_7)
- destroy(this.sle_server)
- destroy(this.sle_logid)
- destroy(this.st_5)
- destroy(this.st_6)
- destroy(this.sle_logpass)
- destroy(this.cb_connect)
- destroy(this.gb_3)
- destroy(this.gb_1)
- destroy(this.gb_2)
- destroy(this.gb_4)
- end on
- event open;call super::open;s_set_book_parm s_parm
- s_parm = Message.PowerObjectParm
- IF IsNull(s_parm) THEN
- ins_bookid = 0
- ins_ifguid = 0
- ELSE
- ins_bookid = s_parm.bookid
- ins_ifguid = s_parm.ifguid
- END IF
- IF IsNull(ins_bookid) THEN
- ins_bookid = 0
- END IF
- IF ins_bookid <= 0 THEN
- ins_bookid = 1
- END IF
- IF ins_bookid > 20 THEN
- ins_bookid = 20
- END IF
- sle_bookcode.Text = String(ins_bookid, '00')
- IF sys_cur_path = "" THEN
- Long rslt = 1
- String lpBuffer
- lpBuffer = Fill('',200)
- Long lpfilepart,li_FileNum
-
- rslt = GetFullPathName(sys_inifilename,196,lpBuffer,lpfilepart)
- sys_cur_path = Left(lpBuffer,Len(lpBuffer)-Len(sys_inifilename))
- END IF
- //设置数据库连接
- sle_logid.Text = ProfileString (sys_inifilename, "database", "logid", "SA")
- sle_logpass.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
- sle_server.Text = ProfileString (sys_inifilename, "database", "servername", "127.0.0.1")
- IF sle_server.Text = "" THEN
- sle_server.Text = "127.0.0.1"
- END IF
- IF sle_logid.Text = "" THEN
- sle_logid.Text = "SA"
- END IF
- //
- ins_servername = ProfileString (sys_inifilename, "database", "servername", "")
- ins_logid = ProfileString (sys_inifilename, "database", "logid", "SA")
- ins_logpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
- sle_sqldb_mdf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_mdf_sor", '')
- sle_sqldb_ldf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_ldf_sor",'' )
- String ls_fjname, ls_yjname
- ls_fjname = ProfileString (sys_inifilename, "database", "defaultfjdb",'' )
- ls_yjname = ProfileString (sys_inifilename, "database", "defaultyjdb",'' )
- IF ls_fjname = "" THEN
- ls_fjname = "企精灵附件数据库"
- END IF
- IF ls_yjname = "" THEN
- ls_yjname = "企精灵邮件数据库"
- END IF
- sle_fjname.Text = sys_cur_path + ls_fjname +'.dat'
- sle_yjname.Text = sys_cur_path + ls_yjname +'.dat'
- Long i
- String ls_temp
- FOR i = 1 To 3
- ls_temp = ProfileString (sys_inifilename, "database", "demodb" + String(i), '')
- IF ls_temp <> '' THEN
- ddlb_1.AddItem (ls_temp)
- END IF
- IF i = 1 THEN
- ddlb_1.Text = ls_temp
- sle_filename.Text = sys_cur_path + ddlb_1.Text + '.dat'
- END IF
- NEXT
- masterpath = sys_cur_path + 'database'
- sle_folder.Text = masterpath
- String ls_ini_book
- String ins_bookcode
- Long ins_ifuse
- ls_ini_book = ProfileString (sys_inifilename_other,'sys_dl_book', String(ins_bookid), '')
- IF ls_ini_book <> '' THEN
- sle_bookname.Text = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
- ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
- sle_database.Text = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
- ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
- ins_bookcode = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
- ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
- ins_ifuse = Long(ls_ini_book)
- rb_2.Checked = True
- ELSE
- sle_database.Text = "EW5_DB"
- // rb_1.Checked = True
- END IF
- cb_1.Text = '︾'
- IF ins_ifguid = 1 THEN
- This.Title =This.Title
- gb_1.Text = gb_1.Text
- cb_ok.Text = '完成'
- END IF
- wf_facechange()
- end event
- event close;call super::close;closewithreturn(this, ins_rslt)
- end event
- type cb_func from w_publ_base`cb_func within w_set_init
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_set_init
- integer x = 1778
- integer y = 1584
- end type
- type cb_ok from uo_imflatbutton within w_set_init
- integer x = 1367
- integer y = 1584
- integer width = 311
- integer height = 96
- integer taborder = 20
- boolean bringtotop = true
- string normalpicname = "ok.bmp"
- end type
- event clicked;call super::clicked;IF Trim(sle_bookname.Text) = '' THEN
- MessageBox('系统提示','请输入帐套!',information!,OK!)
- RETURN
- END IF
- IF Trim(sle_database.Text) = '' THEN
- MessageBox('系统提示','请输入数据库!',information!,OK!)
- RETURN
- END IF
- SetProfileString (sys_inifilename, "database", "logid", sle_logid.Text)
- SetProfileString (sys_inifilename, "database", "LogPassWord", f_psw_bczh(sle_logpass.Text,0,sys_power_key))
- SetProfileString (sys_inifilename, "database", "servername", sle_server.Text)
- ins_servername = ProfileString (sys_inifilename, "database", "servername", "")
- ins_logid = ProfileString (sys_inifilename, "database", "logid", "SA")
- ins_logpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
- IF rb_1.Checked THEN
- String ls_msg
- Int ll_rslt
- ll_rslt = wf_buildsqldb(ls_msg) //1-成功
- IF ll_rslt = 0 THEN //错误
- MessageBox("提示",ls_msg,information!,OK!)
- RETURN
- ELSEIF ll_rslt = 2 THEN //取消
- RETURN
- END IF
- END IF
- SetProfileString (sys_inifilename, "database", "bookname", sle_bookname.Text )
- SetProfileString (sys_inifilename, "database", "database", sle_database.Text)
- SetProfileString (sys_inifilename, "database", "sqldb_mdf_sor", sle_sqldb_mdf_sor.Text)
- SetProfileString (sys_inifilename, "database", "sqldb_ldf_sor", sle_sqldb_ldf_sor.Text)
- //增加一个帐套
- String ls_ini_book
- string is_bookcode
- Long id
- String ifuse
- is_bookcode = string(ins_bookid, '00')
- id = ins_bookid
- String ls_temp
- ls_temp = Trim(sle_bookname.Text) + ':'+&
- Trim(sle_database.Text)+ ':'+&
- is_bookcode+':'+&
- '1'
- //SetProfileString (sys_inifilename_other,'sys_dl_book', '1', f_psw_bczh(ls_temp,0,sys_power_key))
- SetProfileString (sys_inifilename_other,'sys_dl_book', String(id), ls_temp)
- SetProfileString(sys_inifilename,'longjoews','LastAcount',Trim(sle_bookname.Text))
- SetProfileString (sys_inifilename, "database", "firstrun","0")
- ins_rslt = 1
- //////////////////////////////////////////亚洲国际通信设置
- String ls_run,sys_cur_path1
- String ls_server
- String ls_logid
- String ls_logpass
- String ls_database
- String ls_txtLJNETIP
- String ls_txtLJNETPort
- ls_server = Trim(sle_server.Text)
- ls_logid = Trim(sle_logid.Text)
- ls_logpass = Trim(sle_logpass.Text)
- ls_database = Trim(sle_database.Text) + "_yj"
- ls_txtLJNETIP="scm.fib2b.cn"
- ls_txtLJNETPort="30086"
- sys_cur_path1 = sys_cur_path + "亚洲国际通讯服务配置程序\LongjoeEDISvr_config.exe"
- ls_run = ' -longjoe&'&
- + ls_server + '&'&
- + ls_logid + '&'&
- + ls_logpass + '&'&
- + ls_database + '&'&
- + ls_txtLJNETIP + '&'&
- + ls_txtLJNETPort + '&'
- IF Run(sys_cur_path1 + ls_run) = -1 THEN
- // MessageBox('错误','运行程序失败!',stopsign!,ok!)
- // RETURN
- END IF
- close(parent)
- //MessageBox('提示','设置保存完成!系统必须重启!')
- //
- //Restart()
- end event
- type st_1 from statictext within w_set_init
- integer x = 142
- integer y = 548
- integer width = 256
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "帐套名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_bookname from singlelineedit within w_set_init
- integer x = 411
- integer y = 536
- integer width = 1504
- integer height = 80
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- string text = "演示帐套"
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- type st_2 from statictext within w_set_init
- integer x = 101
- integer y = 648
- integer width = 297
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "数据库名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_database from singlelineedit within w_set_init
- integer x = 411
- integer y = 636
- integer width = 1655
- integer height = 80
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- type st_10 from statictext within w_set_init
- integer x = 73
- integer y = 748
- integer width = 325
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "初始化类型:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type rb_1 from radiobutton within w_set_init
- integer x = 96
- integer y = 984
- integer width = 402
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- boolean enabled = false
- string text = "新建数据库"
- end type
- event clicked;wf_facechange()
- end event
- type rb_2 from radiobutton within w_set_init
- integer x = 421
- integer y = 760
- integer width = 466
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "连接现有数据库"
- boolean checked = true
- end type
- event clicked;wf_facechange()
- end event
- type cb_1 from commandbutton within w_set_init
- integer x = 1746
- integer y = 744
- integer width = 82
- integer height = 84
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "︾"
- end type
- event clicked;IF cb_1.Text = '︽' THEN
- cb_1.Text = '︾'
- ELSE
- cb_1.Text = '︽'
- END IF
- wf_facechange()
- end event
- type st_11 from statictext within w_set_init
- integer x = 1838
- integer y = 768
- integer width = 233
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "高级选项"
- boolean focusrectangle = false
- end type
- type sle_fjname from singlelineedit within w_set_init
- integer x = 407
- integer y = 1264
- integer width = 1655
- integer height = 80
- integer taborder = 170
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type cb_ch3 from commandbutton within w_set_init
- integer x = 2071
- integer y = 1264
- integer width = 114
- integer height = 84
- integer taborder = 220
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "..."
- end type
- event clicked;
- Integer i
- String Pathname,Filename
- i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
- IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
- sle_fjname.Text = Pathname
- END IF
- end event
- type sle_filename from singlelineedit within w_set_init
- integer x = 407
- integer y = 1160
- integer width = 1655
- integer height = 80
- integer taborder = 160
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- borderstyle borderstyle = stylelowered!
- end type
- type cb_ch2 from commandbutton within w_set_init
- integer x = 2071
- integer y = 1160
- integer width = 114
- integer height = 84
- integer taborder = 210
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- boolean enabled = false
- string text = "..."
- end type
- event clicked;
- Integer i
- String Pathname,Filename
- i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
- IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
- sle_filename.Text = Pathname
- END IF
- end event
- type st_13 from statictext within w_set_init
- integer x = 23
- integer y = 1496
- integer width = 370
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- boolean enabled = false
- string text = "目标文件路径:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_folder from singlelineedit within w_set_init
- integer x = 407
- integer y = 1480
- integer width = 1655
- integer height = 80
- integer taborder = 200
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type cb_2 from commandbutton within w_set_init
- integer x = 2071
- integer y = 1480
- integer width = 114
- integer height = 84
- integer taborder = 250
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "..."
- end type
- event clicked;
- //
- //GetFolder()
- //功 能:显示文件夹选择对话框。
- //语 法:GetFolder (title , director )
- //参 数:title:String类型,指定文件夹选择框的标题;
- // directory:String类型,文件夹的路径,即指定显示哪个文件夹下的子文件夹,又用于保存用户最终选择的文件夹的路径。
- //返回值:Integer。函数执行成功时返回1,发生错误时返回-1。当用户选择了”取消”按钮或直接关闭对话框,函数返回0。
- //示 例:This example displays the folder contents of the Sybase directory in a folder selection dialog box. The string passed in the title argument displays above the tree view:
- string ls_path
- integer li_result
- ls_path = mid(sys_cur_path,1,len(sys_cur_path )- 1)
- li_result = GetFolder( "目标文件路径", ls_path )
- sle_folder.text=ls_path
- end event
- type st_8 from statictext within w_set_init
- integer x = 23
- integer y = 1172
- integer width = 370
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- boolean enabled = false
- string text = "主数据库:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type cbx_fj from checkbox within w_set_init
- integer x = 18
- integer y = 1276
- integer width = 375
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "附件数据库:"
- boolean checked = true
- end type
- event clicked;if rb_2.checked then return
- IF cbx_fj.Checked THEN
- sle_fjname.Enabled = TRUE
- cb_ch3.Enabled = TRUE
- ELSE
- sle_fjname.Enabled = FALSE
- cb_ch3.Enabled = FALSE
- END IF
- end event
- type cbx_yj from checkbox within w_set_init
- integer x = 18
- integer y = 1384
- integer width = 384
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "邮件数据库:"
- boolean checked = true
- end type
- event clicked;IF rb_2.Checked THEN RETURN
- IF cbx_yj.Checked THEN
- sle_yjname.Enabled = TRUE
- cb_ch4.Enabled = TRUE
- ELSE
- sle_yjname.Enabled = FALSE
- cb_ch4.Enabled = FALSE
- END IF
- end event
- type sle_yjname from singlelineedit within w_set_init
- integer x = 407
- integer y = 1372
- integer width = 1655
- integer height = 80
- integer taborder = 180
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type cb_ch4 from commandbutton within w_set_init
- integer x = 2071
- integer y = 1372
- integer width = 114
- integer height = 84
- integer taborder = 240
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "..."
- end type
- event clicked;
- Integer i
- String Pathname,Filename
- i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
- IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
- sle_yjname.Text = Pathname
- END IF
- end event
- type st_12 from statictext within w_set_init
- integer x = 96
- integer y = 1060
- integer width = 297
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "数据库来源:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type ddlb_1 from dropdownlistbox within w_set_init
- integer x = 407
- integer y = 1052
- integer width = 1166
- integer height = 300
- integer taborder = 40
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;sle_filename.text = sys_cur_path + this.text + '.dat'
- end event
- type cbx_modify from checkbox within w_set_init
- integer x = 1591
- integer y = 1060
- integer width = 311
- integer height = 60
- integer taborder = 50
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "手动修改"
- end type
- event clicked;IF THIS.Checked THEN
- ddlb_1.Enabled = FALSE
- cb_ch2.Enabled = TRUE
- sle_filename.Enabled = TRUE
- sle_filename.text = ''
- ELSE
- ddlb_1.Enabled = TRUE
- cb_ch2.Enabled = FALSE
- sle_filename.Enabled = FALSE
- sle_filename.text = sys_cur_path + ddlb_1.text + '.dat'
- END IF
- end event
- type sle_sqldb_mdf_sor from singlelineedit within w_set_init
- boolean visible = false
- integer x = 1582
- integer y = 372
- integer width = 1655
- integer height = 80
- integer taborder = 190
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type sle_sqldb_ldf_sor from singlelineedit within w_set_init
- boolean visible = false
- integer x = 1582
- integer y = 464
- integer width = 1655
- integer height = 80
- integer taborder = 230
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type sle_bookcode from singlelineedit within w_set_init
- integer x = 1929
- integer y = 536
- integer width = 137
- integer height = 80
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontcharset fontcharset = ansi!
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean enabled = false
- string text = "none"
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type st_7 from statictext within w_set_init
- integer x = 137
- integer y = 108
- integer width = 256
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "服务器:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_server from singlelineedit within w_set_init
- integer x = 407
- integer y = 96
- integer width = 1655
- integer height = 80
- integer taborder = 140
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- type sle_logid from singlelineedit within w_set_init
- integer x = 407
- integer y = 196
- integer width = 1655
- integer height = 80
- integer taborder = 150
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- type st_5 from statictext within w_set_init
- integer x = 137
- integer y = 208
- integer width = 256
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "登录 ID:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_6 from statictext within w_set_init
- integer x = 137
- integer y = 300
- integer width = 256
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 16777215
- boolean enabled = false
- string text = "登录 口令:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_logpass from singlelineedit within w_set_init
- integer x = 407
- integer y = 292
- integer width = 1655
- integer height = 80
- integer taborder = 160
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- boolean password = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_connect from uo_imflatbutton within w_set_init
- integer x = 393
- integer y = 1592
- integer width = 315
- integer height = 96
- integer taborder = 100
- boolean bringtotop = true
- string text = "测试连接"
- end type
- event clicked;call super::clicked;IF Trim(sle_server.Text) = '' THEN
- MessageBox('系统提示','请输入服务器!',information!,OK!)
- RETURN
- END IF
- IF Trim(sle_logid.Text) = '' THEN
- MessageBox('系统提示','请输入登陆ID!',information!,OK!)
- RETURN
- END IF
- string ls_database = "master"
- Open(w_sys_wait)
- w_sys_wait.wf_set_msg("正在尝试连接数据库,此过程预计需要用时1分钟...")
- Transaction db_Transaction
- db_Transaction = Create Transaction
- db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
- db_Transaction.Database = ls_database
- db_Transaction.UserID = sle_logid.Text
- db_Transaction.DBPass = sle_logpass.Text
- db_Transaction.LogID = sle_logid.Text
- db_Transaction.LogPass = sle_logpass.Text
- db_Transaction.ServerName = sle_server.Text
- db_Transaction.Lock = "RU"
- db_Transaction.AutoCommit = False
- db_Transaction.DBParm = "Database= '" + ls_database + "',PBTrimCharColumns='YES'"
- CONNECT Using db_Transaction;
- Int rslt = 1
- String arg_msg = ''
- IF db_Transaction.SQLCode < 0 THEN
- rslt = 0
- arg_msg = "连接数据库失败!"
- IF Pos(db_Transaction.SQLErrText, "'"+sle_logid.Text+"'") > 0 THEN
- arg_msg = arg_msg + "用户密码错误!"
- sle_logpass.SetFocus()
- END IF
-
- IF Pos(db_Transaction.SQLErrText, "'"+ls_database+"'") > 0 THEN
- rslt = 1
- END IF
-
- ELSE
- rslt = 1
- END IF
- DISCONNECT Using db_Transaction;
- Destroy db_Transaction;
- Close(w_sys_wait)
- IF rslt = 0 THEN
- MessageBox("系统提示",arg_msg)
- ELSE
- MessageBox("系统提示","连接数据库成功!")
- END IF
- end event
- type gb_3 from groupbox within w_set_init
- integer x = 411
- integer y = 716
- integer width = 1051
- integer height = 120
- integer taborder = 300
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 16711680
- long backcolor = 16777215
- end type
- type gb_1 from groupbox within w_set_init
- integer y = 468
- integer width = 2217
- integer height = 388
- integer taborder = 270
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "2.帐套设置"
- end type
- type gb_2 from groupbox within w_set_init
- integer x = 9
- integer y = 872
- integer width = 2217
- integer height = 716
- integer taborder = 280
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "3.高级选项"
- end type
- type gb_4 from groupbox within w_set_init
- integer x = 9
- integer y = 24
- integer width = 2217
- integer height = 432
- integer taborder = 280
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "1.服务器设置"
- end type
|