w_set_book.srw 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517
  1. $PBExportHeader$w_set_book.srw
  2. forward
  3. global type w_set_book from w_publ_base
  4. end type
  5. type cb_ok from uo_imflatbutton within w_set_book
  6. end type
  7. type cb_connect from uo_imflatbutton within w_set_book
  8. end type
  9. type st_1 from statictext within w_set_book
  10. end type
  11. type sle_bookname from singlelineedit within w_set_book
  12. end type
  13. type st_2 from statictext within w_set_book
  14. end type
  15. type sle_database from singlelineedit within w_set_book
  16. end type
  17. type st_10 from statictext within w_set_book
  18. end type
  19. type rb_1 from radiobutton within w_set_book
  20. end type
  21. type rb_2 from radiobutton within w_set_book
  22. end type
  23. type cb_1 from commandbutton within w_set_book
  24. end type
  25. type st_11 from statictext within w_set_book
  26. end type
  27. type sle_fjname from singlelineedit within w_set_book
  28. end type
  29. type cb_ch3 from commandbutton within w_set_book
  30. end type
  31. type sle_filename from singlelineedit within w_set_book
  32. end type
  33. type cb_ch2 from commandbutton within w_set_book
  34. end type
  35. type st_13 from statictext within w_set_book
  36. end type
  37. type sle_folder from singlelineedit within w_set_book
  38. end type
  39. type cb_2 from commandbutton within w_set_book
  40. end type
  41. type st_8 from statictext within w_set_book
  42. end type
  43. type cbx_fj from checkbox within w_set_book
  44. end type
  45. type cbx_yj from checkbox within w_set_book
  46. end type
  47. type sle_yjname from singlelineedit within w_set_book
  48. end type
  49. type cb_ch4 from commandbutton within w_set_book
  50. end type
  51. type st_12 from statictext within w_set_book
  52. end type
  53. type ddlb_1 from dropdownlistbox within w_set_book
  54. end type
  55. type cbx_modify from checkbox within w_set_book
  56. end type
  57. type sle_sqldb_mdf_sor from singlelineedit within w_set_book
  58. end type
  59. type sle_sqldb_ldf_sor from singlelineedit within w_set_book
  60. end type
  61. type sle_bookcode from singlelineedit within w_set_book
  62. end type
  63. type gb_3 from groupbox within w_set_book
  64. end type
  65. type gb_1 from groupbox within w_set_book
  66. end type
  67. type gb_2 from groupbox within w_set_book
  68. end type
  69. end forward
  70. global type w_set_book from w_publ_base
  71. integer width = 2263
  72. integer height = 1296
  73. string title = "帐套设置"
  74. boolean minbox = false
  75. windowtype windowtype = response!
  76. long backcolor = 16777215
  77. boolean center = true
  78. cb_ok cb_ok
  79. cb_connect cb_connect
  80. st_1 st_1
  81. sle_bookname sle_bookname
  82. st_2 st_2
  83. sle_database sle_database
  84. st_10 st_10
  85. rb_1 rb_1
  86. rb_2 rb_2
  87. cb_1 cb_1
  88. st_11 st_11
  89. sle_fjname sle_fjname
  90. cb_ch3 cb_ch3
  91. sle_filename sle_filename
  92. cb_ch2 cb_ch2
  93. st_13 st_13
  94. sle_folder sle_folder
  95. cb_2 cb_2
  96. st_8 st_8
  97. cbx_fj cbx_fj
  98. cbx_yj cbx_yj
  99. sle_yjname sle_yjname
  100. cb_ch4 cb_ch4
  101. st_12 st_12
  102. ddlb_1 ddlb_1
  103. cbx_modify cbx_modify
  104. sle_sqldb_mdf_sor sle_sqldb_mdf_sor
  105. sle_sqldb_ldf_sor sle_sqldb_ldf_sor
  106. sle_bookcode sle_bookcode
  107. gb_3 gb_3
  108. gb_1 gb_1
  109. gb_2 gb_2
  110. end type
  111. global w_set_book w_set_book
  112. type prototypes
  113. Subroutine Sleep(ulong dwMilliseconds) LIBRARY "kernel32.dll"
  114. Function long ShellExecuteA (long hwnd, string lpOperation ,String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library "shell32.dll" alias for "ShellExecuteA;Ansi"
  115. Function long GetFullPathName (String lpFileName ,Long nBufferLength,ref string lpBuffer,ref long lpFilePart) library "kernel32" ALIAS FOR "GetFullPathNameA;Ansi"
  116. end prototypes
  117. type variables
  118. long ins_bookid = 0
  119. string ins_servername
  120. string ins_logid
  121. string ins_logpass
  122. string masterpath
  123. //string mssqlpath
  124. long ins_rslt = 0
  125. long ins_ifguid = 0
  126. end variables
  127. forward prototypes
  128. public subroutine wf_facechange ()
  129. public function integer wf_buildsqldb (ref string arg_msg)
  130. public function integer wf_chk_database (string arg_databasename, transaction arg_transaction)
  131. 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)
  132. public function integer wf_drop_database (string arg_databasename, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg)
  133. end prototypes
  134. public subroutine wf_facechange ();IF rb_2.Checked THEN
  135. cb_1.Text = '︾'
  136. cb_1.Visible = false
  137. st_11.Visible = false
  138. ELSE
  139. cb_1.Visible = true
  140. st_11.Visible = true
  141. END IF
  142. long ph
  143. ph = 150
  144. IF cb_1.Text = '︽' THEN
  145. This.Height = 1216 + ph
  146. gb_2.Visible = True
  147. st_12.Visible = True
  148. ddlb_1.Visible = True
  149. cbx_modify.Visible = True
  150. st_8.Visible = True
  151. sle_filename.Visible = true
  152. cb_ch2.Visible = true
  153. cbx_fj.Visible = true
  154. sle_fjname.visible = true
  155. cb_ch3.visible = true
  156. cbx_yj.visible = true
  157. sle_yjname.visible = true
  158. cb_ch4.visible = true
  159. st_13.visible = true
  160. sle_folder.visible = true
  161. cb_2.visible = true
  162. cb_ok.Y = 1084
  163. cb_exit.Y = 1084
  164. cb_connect.Y = 1084
  165. ELSE
  166. This.Height = 596 + ph
  167. gb_2.Visible = false
  168. st_12.Visible = false
  169. ddlb_1.Visible = false
  170. cbx_modify.Visible = false
  171. st_8.Visible = false
  172. sle_filename.Visible = false
  173. cb_ch2.Visible = false
  174. cbx_fj.Visible = false
  175. sle_fjname.visible = false
  176. cb_ch3.visible = false
  177. cbx_yj.visible = false
  178. sle_yjname.visible = false
  179. cb_ch4.visible = false
  180. st_13.visible = false
  181. sle_folder.visible = false
  182. cb_2.visible = false
  183. cb_ok.Y = 472
  184. cb_exit.Y = 472
  185. cb_connect.Y = 472
  186. END IF
  187. end subroutine
  188. public function integer wf_buildsqldb (ref string arg_msg);//wf_buildsqldb
  189. Integer li_FileNum,rslt = 1
  190. String comm,msg
  191. Long i,j,lu_return
  192. String ls_test
  193. String ls_dat
  194. String ls_databasename
  195. String ls_filename
  196. Transaction db_Transaction
  197. db_Transaction = Create Transaction
  198. Open(w_sys_wait)
  199. IF Trim(sle_folder.Text) = '' THEN
  200. arg_msg = '请输入目标文件路径!'
  201. rslt = 0
  202. GOTO ext
  203. END IF
  204. Int ll_result
  205. ll_result = createdirectory(sle_folder.Text)
  206. //IF ll_result = -1 THEN
  207. // arg_msg = '目标文件路径创建失败!'
  208. // rslt = 0
  209. // GOTO ext
  210. //END IF
  211. ls_dat = sle_filename.Text
  212. IF Not FileExists ( ls_dat ) THEN
  213. arg_msg = "主数据库文件不存在!"
  214. rslt = 0
  215. GOTO ext
  216. END IF
  217. IF rb_1.Checked THEN
  218. ls_dat = Trim(sle_fjname.Text)
  219. IF Not FileExists ( ls_dat ) THEN
  220. arg_msg = "附件数据库文件不存在!"
  221. rslt = 0
  222. GOTO ext
  223. END IF
  224. END IF
  225. IF cbx_yj.Checked THEN
  226. ls_dat = Trim(sle_yjname.Text)
  227. IF Not FileExists ( ls_dat ) THEN
  228. arg_msg = "邮件数据库文件不存在!"
  229. rslt = 0
  230. GOTO ext
  231. END IF
  232. END IF
  233. w_sys_wait.wf_set_msg("正在尝试新建数据库,此过程预计需要用时1分钟...")
  234. db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
  235. db_Transaction.Database = 'master'
  236. db_Transaction.UserID = ins_logid
  237. db_Transaction.DBPass = ins_logpass
  238. db_Transaction.LogID = ins_logid
  239. db_Transaction.LogPass = ins_logpass
  240. db_Transaction.ServerName = ins_servername
  241. db_Transaction.Lock = "RU"
  242. db_Transaction.AutoCommit = False
  243. db_Transaction.DBParm = "Database= 'master' ,PBTrimCharColumns='YES'"
  244. IF db_Transaction.Database = '' Or db_Transaction.ServerName = '' THEN
  245. arg_msg = "连接数据库失败!"
  246. rslt = 0
  247. GOTO ext
  248. END IF
  249. CONNECT Using db_Transaction;
  250. db_Transaction.AutoCommit = True
  251. IF db_Transaction.SQLCode <> 0 THEN
  252. DISCONNECT Using db_Transaction;
  253. arg_msg = '服务器连接失败!!'
  254. rslt = 0
  255. GOTO ext
  256. END IF
  257. //检查主数据库
  258. ls_databasename = Trim(sle_database.Text)
  259. IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
  260. IF MessageBox ("询问","主数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
  261. rslt = 2
  262. GOTO ext
  263. ELSE
  264. IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
  265. rslt = 0
  266. GOTO ext
  267. END IF
  268. END IF
  269. END IF
  270. //检查附件数据库
  271. ls_databasename = Trim(sle_database.Text)+ '_fj'
  272. IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
  273. IF MessageBox ("询问","附件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
  274. rslt = 2
  275. GOTO ext
  276. ELSE
  277. IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
  278. rslt = 0
  279. GOTO ext
  280. END IF
  281. END IF
  282. END IF
  283. //检查邮件数据库
  284. ls_databasename = Trim(sle_database.Text) + '_yj'
  285. IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
  286. IF MessageBox ("询问","邮件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
  287. rslt = 2
  288. GOTO ext
  289. ELSE
  290. IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
  291. rslt = 0
  292. GOTO ext
  293. END IF
  294. END IF
  295. END IF
  296. //新建主数据库
  297. ls_databasename = Trim(sle_database.Text)
  298. ls_filename = Trim(sle_filename.Text)
  299. //st_jd.Text = '正在新建主数据库'
  300. 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
  301. rslt = 0
  302. GOTO ext
  303. END IF
  304. comm = "DELETE FROM " + Trim(sle_database.Text) + ".dbo.U_OuterConnection"
  305. EXECUTE Immediate :comm Using db_Transaction;
  306. //新建附件数据库
  307. IF cbx_fj.Checked THEN
  308. ls_databasename = Trim(sle_database.Text)+ '_fj'
  309. ls_filename = Trim(sle_fjname.Text)
  310. // st_jd.Text = '正在新建附件数据库'
  311. IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, 'filemanage_Data', 'filemanage_Log', db_Transaction, False, arg_msg) = 0 THEN
  312. rslt = 0
  313. GOTO ext
  314. END IF
  315. String ls_MDF,ls_ldf
  316. ls_MDF = ls_databasename + ".MDF"
  317. ls_ldf = ls_databasename + ".ldf"
  318. comm = "INSERT INTO " + Trim(sle_database.Text) + ".dbo.U_OuterConnection ("+&
  319. "ConnectionID ,"+&
  320. "DBMS ,"+&
  321. "ConnectionName ,"+&
  322. "ConnectionType ,"+&
  323. "DataBaseName ,"+&
  324. "ServerName ,"+&
  325. "LogId ,"+&
  326. "LogPass ,"+&
  327. "mdf_name ,"+&
  328. "ldf_name ,"+&
  329. "opdate"+&
  330. ")"+&
  331. "VALUES"+&
  332. "("+&
  333. "11,"+&
  334. "'MSS Microsoft SQL Server 6.x',"+&
  335. "'附件数据库',"+&
  336. "0,"+&
  337. "'" + ls_databasename + "',"+&
  338. "'" + db_Transaction.ServerName+"',"+&
  339. "'" + db_Transaction.LogID + "',"+&
  340. "'" + db_Transaction.LogPass + "',"+&
  341. "'" + ls_MDF + "',"+&
  342. "'" + ls_ldf + "',"+&
  343. "getdate()"+&
  344. ");"
  345. EXECUTE Immediate :comm Using db_Transaction;
  346. IF db_Transaction.SQLCode <> 0 THEN
  347. rslt = 0
  348. arg_msg = '设置附件数据库连接失败,请手动设置,' + db_Transaction.SQLErrText
  349. GOTO ext
  350. END IF
  351. END IF
  352. //新建邮件数据库
  353. IF cbx_yj.Checked THEN
  354. ls_databasename = Trim(sle_database.Text) + '_yj'
  355. ls_filename = Trim(sle_yjname.Text)
  356. // st_jd.Text = '正在新建邮件数据库'
  357. IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, 'filemanage_Data', 'filemanage_Log', db_Transaction, False, arg_msg) = 0 THEN
  358. rslt = 0
  359. GOTO ext
  360. END IF
  361. ls_MDF = ls_databasename + ".MDF"
  362. ls_ldf = ls_databasename + ".ldf"
  363. comm = "INSERT INTO " + Trim(sle_database.Text) + ".dbo.U_OuterConnection ("+&
  364. "ConnectionID ,"+&
  365. "DBMS ,"+&
  366. "ConnectionName ,"+&
  367. "ConnectionType ,"+&
  368. "DataBaseName ,"+&
  369. "ServerName ,"+&
  370. "LogId ,"+&
  371. "LogPass ,"+&
  372. "mdf_name ,"+&
  373. "ldf_name ,"+&
  374. "opdate"+&
  375. ")"+&
  376. "VALUES"+&
  377. "("+&
  378. "12,"+&
  379. "'MSS Microsoft SQL Server 6.x',"+&
  380. "'邮件数据库',"+&
  381. "2,"+&
  382. "'" + ls_databasename + "',"+&
  383. "'" + db_Transaction.ServerName+"',"+&
  384. "'" + db_Transaction.LogID + "',"+&
  385. "'" + db_Transaction.LogPass + "',"+&
  386. "'" + ls_MDF + "',"+&
  387. "'" + ls_ldf + "',"+&
  388. "getdate()"+&
  389. ");"
  390. EXECUTE Immediate :comm Using db_Transaction;
  391. IF db_Transaction.SQLCode <> 0 THEN
  392. rslt = 0
  393. arg_msg = '设置邮件数据库连接失败,请手动设置,' + db_Transaction.SQLErrText
  394. GOTO ext
  395. END IF
  396. END IF
  397. ext:
  398. w_sys_wait.Hide()
  399. Close(w_sys_wait)
  400. IF rslt = 1 THEN
  401. COMMIT Using db_Transaction;
  402. ELSE
  403. ROLLBACK Using db_Transaction;
  404. END IF
  405. DISCONNECT Using db_Transaction;
  406. Destroy db_Transaction
  407. RETURN rslt
  408. end function
  409. public function integer wf_chk_database (string arg_databasename, transaction arg_transaction);String ls_test
  410. 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) "
  411. EXECUTE Immediate :ls_test Using arg_transaction;
  412. IF pos(arg_transaction.SQLErrText , 'Database existed' ) > 0 THEN
  413. RETURN 1
  414. ELSE
  415. RETURN 0
  416. END IF
  417. end function
  418. 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
  419. String comm
  420. comm = ' create DATABASE '+arg_databasename+&
  421. " 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'+"')"
  422. EXECUTE Immediate :comm Using arg_transaction;
  423. IF arg_transaction.SQLCode <> 0 THEN
  424. arg_msg = '建立数据库['+arg_databasename+']失败,请手动建立及恢复>'+arg_transaction.SQLErrText
  425. rslt = 0
  426. GOTO ext
  427. END IF
  428. // st_jd.Text = '正在恢复主数据库...'
  429. comm = 'RESTORE DATABASE '+arg_databasename+" from DISK= '"+arg_filename+"'"+&
  430. " WITH MOVE '"+arg_sqldb_mdf_sor+"' TO '"+arg_folder + '\' + arg_databasename+'_data.ldf'+"',"+&
  431. " MOVE '"+arg_sqldb_ldf_sor+"' TO '"+arg_folder + '\' + arg_databasename+'_log.ldf'+"',"+'REPLACE'
  432. EXECUTE Immediate :comm Using arg_transaction;
  433. IF arg_transaction.SQLCode <> 0 THEN
  434. arg_msg = '恢复数据库['+arg_databasename+']失败,请手动恢复>'+arg_transaction.SQLErrText
  435. rslt = 0
  436. END IF
  437. ext:
  438. IF rslt = 0 THEN
  439. ROLLBACK Using arg_transaction;
  440. ELSEIF arg_ifcommit THEN
  441. COMMIT Using arg_transaction;
  442. END IF
  443. RETURN rslt
  444. end function
  445. public function integer wf_drop_database (string arg_databasename, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg);Integer rslt = 1
  446. String comm
  447. comm = " IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'" + arg_databasename + "') DROP DATABASE [" + arg_databasename + "]"
  448. EXECUTE Immediate :comm Using arg_Transaction;
  449. IF arg_Transaction.SQLCode <> 0 THEN
  450. arg_msg = '删除数据库失败,请手动删除['+arg_databasename+']>'+arg_Transaction.SQLErrText
  451. rslt = 0
  452. ELSE
  453. rslt = 1
  454. END IF
  455. IF rslt = 0 THEN
  456. ROLLBACK Using arg_Transaction;
  457. ELSEIF arg_ifcommit THEN
  458. COMMIT Using arg_Transaction;
  459. END IF
  460. RETURN rslt
  461. end function
  462. on w_set_book.create
  463. int iCurrent
  464. call super::create
  465. this.cb_ok=create cb_ok
  466. this.cb_connect=create cb_connect
  467. this.st_1=create st_1
  468. this.sle_bookname=create sle_bookname
  469. this.st_2=create st_2
  470. this.sle_database=create sle_database
  471. this.st_10=create st_10
  472. this.rb_1=create rb_1
  473. this.rb_2=create rb_2
  474. this.cb_1=create cb_1
  475. this.st_11=create st_11
  476. this.sle_fjname=create sle_fjname
  477. this.cb_ch3=create cb_ch3
  478. this.sle_filename=create sle_filename
  479. this.cb_ch2=create cb_ch2
  480. this.st_13=create st_13
  481. this.sle_folder=create sle_folder
  482. this.cb_2=create cb_2
  483. this.st_8=create st_8
  484. this.cbx_fj=create cbx_fj
  485. this.cbx_yj=create cbx_yj
  486. this.sle_yjname=create sle_yjname
  487. this.cb_ch4=create cb_ch4
  488. this.st_12=create st_12
  489. this.ddlb_1=create ddlb_1
  490. this.cbx_modify=create cbx_modify
  491. this.sle_sqldb_mdf_sor=create sle_sqldb_mdf_sor
  492. this.sle_sqldb_ldf_sor=create sle_sqldb_ldf_sor
  493. this.sle_bookcode=create sle_bookcode
  494. this.gb_3=create gb_3
  495. this.gb_1=create gb_1
  496. this.gb_2=create gb_2
  497. iCurrent=UpperBound(this.Control)
  498. this.Control[iCurrent+1]=this.cb_ok
  499. this.Control[iCurrent+2]=this.cb_connect
  500. this.Control[iCurrent+3]=this.st_1
  501. this.Control[iCurrent+4]=this.sle_bookname
  502. this.Control[iCurrent+5]=this.st_2
  503. this.Control[iCurrent+6]=this.sle_database
  504. this.Control[iCurrent+7]=this.st_10
  505. this.Control[iCurrent+8]=this.rb_1
  506. this.Control[iCurrent+9]=this.rb_2
  507. this.Control[iCurrent+10]=this.cb_1
  508. this.Control[iCurrent+11]=this.st_11
  509. this.Control[iCurrent+12]=this.sle_fjname
  510. this.Control[iCurrent+13]=this.cb_ch3
  511. this.Control[iCurrent+14]=this.sle_filename
  512. this.Control[iCurrent+15]=this.cb_ch2
  513. this.Control[iCurrent+16]=this.st_13
  514. this.Control[iCurrent+17]=this.sle_folder
  515. this.Control[iCurrent+18]=this.cb_2
  516. this.Control[iCurrent+19]=this.st_8
  517. this.Control[iCurrent+20]=this.cbx_fj
  518. this.Control[iCurrent+21]=this.cbx_yj
  519. this.Control[iCurrent+22]=this.sle_yjname
  520. this.Control[iCurrent+23]=this.cb_ch4
  521. this.Control[iCurrent+24]=this.st_12
  522. this.Control[iCurrent+25]=this.ddlb_1
  523. this.Control[iCurrent+26]=this.cbx_modify
  524. this.Control[iCurrent+27]=this.sle_sqldb_mdf_sor
  525. this.Control[iCurrent+28]=this.sle_sqldb_ldf_sor
  526. this.Control[iCurrent+29]=this.sle_bookcode
  527. this.Control[iCurrent+30]=this.gb_3
  528. this.Control[iCurrent+31]=this.gb_1
  529. this.Control[iCurrent+32]=this.gb_2
  530. end on
  531. on w_set_book.destroy
  532. call super::destroy
  533. destroy(this.cb_ok)
  534. destroy(this.cb_connect)
  535. destroy(this.st_1)
  536. destroy(this.sle_bookname)
  537. destroy(this.st_2)
  538. destroy(this.sle_database)
  539. destroy(this.st_10)
  540. destroy(this.rb_1)
  541. destroy(this.rb_2)
  542. destroy(this.cb_1)
  543. destroy(this.st_11)
  544. destroy(this.sle_fjname)
  545. destroy(this.cb_ch3)
  546. destroy(this.sle_filename)
  547. destroy(this.cb_ch2)
  548. destroy(this.st_13)
  549. destroy(this.sle_folder)
  550. destroy(this.cb_2)
  551. destroy(this.st_8)
  552. destroy(this.cbx_fj)
  553. destroy(this.cbx_yj)
  554. destroy(this.sle_yjname)
  555. destroy(this.cb_ch4)
  556. destroy(this.st_12)
  557. destroy(this.ddlb_1)
  558. destroy(this.cbx_modify)
  559. destroy(this.sle_sqldb_mdf_sor)
  560. destroy(this.sle_sqldb_ldf_sor)
  561. destroy(this.sle_bookcode)
  562. destroy(this.gb_3)
  563. destroy(this.gb_1)
  564. destroy(this.gb_2)
  565. end on
  566. event open;call super::open;s_set_book_parm s_parm
  567. s_parm = Message.PowerObjectParm
  568. IF IsNull(s_parm) THEN
  569. ins_bookid = 0
  570. ins_ifguid = 0
  571. ELSE
  572. ins_bookid = s_parm.bookid
  573. ins_ifguid = s_parm.ifguid
  574. END IF
  575. IF IsNull(ins_bookid) THEN
  576. ins_bookid = 0
  577. END IF
  578. IF ins_bookid <= 0 THEN
  579. ins_bookid = 1
  580. END IF
  581. IF ins_bookid > 20 THEN
  582. ins_bookid = 20
  583. END IF
  584. sle_bookcode.Text = String(ins_bookid, '00')
  585. IF sys_cur_path = "" THEN
  586. Long rslt = 1
  587. String lpBuffer
  588. lpBuffer = Fill('',200)
  589. Long lpfilepart,li_FileNum
  590. rslt = GetFullPathName(sys_inifilename,196,lpBuffer,lpfilepart)
  591. sys_cur_path = Left(lpBuffer,Len(lpBuffer)-Len(sys_inifilename))
  592. END IF
  593. ins_servername = ProfileString (sys_inifilename, "database", "servername", "")
  594. ins_logid = ProfileString (sys_inifilename, "database", "logid", "SA")
  595. ins_logpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
  596. sle_sqldb_mdf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_mdf_sor", '')
  597. sle_sqldb_ldf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_ldf_sor",'' )
  598. String ls_fjname, ls_yjname
  599. ls_fjname = ProfileString (sys_inifilename, "database", "defaultfjdb",'' )
  600. ls_yjname = ProfileString (sys_inifilename, "database", "defaultyjdb",'' )
  601. IF ls_fjname = "" THEN
  602. ls_fjname = "企精灵附件数据库"
  603. END IF
  604. IF ls_yjname = "" THEN
  605. ls_yjname = "企精灵邮件数据库"
  606. END IF
  607. sle_fjname.Text = sys_cur_path + ls_fjname +'.dat'
  608. sle_yjname.Text = sys_cur_path + ls_yjname +'.dat'
  609. Long i
  610. String ls_temp
  611. FOR i = 1 To 3
  612. ls_temp = ProfileString (sys_inifilename, "database", "demodb" + String(i), '')
  613. IF ls_temp <> '' THEN
  614. ddlb_1.AddItem (ls_temp)
  615. END IF
  616. IF i = 1 THEN
  617. ddlb_1.Text = ls_temp
  618. sle_filename.Text = sys_cur_path + ddlb_1.Text + '.dat'
  619. END IF
  620. NEXT
  621. masterpath = sys_cur_path + 'database'
  622. sle_folder.Text = masterpath
  623. String ls_ini_book
  624. String ins_bookcode
  625. Long ins_ifuse
  626. ls_ini_book = ProfileString (sys_inifilename_other,'sys_dl_book', String(ins_bookid), '')
  627. IF ls_ini_book <> '' THEN
  628. sle_bookname.Text = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
  629. ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
  630. sle_database.Text = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
  631. ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
  632. ins_bookcode = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
  633. ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
  634. ins_ifuse = Long(ls_ini_book)
  635. rb_2.Checked = True
  636. ELSE
  637. sle_database.Text = "EW5_DB"
  638. // rb_1.Checked = True
  639. END IF
  640. cb_1.Text = '︾'
  641. IF ins_ifguid = 1 THEN
  642. This.Title = '2.' + This.Title
  643. gb_1.Text = '2.' + gb_1.Text
  644. cb_ok.Text = '完成'
  645. END IF
  646. wf_facechange()
  647. end event
  648. event close;call super::close;closewithreturn(this, ins_rslt)
  649. end event
  650. type cb_func from w_publ_base`cb_func within w_set_book
  651. boolean visible = false
  652. end type
  653. type cb_exit from w_publ_base`cb_exit within w_set_book
  654. integer x = 1838
  655. integer y = 1084
  656. end type
  657. type cb_ok from uo_imflatbutton within w_set_book
  658. integer x = 1426
  659. integer y = 1084
  660. integer width = 311
  661. integer height = 96
  662. integer taborder = 20
  663. boolean bringtotop = true
  664. string normalpicname = "ok.bmp"
  665. end type
  666. event clicked;call super::clicked;IF Trim(sle_bookname.Text) = '' THEN
  667. MessageBox('系统提示','请输入帐套!',information!,OK!)
  668. RETURN
  669. END IF
  670. IF Trim(sle_database.Text) = '' THEN
  671. MessageBox('系统提示','请输入数据库!',information!,OK!)
  672. RETURN
  673. END IF
  674. IF rb_1.Checked THEN
  675. String ls_msg
  676. Int ll_rslt
  677. ll_rslt = wf_buildsqldb(ls_msg) //1-成功
  678. IF ll_rslt = 0 THEN //错误
  679. MessageBox("提示",ls_msg,information!,OK!)
  680. RETURN
  681. ELSEIF ll_rslt = 2 THEN //取消
  682. RETURN
  683. END IF
  684. END IF
  685. SetProfileString (sys_inifilename, "database", "bookname", sle_bookname.Text )
  686. SetProfileString (sys_inifilename, "database", "database", sle_database.Text)
  687. SetProfileString (sys_inifilename, "database", "sqldb_mdf_sor", sle_sqldb_mdf_sor.Text)
  688. SetProfileString (sys_inifilename, "database", "sqldb_ldf_sor", sle_sqldb_ldf_sor.Text)
  689. //增加一个帐套
  690. String ls_ini_book
  691. string is_bookcode
  692. Long id
  693. String ifuse
  694. is_bookcode = string(ins_bookid, '00')
  695. id = ins_bookid
  696. String ls_temp
  697. ls_temp = Trim(sle_bookname.Text) + ':'+&
  698. Trim(sle_database.Text)+ ':'+&
  699. is_bookcode+':'+&
  700. '1'
  701. //SetProfileString (sys_inifilename_other,'sys_dl_book', '1', f_psw_bczh(ls_temp,0,sys_power_key))
  702. SetProfileString (sys_inifilename_other,'sys_dl_book', String(id), ls_temp)
  703. SetProfileString(sys_inifilename,'longjoews','LastAcount',Trim(sle_bookname.Text))
  704. SetProfileString (sys_inifilename, "database", "firstrun","0")
  705. ins_rslt = 1
  706. close(parent)
  707. //MessageBox('提示','设置保存完成!系统必须重启!')
  708. //
  709. //Restart()
  710. end event
  711. type cb_connect from uo_imflatbutton within w_set_book
  712. integer x = 283
  713. integer y = 1084
  714. integer width = 315
  715. integer height = 96
  716. integer taborder = 90
  717. boolean bringtotop = true
  718. string text = "测试连接"
  719. end type
  720. event clicked;call super::clicked;String ls_database = "master"
  721. IF rb_2.Checked THEN
  722. ls_database = sle_database.Text
  723. END IF
  724. Open(w_sys_wait)
  725. w_sys_wait.wf_set_msg("正在尝试连接数据库,此过程预计需要用时1分钟...")
  726. Transaction db_Transaction
  727. db_Transaction = Create Transaction
  728. db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
  729. db_Transaction.Database = ls_database
  730. db_Transaction.UserID = ins_logid
  731. db_Transaction.DBPass = ins_logpass
  732. db_Transaction.LogID = ins_logid
  733. db_Transaction.LogPass = ins_logpass
  734. db_Transaction.ServerName = ins_servername
  735. db_Transaction.Lock = "RU"
  736. db_Transaction.AutoCommit = False
  737. db_Transaction.DBParm = "Database= '" + ls_database + "',PBTrimCharColumns='YES'"
  738. CONNECT Using db_Transaction;
  739. Int rslt = 1
  740. String arg_msg = ''
  741. IF db_Transaction.SQLCode < 0 THEN
  742. rslt = 0
  743. arg_msg = "连接数据库失败!"
  744. IF Pos(db_Transaction.SQLErrText, "'"+ins_logid+"'") > 0 THEN
  745. arg_msg = arg_msg + "用户密码错误!"
  746. END IF
  747. IF Pos(db_Transaction.SQLErrText, "'"+ls_database+"'") > 0 THEN
  748. arg_msg = arg_msg + "数据库不存在!"
  749. END IF
  750. ELSE
  751. rslt = 1
  752. END IF
  753. DISCONNECT Using db_Transaction;
  754. Destroy db_Transaction;
  755. Close(w_sys_wait)
  756. IF rslt = 0 THEN
  757. MessageBox("系统提示",arg_msg)
  758. ELSE
  759. MessageBox("系统提示","连接数据库成功!")
  760. END IF
  761. end event
  762. type st_1 from statictext within w_set_book
  763. integer x = 146
  764. integer y = 128
  765. integer width = 256
  766. integer height = 60
  767. boolean bringtotop = true
  768. integer textsize = -8
  769. integer weight = 400
  770. fontpitch fontpitch = variable!
  771. fontfamily fontfamily = swiss!
  772. string facename = "MS Sans Serif"
  773. long textcolor = 41943040
  774. long backcolor = 16777215
  775. boolean enabled = false
  776. string text = "帐套名称:"
  777. alignment alignment = right!
  778. boolean focusrectangle = false
  779. end type
  780. type sle_bookname from singlelineedit within w_set_book
  781. integer x = 416
  782. integer y = 116
  783. integer width = 1504
  784. integer height = 80
  785. integer taborder = 20
  786. boolean bringtotop = true
  787. integer textsize = -8
  788. integer weight = 400
  789. fontpitch fontpitch = variable!
  790. fontfamily fontfamily = swiss!
  791. string facename = "MS Sans Serif"
  792. long textcolor = 41943040
  793. string text = "演示帐套"
  794. boolean autohscroll = false
  795. borderstyle borderstyle = stylelowered!
  796. end type
  797. type st_2 from statictext within w_set_book
  798. integer x = 105
  799. integer y = 228
  800. integer width = 297
  801. integer height = 60
  802. boolean bringtotop = true
  803. integer textsize = -8
  804. integer weight = 400
  805. fontpitch fontpitch = variable!
  806. fontfamily fontfamily = swiss!
  807. string facename = "MS Sans Serif"
  808. long textcolor = 41943040
  809. long backcolor = 16777215
  810. boolean enabled = false
  811. string text = "数据库名称:"
  812. alignment alignment = right!
  813. boolean focusrectangle = false
  814. end type
  815. type sle_database from singlelineedit within w_set_book
  816. integer x = 416
  817. integer y = 216
  818. integer width = 1655
  819. integer height = 80
  820. integer taborder = 30
  821. boolean bringtotop = true
  822. integer textsize = -8
  823. integer weight = 400
  824. fontpitch fontpitch = variable!
  825. fontfamily fontfamily = swiss!
  826. string facename = "MS Sans Serif"
  827. long textcolor = 41943040
  828. boolean autohscroll = false
  829. borderstyle borderstyle = stylelowered!
  830. end type
  831. type st_10 from statictext within w_set_book
  832. integer x = 78
  833. integer y = 328
  834. integer width = 325
  835. integer height = 60
  836. boolean bringtotop = true
  837. integer textsize = -8
  838. integer weight = 400
  839. fontpitch fontpitch = variable!
  840. fontfamily fontfamily = swiss!
  841. string facename = "MS Sans Serif"
  842. long textcolor = 41943040
  843. long backcolor = 16777215
  844. boolean enabled = false
  845. string text = "初始化类型:"
  846. alignment alignment = right!
  847. boolean focusrectangle = false
  848. end type
  849. type rb_1 from radiobutton within w_set_book
  850. integer x = 457
  851. integer y = 336
  852. integer width = 402
  853. integer height = 60
  854. boolean bringtotop = true
  855. integer textsize = -9
  856. integer weight = 400
  857. fontcharset fontcharset = gb2312charset!
  858. fontpitch fontpitch = variable!
  859. string facename = "宋体"
  860. long textcolor = 33554432
  861. long backcolor = 16777215
  862. boolean enabled = false
  863. string text = "新建数据库"
  864. end type
  865. event clicked;wf_facechange()
  866. end event
  867. type rb_2 from radiobutton within w_set_book
  868. integer x = 887
  869. integer y = 336
  870. integer width = 466
  871. integer height = 60
  872. boolean bringtotop = true
  873. integer textsize = -9
  874. integer weight = 400
  875. fontcharset fontcharset = gb2312charset!
  876. fontpitch fontpitch = variable!
  877. string facename = "宋体"
  878. long textcolor = 33554432
  879. long backcolor = 16777215
  880. string text = "连接现有数据库"
  881. boolean checked = true
  882. end type
  883. event clicked;wf_facechange()
  884. end event
  885. type cb_1 from commandbutton within w_set_book
  886. integer x = 1742
  887. integer y = 316
  888. integer width = 82
  889. integer height = 84
  890. integer taborder = 20
  891. boolean bringtotop = true
  892. integer textsize = -9
  893. integer weight = 400
  894. fontcharset fontcharset = gb2312charset!
  895. fontpitch fontpitch = variable!
  896. string facename = "宋体"
  897. string text = "︾"
  898. end type
  899. event clicked;IF cb_1.Text = '︽' THEN
  900. cb_1.Text = '︾'
  901. ELSE
  902. cb_1.Text = '︽'
  903. END IF
  904. wf_facechange()
  905. end event
  906. type st_11 from statictext within w_set_book
  907. integer x = 1833
  908. integer y = 332
  909. integer width = 233
  910. integer height = 48
  911. boolean bringtotop = true
  912. integer textsize = -9
  913. integer weight = 400
  914. fontcharset fontcharset = gb2312charset!
  915. fontpitch fontpitch = variable!
  916. string facename = "宋体"
  917. long textcolor = 33554432
  918. long backcolor = 16777215
  919. string text = "高级选项"
  920. boolean focusrectangle = false
  921. end type
  922. type sle_fjname from singlelineedit within w_set_book
  923. integer x = 416
  924. integer y = 744
  925. integer width = 1655
  926. integer height = 80
  927. integer taborder = 170
  928. boolean bringtotop = true
  929. integer textsize = -9
  930. integer weight = 400
  931. fontcharset fontcharset = gb2312charset!
  932. fontpitch fontpitch = variable!
  933. string facename = "宋体"
  934. long textcolor = 33554432
  935. borderstyle borderstyle = stylelowered!
  936. end type
  937. type cb_ch3 from commandbutton within w_set_book
  938. integer x = 2080
  939. integer y = 744
  940. integer width = 114
  941. integer height = 84
  942. integer taborder = 220
  943. boolean bringtotop = true
  944. integer textsize = -9
  945. integer weight = 400
  946. fontcharset fontcharset = gb2312charset!
  947. fontpitch fontpitch = variable!
  948. string facename = "宋体"
  949. string text = "..."
  950. end type
  951. event clicked;
  952. Integer i
  953. String Pathname,Filename
  954. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
  955. IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
  956. sle_fjname.Text = Pathname
  957. END IF
  958. end event
  959. type sle_filename from singlelineedit within w_set_book
  960. integer x = 416
  961. integer y = 640
  962. integer width = 1655
  963. integer height = 80
  964. integer taborder = 160
  965. boolean bringtotop = true
  966. integer textsize = -9
  967. integer weight = 400
  968. fontcharset fontcharset = gb2312charset!
  969. fontpitch fontpitch = variable!
  970. string facename = "宋体"
  971. long textcolor = 33554432
  972. boolean enabled = false
  973. borderstyle borderstyle = stylelowered!
  974. end type
  975. type cb_ch2 from commandbutton within w_set_book
  976. integer x = 2080
  977. integer y = 640
  978. integer width = 114
  979. integer height = 84
  980. integer taborder = 210
  981. boolean bringtotop = true
  982. integer textsize = -9
  983. integer weight = 400
  984. fontcharset fontcharset = gb2312charset!
  985. fontpitch fontpitch = variable!
  986. string facename = "宋体"
  987. boolean enabled = false
  988. string text = "..."
  989. end type
  990. event clicked;
  991. Integer i
  992. String Pathname,Filename
  993. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
  994. IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
  995. sle_filename.Text = Pathname
  996. END IF
  997. end event
  998. type st_13 from statictext within w_set_book
  999. integer x = 32
  1000. integer y = 976
  1001. integer width = 370
  1002. integer height = 76
  1003. boolean bringtotop = true
  1004. integer textsize = -9
  1005. integer weight = 400
  1006. fontcharset fontcharset = gb2312charset!
  1007. fontpitch fontpitch = variable!
  1008. string facename = "宋体"
  1009. long textcolor = 33554432
  1010. long backcolor = 16777215
  1011. boolean enabled = false
  1012. string text = "目标文件路径:"
  1013. alignment alignment = right!
  1014. boolean focusrectangle = false
  1015. end type
  1016. type sle_folder from singlelineedit within w_set_book
  1017. integer x = 416
  1018. integer y = 960
  1019. integer width = 1655
  1020. integer height = 80
  1021. integer taborder = 200
  1022. boolean bringtotop = true
  1023. integer textsize = -9
  1024. integer weight = 400
  1025. fontcharset fontcharset = gb2312charset!
  1026. fontpitch fontpitch = variable!
  1027. string facename = "宋体"
  1028. long textcolor = 33554432
  1029. borderstyle borderstyle = stylelowered!
  1030. end type
  1031. type cb_2 from commandbutton within w_set_book
  1032. integer x = 2080
  1033. integer y = 960
  1034. integer width = 114
  1035. integer height = 84
  1036. integer taborder = 250
  1037. boolean bringtotop = true
  1038. integer textsize = -9
  1039. integer weight = 400
  1040. fontcharset fontcharset = gb2312charset!
  1041. fontpitch fontpitch = variable!
  1042. string facename = "宋体"
  1043. string text = "..."
  1044. end type
  1045. event clicked;
  1046. //
  1047. //GetFolder()
  1048. //功 能:显示文件夹选择对话框。
  1049. //语 法:GetFolder (title , director )
  1050. //参 数:title:String类型,指定文件夹选择框的标题;
  1051. // directory:String类型,文件夹的路径,即指定显示哪个文件夹下的子文件夹,又用于保存用户最终选择的文件夹的路径。
  1052. //返回值:Integer。函数执行成功时返回1,发生错误时返回-1。当用户选择了”取消”按钮或直接关闭对话框,函数返回0。
  1053. //示 例: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:
  1054. string ls_path
  1055. integer li_result
  1056. ls_path = mid(sys_cur_path,1,len(sys_cur_path )- 1)
  1057. li_result = GetFolder( "目标文件路径", ls_path )
  1058. sle_folder.text=ls_path
  1059. end event
  1060. type st_8 from statictext within w_set_book
  1061. integer x = 32
  1062. integer y = 652
  1063. integer width = 370
  1064. integer height = 76
  1065. boolean bringtotop = true
  1066. integer textsize = -9
  1067. integer weight = 400
  1068. fontcharset fontcharset = gb2312charset!
  1069. fontpitch fontpitch = variable!
  1070. string facename = "宋体"
  1071. long textcolor = 33554432
  1072. long backcolor = 16777215
  1073. boolean enabled = false
  1074. string text = "主数据库:"
  1075. alignment alignment = right!
  1076. boolean focusrectangle = false
  1077. end type
  1078. type cbx_fj from checkbox within w_set_book
  1079. integer x = 27
  1080. integer y = 756
  1081. integer width = 375
  1082. integer height = 60
  1083. boolean bringtotop = true
  1084. integer textsize = -9
  1085. integer weight = 400
  1086. fontcharset fontcharset = gb2312charset!
  1087. fontpitch fontpitch = variable!
  1088. string facename = "宋体"
  1089. long textcolor = 33554432
  1090. long backcolor = 16777215
  1091. string text = "附件数据库:"
  1092. boolean checked = true
  1093. end type
  1094. event clicked;if rb_2.checked then return
  1095. IF cbx_fj.Checked THEN
  1096. sle_fjname.Enabled = TRUE
  1097. cb_ch3.Enabled = TRUE
  1098. ELSE
  1099. sle_fjname.Enabled = FALSE
  1100. cb_ch3.Enabled = FALSE
  1101. END IF
  1102. end event
  1103. type cbx_yj from checkbox within w_set_book
  1104. integer x = 27
  1105. integer y = 864
  1106. integer width = 384
  1107. integer height = 60
  1108. boolean bringtotop = true
  1109. integer textsize = -9
  1110. integer weight = 400
  1111. fontcharset fontcharset = gb2312charset!
  1112. fontpitch fontpitch = variable!
  1113. string facename = "宋体"
  1114. long textcolor = 33554432
  1115. long backcolor = 16777215
  1116. string text = "邮件数据库:"
  1117. boolean checked = true
  1118. end type
  1119. event clicked;IF rb_2.Checked THEN RETURN
  1120. IF cbx_yj.Checked THEN
  1121. sle_yjname.Enabled = TRUE
  1122. cb_ch4.Enabled = TRUE
  1123. ELSE
  1124. sle_yjname.Enabled = FALSE
  1125. cb_ch4.Enabled = FALSE
  1126. END IF
  1127. end event
  1128. type sle_yjname from singlelineedit within w_set_book
  1129. integer x = 416
  1130. integer y = 852
  1131. integer width = 1655
  1132. integer height = 80
  1133. integer taborder = 180
  1134. boolean bringtotop = true
  1135. integer textsize = -9
  1136. integer weight = 400
  1137. fontcharset fontcharset = gb2312charset!
  1138. fontpitch fontpitch = variable!
  1139. string facename = "宋体"
  1140. long textcolor = 33554432
  1141. borderstyle borderstyle = stylelowered!
  1142. end type
  1143. type cb_ch4 from commandbutton within w_set_book
  1144. integer x = 2080
  1145. integer y = 852
  1146. integer width = 114
  1147. integer height = 84
  1148. integer taborder = 240
  1149. boolean bringtotop = true
  1150. integer textsize = -9
  1151. integer weight = 400
  1152. fontcharset fontcharset = gb2312charset!
  1153. fontpitch fontpitch = variable!
  1154. string facename = "宋体"
  1155. string text = "..."
  1156. end type
  1157. event clicked;
  1158. Integer i
  1159. String Pathname,Filename
  1160. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
  1161. IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
  1162. sle_yjname.Text = Pathname
  1163. END IF
  1164. end event
  1165. type st_12 from statictext within w_set_book
  1166. integer x = 105
  1167. integer y = 540
  1168. integer width = 297
  1169. integer height = 60
  1170. boolean bringtotop = true
  1171. integer textsize = -8
  1172. integer weight = 400
  1173. fontpitch fontpitch = variable!
  1174. fontfamily fontfamily = swiss!
  1175. string facename = "MS Sans Serif"
  1176. long textcolor = 41943040
  1177. long backcolor = 16777215
  1178. boolean enabled = false
  1179. string text = "数据库来源:"
  1180. alignment alignment = right!
  1181. boolean focusrectangle = false
  1182. end type
  1183. type ddlb_1 from dropdownlistbox within w_set_book
  1184. integer x = 416
  1185. integer y = 532
  1186. integer width = 1166
  1187. integer height = 300
  1188. integer taborder = 40
  1189. boolean bringtotop = true
  1190. integer textsize = -9
  1191. integer weight = 400
  1192. fontcharset fontcharset = gb2312charset!
  1193. fontpitch fontpitch = variable!
  1194. string facename = "宋体"
  1195. long textcolor = 33554432
  1196. borderstyle borderstyle = stylelowered!
  1197. end type
  1198. event selectionchanged;sle_filename.text = sys_cur_path + this.text + '.dat'
  1199. end event
  1200. type cbx_modify from checkbox within w_set_book
  1201. integer x = 1600
  1202. integer y = 540
  1203. integer width = 311
  1204. integer height = 60
  1205. integer taborder = 50
  1206. boolean bringtotop = true
  1207. integer textsize = -9
  1208. integer weight = 400
  1209. fontcharset fontcharset = gb2312charset!
  1210. fontpitch fontpitch = variable!
  1211. string facename = "宋体"
  1212. long textcolor = 33554432
  1213. long backcolor = 16777215
  1214. string text = "手动修改"
  1215. end type
  1216. event clicked;IF THIS.Checked THEN
  1217. ddlb_1.Enabled = FALSE
  1218. cb_ch2.Enabled = TRUE
  1219. sle_filename.Enabled = TRUE
  1220. sle_filename.text = ''
  1221. ELSE
  1222. ddlb_1.Enabled = TRUE
  1223. cb_ch2.Enabled = FALSE
  1224. sle_filename.Enabled = FALSE
  1225. sle_filename.text = sys_cur_path + ddlb_1.text + '.dat'
  1226. END IF
  1227. end event
  1228. type sle_sqldb_mdf_sor from singlelineedit within w_set_book
  1229. boolean visible = false
  1230. integer x = 1582
  1231. integer y = 372
  1232. integer width = 1655
  1233. integer height = 80
  1234. integer taborder = 190
  1235. boolean bringtotop = true
  1236. integer textsize = -9
  1237. integer weight = 400
  1238. fontcharset fontcharset = gb2312charset!
  1239. fontpitch fontpitch = variable!
  1240. string facename = "宋体"
  1241. long textcolor = 33554432
  1242. borderstyle borderstyle = stylelowered!
  1243. end type
  1244. type sle_sqldb_ldf_sor from singlelineedit within w_set_book
  1245. boolean visible = false
  1246. integer x = 1582
  1247. integer y = 464
  1248. integer width = 1655
  1249. integer height = 80
  1250. integer taborder = 230
  1251. boolean bringtotop = true
  1252. integer textsize = -9
  1253. integer weight = 400
  1254. fontcharset fontcharset = gb2312charset!
  1255. fontpitch fontpitch = variable!
  1256. string facename = "宋体"
  1257. long textcolor = 33554432
  1258. borderstyle borderstyle = stylelowered!
  1259. end type
  1260. type sle_bookcode from singlelineedit within w_set_book
  1261. integer x = 1934
  1262. integer y = 116
  1263. integer width = 137
  1264. integer height = 80
  1265. integer taborder = 30
  1266. boolean bringtotop = true
  1267. integer textsize = -8
  1268. integer weight = 400
  1269. fontcharset fontcharset = ansi!
  1270. fontpitch fontpitch = variable!
  1271. fontfamily fontfamily = swiss!
  1272. string facename = "MS Sans Serif"
  1273. long textcolor = 41943040
  1274. boolean enabled = false
  1275. string text = "none"
  1276. boolean displayonly = true
  1277. borderstyle borderstyle = stylelowered!
  1278. end type
  1279. type gb_3 from groupbox within w_set_book
  1280. integer x = 416
  1281. integer y = 296
  1282. integer width = 1051
  1283. integer height = 120
  1284. integer taborder = 300
  1285. integer textsize = -9
  1286. integer weight = 400
  1287. fontcharset fontcharset = gb2312charset!
  1288. fontpitch fontpitch = variable!
  1289. string facename = "宋体"
  1290. long textcolor = 16711680
  1291. long backcolor = 16777215
  1292. end type
  1293. type gb_1 from groupbox within w_set_book
  1294. integer x = 18
  1295. integer y = 48
  1296. integer width = 2217
  1297. integer height = 388
  1298. integer taborder = 270
  1299. integer textsize = -9
  1300. integer weight = 400
  1301. fontcharset fontcharset = gb2312charset!
  1302. fontpitch fontpitch = variable!
  1303. string facename = "宋体"
  1304. long textcolor = 33554432
  1305. long backcolor = 16777215
  1306. string text = "帐套设置"
  1307. end type
  1308. type gb_2 from groupbox within w_set_book
  1309. integer x = 18
  1310. integer y = 452
  1311. integer width = 2217
  1312. integer height = 612
  1313. integer taborder = 280
  1314. integer textsize = -9
  1315. integer weight = 400
  1316. fontcharset fontcharset = gb2312charset!
  1317. fontpitch fontpitch = variable!
  1318. string facename = "宋体"
  1319. long textcolor = 33554432
  1320. long backcolor = 16777215
  1321. string text = "高级选项"
  1322. end type