w_system_setting.srw 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500
  1. $PBExportHeader$w_system_setting.srw
  2. forward
  3. global type w_system_setting from window
  4. end type
  5. type cb_3 from uo_imflatbutton within w_system_setting
  6. end type
  7. type dw_1 from u_dw_rbtnfilter within w_system_setting
  8. end type
  9. type st_database from statictext within w_system_setting
  10. end type
  11. type st_server from statictext within w_system_setting
  12. end type
  13. type cb_2 from uo_imflatbutton within w_system_setting
  14. end type
  15. type cb_1 from uo_imflatbutton within w_system_setting
  16. end type
  17. type cb_ch from uo_imflatbutton within w_system_setting
  18. end type
  19. type cb_output_file from uo_imflatbutton within w_system_setting
  20. end type
  21. type cb_input_file from uo_imflatbutton within w_system_setting
  22. end type
  23. type st_1 from statictext within w_system_setting
  24. end type
  25. type sle_filename from singlelineedit within w_system_setting
  26. end type
  27. type tv_func from treeview within w_system_setting
  28. end type
  29. type cb_end from uo_imflatbutton within w_system_setting
  30. end type
  31. type cb_clear_all from uo_imflatbutton within w_system_setting
  32. end type
  33. type cb_select_all from uo_imflatbutton within w_system_setting
  34. end type
  35. type gb_3 from groupbox within w_system_setting
  36. end type
  37. end forward
  38. global type w_system_setting from window
  39. integer x = 5
  40. integer y = 4
  41. integer width = 4151
  42. integer height = 1784
  43. boolean titlebar = true
  44. string title = "系统功能设定"
  45. boolean controlmenu = true
  46. boolean minbox = true
  47. boolean maxbox = true
  48. windowtype windowtype = popup!
  49. windowstate windowstate = maximized!
  50. long backcolor = 80269524
  51. boolean center = true
  52. cb_3 cb_3
  53. dw_1 dw_1
  54. st_database st_database
  55. st_server st_server
  56. cb_2 cb_2
  57. cb_1 cb_1
  58. cb_ch cb_ch
  59. cb_output_file cb_output_file
  60. cb_input_file cb_input_file
  61. st_1 st_1
  62. sle_filename sle_filename
  63. tv_func tv_func
  64. cb_end cb_end
  65. cb_clear_all cb_clear_all
  66. cb_select_all cb_select_all
  67. gb_3 gb_3
  68. end type
  69. global w_system_setting w_system_setting
  70. type prototypes
  71. subroutine keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'
  72. end prototypes
  73. type variables
  74. long deep=0,il_handle
  75. end variables
  76. forward prototypes
  77. public function string wf_getright ()
  78. public function integer wf_build_functree ()
  79. public function integer pf_treegrowth (long arg_handl, long arg_funcid, integer arg_lp)
  80. public subroutine wf_refresh_tvchild (long arg_handl, string arg_rightstr)
  81. public subroutine wf_refresh_tvnext (long arg_handl, string arg_rightstr)
  82. public subroutine wf_getright_tvchild (long arg_handl, ref string arg_rightstr)
  83. public subroutine wf_getright_tvnext (long arg_handl, ref string arg_rightstr)
  84. public subroutine wf_set_tvparent (long arg_handl)
  85. public subroutine wf_set_tvchild (long arg_handl)
  86. public subroutine wf_refresh ()
  87. public subroutine wf_clear_tvchild (long arg_handl, integer arg_statepictureindex)
  88. public subroutine wf_clear_tvnext (long arg_handl, integer arg_statepictureindex)
  89. public subroutine wf_set_tvnext (long arg_handl)
  90. end prototypes
  91. public function string wf_getright ();string ls_ret
  92. ls_ret=fill("0",2000)
  93. long ll_handl
  94. ll_handl = tv_func.finditem(RootTreeItem!,0)
  95. if ll_handl > 0 then wf_getright_tvchild(ll_handl,ls_ret)
  96. return ls_ret
  97. end function
  98. public function integer wf_build_functree ();//====================================================================
  99. // Function: wf_build_functree()
  100. //--------------------------------------------------------------------
  101. // Description:
  102. //--------------------------------------------------------------------
  103. // Arguments:(None)
  104. //--------------------------------------------------------------------
  105. // Returns: integer
  106. //--------------------------------------------------------------------
  107. // Author: yyx Date: 2004.11.16
  108. //--------------------------------------------------------------------
  109. // Modify History:
  110. //
  111. //====================================================================
  112. long hand
  113. deep=1
  114. long tvi_hdl = 0
  115. do until tv_func.finditem(roottreeitem!, 0) = -1
  116. tv_func.deleteitem(tvi_hdl)
  117. loop
  118. hand=tv_func.insertitemlast(0,sys_message_title,1)
  119. pf_treegrowth(hand,0,2)
  120. tv_func.expanditem(hand)
  121. return 1
  122. end function
  123. public function integer pf_treegrowth (long arg_handl, long arg_funcid, integer arg_lp);//====================================================================
  124. // function: pf_treegrowth()
  125. //--------------------------------------------------------------------
  126. // description:
  127. //--------------------------------------------------------------------
  128. // arguments:
  129. // value long arg_handl
  130. // value long arg_funcid
  131. // value integer arg_lp
  132. //--------------------------------------------------------------------
  133. // returns: integer
  134. //--------------------------------------------------------------------
  135. // author: yyx date: 2004.11.16
  136. //--------------------------------------------------------------------
  137. // modify history:
  138. //
  139. //====================================================================
  140. Int rslt = 1
  141. s_sys_func ls_s_func[]
  142. Long count = 0,ls_i
  143. Long handl
  144. treeviewitem tvi
  145. deep++
  146. IF deep > 100000 THEN //防止死递归
  147. RETURN 0
  148. END IF
  149. String ls_filter
  150. ls_filter = 'parentid='+String(arg_funcid)
  151. sys_ds_funcinfo.SetFilter(ls_filter)
  152. sys_ds_funcinfo.Filter()
  153. FOR ls_i = 1 To sys_ds_funcinfo.RowCount( )
  154. //if sys_ds_funcinfo.object.if_use[ls_i] = 0 then continue
  155. IF sys_ds_funcinfo.Object.parentid[ls_i] = arg_funcid THEN
  156. count++
  157. ls_s_func[count].funcid = sys_ds_funcinfo.Object.funcid[ls_i]
  158. ls_s_func[count].treename = sys_ds_funcinfo.Object.treename[ls_i]
  159. ls_s_func[count].MenuName = sys_ds_funcinfo.Object.MenuName[ls_i]
  160. ls_s_func[count].parentid = sys_ds_funcinfo.Object.parentid[ls_i]
  161. ls_s_func[count].sortflag = sys_ds_funcinfo.Object.sortflag[ls_i]
  162. ls_s_func[count].functype = sys_ds_funcinfo.Object.functype[ls_i]
  163. ls_s_func[count].mainid = sys_ds_funcinfo.Object.mainid[ls_i]
  164. ls_s_func[count].if_use = sys_ds_funcinfo.Object.if_use[ls_i]
  165. ls_s_func[count].versiontype = sys_ds_funcinfo.Object.versiontype[ls_i]
  166. ls_s_func[count].worktype = sys_ds_funcinfo.Object.worktype[ls_i]
  167. ls_s_func[count].moduleid = sys_ds_funcinfo.Object.moduleid[ls_i]
  168. END IF
  169. NEXT
  170. String ls_item
  171. FOR ls_i = 1 To count
  172. ls_item = String(ls_s_func[ls_i].funcid)
  173. ls_item = Space(5 - Len(ls_item)) + ls_item+' - '+ls_s_func[ls_i].treename
  174. IF ls_s_func[ls_i].mainid > 0 THEN
  175. ls_item += ' ['+String(ls_s_func[ls_i].mainid)+']'
  176. END IF
  177. IF ls_s_func[ls_i].if_use = 0 THEN
  178. ls_item += ' *'
  179. END IF
  180. ls_item += ' '
  181. IF ls_s_func[ls_i].versiontype = -1 THEN
  182. ls_item += ' 公共'
  183. elseIF ls_s_func[ls_i].versiontype = 0 THEN
  184. ls_item += ' 工业'
  185. elseIF ls_s_func[ls_i].versiontype = 1 THEN
  186. ls_item += ' 商业'
  187. elseIF ls_s_func[ls_i].versiontype = 2 THEN
  188. ls_item += ' 工业+'
  189. END IF
  190. // IF ls_s_func[ls_i].worktype = 0 THEN
  191. // ls_item += ' W[公共]'
  192. // elseIF ls_s_func[ls_i].worktype = 1 THEN
  193. // ls_item += ' W[单机]'
  194. // elseIF ls_s_func[ls_i].worktype = 2 THEN
  195. // ls_item += ' W[网络]'
  196. // END IF
  197. handl = tv_func.InsertItemLast(arg_handl,ls_item,arg_lp) //生成树
  198. // tv_func.expanditem(arg_handl)
  199. tv_func.GetItem(handl,tvi)
  200. tvi.StatePictureIndex = 2
  201. tvi.Data = ls_s_func[ls_i]
  202. tv_func.SetItem(handl,tvi)
  203. pf_treegrowth(handl,ls_s_func[ls_i].funcid,arg_lp+1) //下级生成树
  204. NEXT
  205. RETURN rslt
  206. end function
  207. public subroutine wf_refresh_tvchild (long arg_handl, string arg_rightstr);long ll_handl
  208. long ll_funcid
  209. treeviewitem tvi
  210. ll_handl = arg_handl
  211. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  212. do while ll_handl > 0
  213. tv_func.getitem(ll_handl,tvi)
  214. ll_funcid = tvi.data
  215. // messagebox("0",ll_funcid)
  216. if not ll_funcid = 0 then
  217. if mid(arg_rightstr,ll_funcid,1)='0' then
  218. tvi.statepictureindex = 1
  219. else
  220. tvi.statepictureindex = 2
  221. end if
  222. end if
  223. tv_func.setitem(ll_handl,tvi)
  224. wf_refresh_tvnext(ll_handl,arg_rightstr)
  225. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  226. loop
  227. end subroutine
  228. public subroutine wf_refresh_tvnext (long arg_handl, string arg_rightstr);long ll_handl
  229. long ll_funcid
  230. treeviewitem tvi
  231. ll_handl = arg_handl
  232. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  233. do while ll_handl > 0
  234. tv_func.getitem(ll_handl,tvi)
  235. ll_funcid = tvi.data
  236. // messagebox("1",ll_funcid)
  237. if not ll_funcid = 0 then
  238. if mid(arg_rightstr,ll_funcid,1)='0' then
  239. tvi.statepictureindex = 1
  240. else
  241. tvi.statepictureindex = 2
  242. end if
  243. end if
  244. tv_func.setitem(ll_handl,tvi)
  245. wf_refresh_tvchild(ll_handl,arg_rightstr)
  246. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  247. loop
  248. end subroutine
  249. public subroutine wf_getright_tvchild (long arg_handl, ref string arg_rightstr);long ll_handl
  250. long ll_funcid
  251. treeviewitem tvi
  252. ll_handl = arg_handl
  253. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  254. do while ll_handl > 0
  255. tv_func.getitem(ll_handl,tvi)
  256. ll_funcid = tvi.data
  257. // messagebox("0",ll_funcid)
  258. if not ll_funcid = 0 then
  259. if tvi.statepictureindex = 2 then
  260. arg_rightstr=replace(arg_rightstr,ll_funcid,1,"1")
  261. end if
  262. end if
  263. wf_getright_tvnext(ll_handl,arg_rightstr)
  264. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  265. loop
  266. end subroutine
  267. public subroutine wf_getright_tvnext (long arg_handl, ref string arg_rightstr);long ll_handl
  268. long ll_funcid
  269. treeviewitem tvi
  270. ll_handl = arg_handl
  271. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  272. do while ll_handl > 0
  273. tv_func.getitem(ll_handl,tvi)
  274. ll_funcid = tvi.data
  275. // messagebox("1",ll_funcid)
  276. if not ll_funcid = 0 then
  277. if tvi.statepictureindex = 2 then
  278. arg_rightstr=replace(arg_rightstr,ll_funcid,1,"1")
  279. end if
  280. end if
  281. tv_func.setitem(ll_handl,tvi)
  282. wf_getright_tvchild(ll_handl,arg_rightstr)
  283. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  284. loop
  285. end subroutine
  286. public subroutine wf_set_tvparent (long arg_handl);//====================================================================
  287. // Function: wf_find_parenttree()
  288. //--------------------------------------------------------------------
  289. // Description:
  290. //--------------------------------------------------------------------
  291. // Arguments:
  292. // value long arg_handl
  293. // value long arg_state
  294. //--------------------------------------------------------------------
  295. // Returns: (none)
  296. //--------------------------------------------------------------------
  297. // Author: yyx Date: 2004.11.18
  298. //--------------------------------------------------------------------
  299. // Modify History:
  300. //
  301. //====================================================================
  302. long ll_handl
  303. treeviewitem tvi
  304. ll_handl = arg_handl
  305. tv_func.getitem(ll_handl,tvi)
  306. tvi.StatePictureIndex = 2
  307. tv_func.setitem(ll_handl,tvi)
  308. ll_handl = tv_func.finditem(ParentTreeItem!,ll_handl)
  309. do while ll_handl > 0
  310. tv_func.getitem(ll_handl,tvi)
  311. tvi.StatePictureIndex = 2
  312. tv_func.setitem(ll_handl,tvi)
  313. ll_handl = tv_func.finditem(ParentTreeItem!,ll_handl)
  314. loop
  315. end subroutine
  316. public subroutine wf_set_tvchild (long arg_handl);//====================================================================
  317. // Function: wf_find_childtree()
  318. //--------------------------------------------------------------------
  319. // Description:
  320. //--------------------------------------------------------------------
  321. // Arguments:
  322. // value long arg_handl
  323. // value long arg_state
  324. //--------------------------------------------------------------------
  325. // Returns: integer
  326. //--------------------------------------------------------------------
  327. // Author: yyx Date: 2004.11.18
  328. //--------------------------------------------------------------------
  329. // Modify History:
  330. //
  331. //====================================================================
  332. long ll_handl
  333. treeviewitem tvi
  334. ll_handl = arg_handl
  335. tv_func.getitem(ll_handl,tvi)
  336. tvi.StatePictureIndex = 1
  337. tv_func.setitem(ll_handl,tvi)
  338. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  339. do while ll_handl > 0
  340. wf_set_tvnext(ll_handl)
  341. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  342. loop
  343. end subroutine
  344. public subroutine wf_refresh ();//wf_refresh
  345. //long ll_row
  346. //long ll_storageid,ll_scid
  347. //long i,li_no,cnt
  348. //string ls_str,ls_storage_str,ls_scstr
  349. //
  350. //ll_row = dw_1.getrow()
  351. //
  352. //if ll_row > 0 then
  353. // if is_id = sys_super_id then
  354. // ls_str = fill('1',2000)
  355. // else
  356. // select rightstring into :ls_str
  357. // from u_user
  358. // where empid = :ins_empid
  359. // and scid = :sys_scid;
  360. // if sqlca.sqlcode <> 0 or isnull(ls_str) then
  361. // ls_str = ''
  362. // end if
  363. // ls_str=f_psw_zh(ls_str,1,sys_power_key) //解密
  364. // ls_storage_str = dw_1.object.storagestr[ll_row]
  365. // ls_scstr = dw_1.object.scstr[ll_row]
  366. // end if
  367. //end if
  368. ////**storage_checkbox
  369. //for i = 1 to dw_2.rowcount()
  370. // if ls_storage_str = '0' then
  371. // dw_2.object.choice[i] = 1
  372. // else
  373. // ll_storageid = dw_2.object.storageid[i]
  374. // if pos(ls_storage_str,','+string(ll_storageid)+',',1) > 0 then
  375. // dw_2.object.choice[i] = 1
  376. // else
  377. // dw_2.object.choice[i] = 0
  378. // end if
  379. // end if
  380. //next
  381. //
  382. ////**sc_checkbox
  383. //for i = 1 to dw_3.rowcount()
  384. // if ls_scstr = '0' then
  385. // dw_3.object.choice[i] = 1
  386. // else
  387. // ll_scid = dw_3.object.scid[i]
  388. // if pos(ls_scstr,','+string(ll_scid)+',',1) > 0 then
  389. // dw_3.object.choice[i] = 1
  390. // else
  391. // dw_3.object.choice[i] = 0
  392. // end if
  393. // end if
  394. //next
  395. //**tv_checkbox
  396. //if ls_str = '' then return
  397. long ll_handl
  398. ll_handl = tv_func.finditem(RootTreeItem!,0)
  399. //if ll_handl > 0 then wf_refresh_tvchild(ll_handl,ls_str)
  400. return
  401. end subroutine
  402. public subroutine wf_clear_tvchild (long arg_handl, integer arg_statepictureindex);long ll_handl
  403. treeviewitem tvi
  404. ll_handl = arg_handl
  405. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  406. do while ll_handl > 0
  407. tv_func.getitem(ll_handl,tvi)
  408. tvi.statepictureindex = arg_statepictureindex
  409. tv_func.setitem(ll_handl,tvi)
  410. wf_clear_tvnext(ll_handl,arg_statepictureindex)
  411. ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl)
  412. loop
  413. end subroutine
  414. public subroutine wf_clear_tvnext (long arg_handl, integer arg_statepictureindex);long ll_handl
  415. treeviewitem tvi
  416. ll_handl = arg_handl
  417. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  418. do while ll_handl > 0
  419. tv_func.getitem(ll_handl,tvi)
  420. tvi.statepictureindex = arg_statepictureindex
  421. tv_func.setitem(ll_handl,tvi)
  422. wf_clear_tvchild(ll_handl,arg_statepictureindex)
  423. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  424. loop
  425. end subroutine
  426. public subroutine wf_set_tvnext (long arg_handl);//====================================================================
  427. // Function: wf_find_childtree()
  428. //--------------------------------------------------------------------
  429. // Description:
  430. //--------------------------------------------------------------------
  431. // Arguments:
  432. // value long arg_handl
  433. // value long arg_state
  434. //--------------------------------------------------------------------
  435. // Returns: integer
  436. //--------------------------------------------------------------------
  437. // Author: yyx Date: 2004.11.18
  438. //--------------------------------------------------------------------
  439. // Modify History:
  440. //
  441. //====================================================================
  442. long ll_handl
  443. treeviewitem tvi
  444. ll_handl = arg_handl
  445. tv_func.getitem(ll_handl,tvi)
  446. tvi.StatePictureIndex = 1
  447. tv_func.setitem(ll_handl,tvi)
  448. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  449. do while ll_handl > 0
  450. wf_set_tvchild(ll_handl)
  451. ll_handl = tv_func.finditem(NextTreeItem!,ll_handl)
  452. loop
  453. end subroutine
  454. on w_system_setting.create
  455. this.cb_3=create cb_3
  456. this.dw_1=create dw_1
  457. this.st_database=create st_database
  458. this.st_server=create st_server
  459. this.cb_2=create cb_2
  460. this.cb_1=create cb_1
  461. this.cb_ch=create cb_ch
  462. this.cb_output_file=create cb_output_file
  463. this.cb_input_file=create cb_input_file
  464. this.st_1=create st_1
  465. this.sle_filename=create sle_filename
  466. this.tv_func=create tv_func
  467. this.cb_end=create cb_end
  468. this.cb_clear_all=create cb_clear_all
  469. this.cb_select_all=create cb_select_all
  470. this.gb_3=create gb_3
  471. this.Control[]={this.cb_3,&
  472. this.dw_1,&
  473. this.st_database,&
  474. this.st_server,&
  475. this.cb_2,&
  476. this.cb_1,&
  477. this.cb_ch,&
  478. this.cb_output_file,&
  479. this.cb_input_file,&
  480. this.st_1,&
  481. this.sle_filename,&
  482. this.tv_func,&
  483. this.cb_end,&
  484. this.cb_clear_all,&
  485. this.cb_select_all,&
  486. this.gb_3}
  487. end on
  488. on w_system_setting.destroy
  489. destroy(this.cb_3)
  490. destroy(this.dw_1)
  491. destroy(this.st_database)
  492. destroy(this.st_server)
  493. destroy(this.cb_2)
  494. destroy(this.cb_1)
  495. destroy(this.cb_ch)
  496. destroy(this.cb_output_file)
  497. destroy(this.cb_input_file)
  498. destroy(this.st_1)
  499. destroy(this.sle_filename)
  500. destroy(this.tv_func)
  501. destroy(this.cb_end)
  502. destroy(this.cb_clear_all)
  503. destroy(this.cb_select_all)
  504. destroy(this.gb_3)
  505. end on
  506. event open;//
  507. string ls_filename
  508. ls_filename = "func_"+string(today(),'yymmdd')+".Dbf"
  509. sle_filename.text = "E:\PB9_work\_Ewiserp_v31\"+ls_filename
  510. st_server.text = sqlca.ServerName
  511. st_database.text = sqlca.Database
  512. sys_ds_funcinfo.settransobject(sqlca)
  513. sys_ds_funcinfo.retrieve(-1)
  514. dw_1.settransobject(sqlca)
  515. dw_1.retrieve(-1)
  516. dw_1.setsort('parentid, sortflag')
  517. dw_1.sort()
  518. wf_build_functree()
  519. //wf_refresh()
  520. end event
  521. event key;IF Key = KeyEnter! Or Key = KeyDownArrow! THEN //
  522. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  523. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  524. RETURN 1
  525. END IF
  526. end event
  527. event resize;dw_1.width = this.width / 2
  528. tv_func.width = this.width - 20 - dw_1.width
  529. tv_func.height = this.height - tv_func.y - 140
  530. dw_1.x = tv_func.x + tv_func.width + 5
  531. dw_1.y = tv_func.y
  532. dw_1.height = tv_func.height
  533. end event
  534. type cb_3 from uo_imflatbutton within w_system_setting
  535. integer x = 1861
  536. integer y = 104
  537. integer width = 274
  538. integer height = 96
  539. integer taborder = 210
  540. string text = "权限查找"
  541. end type
  542. event clicked;call super::clicked;//
  543. Long parentid
  544. Long funcid
  545. String treename
  546. String ls_last
  547. Int flag = 1
  548. s_inputbox ins_parm
  549. ins_parm.title = "请输入神秘代码"
  550. ins_parm.msg = "请输入权限代码"
  551. openwithparm(w_inputbox_long,ins_parm)
  552. ins_parm = Message.PowerObjectParm
  553. if ins_parm.ifret = false then return
  554. funcid = ins_parm.long_a
  555. do
  556. IF funcid<>0 THEN
  557. select
  558. parentid,
  559. treename
  560. into :parentid,:treename
  561. from sys_func_pwr
  562. where funcid = :funcid;
  563. IF SQLCA.SQLCODE <>0 THEN
  564. flag = 0
  565. GOTO EXT
  566. END IF
  567. END IF
  568. IF ls_last = '' THEN
  569. ls_last = treename
  570. ELSE
  571. ls_last = treename+"~r-"+ls_last
  572. END IF
  573. funcid = parentid
  574. loop until funcid = 0
  575. EXT:
  576. IF flag = 1 then
  577. MESSAGEBOX("成功",ls_last)
  578. else
  579. MESSAGEBOX("失败","不存在该权限")
  580. end if
  581. end event
  582. type dw_1 from u_dw_rbtnfilter within w_system_setting
  583. integer x = 1349
  584. integer y = 236
  585. integer width = 1829
  586. integer taborder = 30
  587. string dataobject = "ds_sys_funcpwr_setting"
  588. boolean hscrollbar = true
  589. boolean vscrollbar = true
  590. boolean hsplitscroll = true
  591. boolean rbutton_filter_use = true
  592. boolean rbutton_setposition_use = true
  593. boolean titleclick_sort_use = true
  594. end type
  595. type st_database from statictext within w_system_setting
  596. integer x = 2715
  597. integer y = 128
  598. integer width = 626
  599. integer height = 48
  600. integer textsize = -9
  601. integer weight = 400
  602. fontcharset fontcharset = gb2312charset!
  603. fontpitch fontpitch = variable!
  604. string facename = "宋体"
  605. long textcolor = 134217856
  606. long backcolor = 67108864
  607. string text = "none"
  608. boolean focusrectangle = false
  609. end type
  610. type st_server from statictext within w_system_setting
  611. integer x = 2715
  612. integer y = 40
  613. integer width = 626
  614. integer height = 48
  615. integer textsize = -9
  616. integer weight = 400
  617. fontcharset fontcharset = gb2312charset!
  618. fontpitch fontpitch = variable!
  619. string facename = "宋体"
  620. long textcolor = 134217856
  621. long backcolor = 67108864
  622. string text = "none"
  623. boolean focusrectangle = false
  624. end type
  625. type cb_2 from uo_imflatbutton within w_system_setting
  626. integer x = 1339
  627. integer y = 104
  628. integer width = 494
  629. integer height = 96
  630. integer taborder = 200
  631. string text = "导入DW到数据库"
  632. end type
  633. event clicked;call super::clicked;IF Not sys_power_issuper THEN
  634. MessageBox('提示','你没有使用权限!',information!,ok!)
  635. RETURN
  636. END IF
  637. datastore ds_setting, ds_func
  638. String arg_filename
  639. arg_filename = Trim(sle_filename.Text)
  640. IF arg_filename = '' THEN
  641. MessageBox('提示','请输入文件名称',information!,ok!)
  642. RETURN
  643. END IF
  644. ds_setting = Create datastore
  645. ds_setting.DataObject = 'dw_system_import_setting'
  646. ds_setting.SetTransObject(sqlca)
  647. ds_func = Create datastore
  648. ds_func.DataObject = 'ds_sys_funcpwr'
  649. ds_func.RowsCopy(1, ds_func.RowCount(), Primary!, ds_setting, 1, Primary!)
  650. ds_setting.AcceptText()
  651. IF ds_setting.RowCount() <= 0 THEN
  652. MessageBox('提示','你导入的系统功能文件没有数据',information!,ok!)
  653. RETURN
  654. END IF
  655. DELETE FROM sys_func_pwr;
  656. IF sqlca.SQLCode <> 0 THEN
  657. rollback;
  658. MessageBox('错误','删除原系统功能数据失败,'+sqlca.SQLErrText,stopsign!,ok!)
  659. RETURN
  660. END IF
  661. IF ds_setting.Update() = -1 THEN
  662. ROLLBACK;
  663. MessageBox('提示','你导入的系统功能文件UPEATE错误',information!,ok!)
  664. RETURN
  665. END IF
  666. //Long ll_i
  667. //Long ll_funcid
  668. //Long ll_parentid
  669. //Long ll_mainid
  670. //Int li_functype
  671. //String ls_treename
  672. //String ls_menuname
  673. //Int li_if_use
  674. //Int li_sortflag
  675. //int li_versiontype
  676. //int li_worktype
  677. //FOR ll_i = 1 TO ds_setting.RowCount()
  678. // ll_funcid = ds_setting.Object.funcid[ll_i]
  679. // ll_parentid = ds_setting.Object.parentid[ll_i]
  680. // ll_mainid = ds_setting.Object.mainid[ll_i]
  681. // li_functype = ds_setting.Object.functype[ll_i]
  682. // ls_treename = ds_setting.Object.treename[ll_i]
  683. // ls_menuname = ds_setting.Object.MenuName[ll_i]
  684. // li_if_use = ds_setting.Object.if_use[ll_i]
  685. // li_sortflag = ds_setting.Object.sortflag[ll_i]
  686. // li_versiontype = ds_setting.Object.versiontype[ll_i]
  687. // li_worktype = ds_setting.Object.worktype[ll_i]
  688. // INSERT INTO sys_func_pwr(funcid,parentid,mainid,functype,treename,menuname,if_use,sortflag,versiontype,worktype)
  689. // Values(:ll_funcid,:ll_parentid,:ll_mainid,:li_functype,:ls_treename,:ls_menuname,:li_if_use,:li_sortflag,:li_versiontype,:li_worktype);
  690. // IF sqlca.SQLCode <> 0 THEN
  691. // MessageBox('错误','删除原系统功能数据失败,'+sqlca.SQLErrText,stopsign!,ok!)
  692. // RETURN
  693. // END IF
  694. //NEXT
  695. COMMIT;
  696. cb_1.TriggerEvent( Clicked!)
  697. MessageBox('提示','导入系统功能数据成功',information!,ok!)
  698. end event
  699. type cb_1 from uo_imflatbutton within w_system_setting
  700. integer y = 104
  701. integer width = 274
  702. integer height = 96
  703. integer taborder = 60
  704. string text = "刷新"
  705. end type
  706. event clicked;call super::clicked;sys_ds_funcinfo.settransobject(sqlca)
  707. sys_ds_funcinfo.retrieve(-1)
  708. wf_build_functree()
  709. end event
  710. type cb_ch from uo_imflatbutton within w_system_setting
  711. integer x = 2153
  712. integer width = 261
  713. integer height = 96
  714. integer taborder = 50
  715. string text = "选择"
  716. end type
  717. event clicked;call super::clicked;//new
  718. integer i
  719. string pathname,filename
  720. i=getfilesavename("选择备份文件",pathname,filename,"Dbf","数据文件Dbf,*.Dbf")
  721. IF i=1 AND TRIM(pathname)<>'' AND TRIM(FILENAME)<>"" THEN
  722. sle_filename.text=pathname
  723. END IF
  724. end event
  725. type cb_output_file from uo_imflatbutton within w_system_setting
  726. integer x = 841
  727. integer y = 104
  728. integer width = 494
  729. integer height = 96
  730. integer taborder = 50
  731. string text = "导入功能设定文件"
  732. end type
  733. event clicked;call super::clicked;IF Not sys_power_issuper THEN
  734. MessageBox('提示','你没有使用权限!',information!,ok!)
  735. RETURN
  736. END IF
  737. datastore ds_setting
  738. String arg_filename
  739. arg_filename = Trim(sle_filename.Text)
  740. IF arg_filename = '' THEN
  741. MessageBox('提示','请输入文件名称',information!,ok!)
  742. RETURN
  743. END IF
  744. ds_setting = Create datastore
  745. ds_setting.DataObject = 'dw_system_import_setting'
  746. ds_setting.SetTransObject(sqlca)
  747. ds_setting.ImportFile(arg_filename)
  748. ds_setting.AcceptText()
  749. IF ds_setting.RowCount() <= 0 THEN
  750. MessageBox('提示','你导入的系统功能文件没有数据',information!,ok!)
  751. RETURN
  752. END IF
  753. DELETE From sys_func_pwr;
  754. IF sqlca.SQLCode <> 0 THEN
  755. ROLLBACK;
  756. MessageBox('错误','删除原系统功能数据失败,'+sqlca.SQLErrText,stopsign!,ok!)
  757. RETURN
  758. END IF
  759. Long ll_i
  760. Long ll_funcid
  761. Long ll_parentid
  762. Long ll_mainid
  763. Int li_functype
  764. String ls_treename
  765. String ls_menuname
  766. Int li_if_use
  767. Int li_sortflag
  768. Int li_versiontype
  769. Int li_worktype
  770. long ll_moduleid
  771. FOR ll_i = 1 To ds_setting.RowCount()
  772. ll_funcid = ds_setting.Object.funcid[ll_i]
  773. ll_parentid = ds_setting.Object.parentid[ll_i]
  774. ll_mainid = ds_setting.Object.mainid[ll_i]
  775. li_functype = ds_setting.Object.functype[ll_i]
  776. ls_treename = ds_setting.Object.treename[ll_i]
  777. ls_menuname = ds_setting.Object.MenuName[ll_i]
  778. li_if_use = ds_setting.Object.if_use[ll_i]
  779. li_sortflag = ds_setting.Object.sortflag[ll_i]
  780. li_versiontype = ds_setting.Object.versiontype[ll_i]
  781. li_worktype = ds_setting.Object.worktype[ll_i]
  782. ll_moduleid = ds_setting.Object.moduleid[ll_i]
  783. INSERT INTO sys_func_pwr(funcid,parentid,mainid,functype,treename,menuname,if_use,sortflag,versiontype,worktype,moduleid)
  784. Values(:ll_funcid,:ll_parentid,:ll_mainid,:li_functype,:ls_treename,:ls_menuname,:li_if_use,:li_sortflag,:li_versiontype,:li_worktype,:ll_moduleid);
  785. IF sqlca.SQLCode <> 0 THEN
  786. MessageBox('错误','删除原系统功能数据失败,'+sqlca.SQLErrText,stopsign!,ok!)
  787. RETURN
  788. END IF
  789. NEXT
  790. COMMIT;
  791. cb_1.TriggerEvent( Clicked!)
  792. MessageBox('提示','导入系统功能数据成功',information!,ok!)
  793. end event
  794. type cb_input_file from uo_imflatbutton within w_system_setting
  795. integer x = 347
  796. integer y = 104
  797. integer width = 494
  798. integer height = 96
  799. integer taborder = 190
  800. string text = "导出功能设置文件"
  801. end type
  802. event clicked;call super::clicked;
  803. string arg_filename,arg_msg
  804. blob arg_blob
  805. arg_filename = trim(sle_filename.text)
  806. if arg_filename = '' then
  807. messagebox('提示','请输入文件名称',information!,ok!)
  808. return
  809. end if
  810. if messagebox("询问","是否确定要将系统权限导出成文件",question!,yesno!,1) = 2 then
  811. return
  812. end if
  813. datastore ds_setting
  814. ds_setting = create datastore
  815. ds_setting.dataobject = 'dw_system_import_setting'
  816. ds_setting.settransobject(sqlca)
  817. ds_setting.retrieve( )
  818. if fileexists(arg_filename) then
  819. if messagebox("询问","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 then
  820. return
  821. end if
  822. end if
  823. if ds_setting.saveas(arg_filename,dbase2!,false) = 1 then
  824. arg_msg = '数据导出成功!'
  825. else
  826. arg_msg = '数据导出失败,如果该文件已打开请先关闭此文件再试!'
  827. end if
  828. messagebox('提示',arg_msg,information!,ok!)
  829. end event
  830. type st_1 from statictext within w_system_setting
  831. integer y = 20
  832. integer width = 279
  833. integer height = 48
  834. integer textsize = -9
  835. integer weight = 400
  836. fontcharset fontcharset = gb2312charset!
  837. fontpitch fontpitch = variable!
  838. string facename = "宋体"
  839. long textcolor = 33554432
  840. long backcolor = 67108864
  841. string text = "文件路径:"
  842. boolean focusrectangle = false
  843. end type
  844. type sle_filename from singlelineedit within w_system_setting
  845. event key pbm_keydown
  846. integer x = 283
  847. integer width = 1847
  848. integer height = 92
  849. integer taborder = 30
  850. integer textsize = -9
  851. integer weight = 400
  852. fontcharset fontcharset = gb2312charset!
  853. fontpitch fontpitch = variable!
  854. string facename = "宋体"
  855. long textcolor = 33554432
  856. borderstyle borderstyle = stylelowered!
  857. end type
  858. type tv_func from treeview within w_system_setting
  859. event ue_tree_edit ( )
  860. event ue_tree_add_bro ( )
  861. event ue_tree_add_son ( )
  862. event ue_tree_del ( )
  863. event ue_tree_set_son ( )
  864. event ue_tree_add_reportson ( )
  865. event ue_tree_add_billfunc ( )
  866. integer y = 240
  867. integer width = 2414
  868. integer height = 1432
  869. integer taborder = 20
  870. integer textsize = -9
  871. integer weight = 400
  872. fontcharset fontcharset = gb2312charset!
  873. fontpitch fontpitch = variable!
  874. string facename = "宋体"
  875. long textcolor = 33554432
  876. borderstyle borderstyle = stylelowered!
  877. boolean linesatroot = true
  878. boolean disabledragdrop = false
  879. boolean hideselection = false
  880. boolean tooltips = false
  881. string picturename[] = {"application.ico","graphics\Shell32 005.ico","graphics\blue folder.ico","graphics\Shell32 025.ico","Custom029!"}
  882. long picturemaskcolor = 536870912
  883. long statepicturemaskcolor = 536870912
  884. end type
  885. event ue_tree_edit();IF NOT il_handle > 0 THEN RETURN
  886. s_sys_func_parm s_sfp
  887. treeviewitem tvi
  888. tv_func.GetItem(il_handle,tvi)
  889. s_sfp.sfunc = tvi.Data
  890. s_sfp.opflag = 3 // add son
  891. OpenWithParm(w_mftree_add,s_sfp)
  892. s_sfp = Message.PowerObjectParm
  893. IF s_sfp.opflag = 0 THEN RETURN // 取消
  894. Long ll_getitem
  895. treeviewitem ltvi_Item
  896. String ls_item
  897. IF il_handle > 0 THEN
  898. ll_getitem = THIS.GetItem(il_handle, ltvi_Item)
  899. IF ll_getitem > 0 THEN
  900. // ltvi_Item.label=string(s_sfp.sfunc.funcid)+'-'+s_sfp.sfunc.treename
  901. ls_item = String(s_sfp.sfunc.funcid)
  902. ls_item = Space(5 - Len(ls_item)) + ls_item+' - '+s_sfp.sfunc.treename
  903. IF s_sfp.sfunc.mainid > 0 THEN
  904. ls_item += ' ['+String(s_sfp.sfunc.mainid)+']'
  905. END IF
  906. IF s_sfp.sfunc.if_use = 0 THEN
  907. ls_item += ' *'
  908. END IF
  909. ltvi_Item.Label = ls_item
  910. ltvi_Item.Data = s_sfp.sfunc
  911. ll_getitem = THIS.SetItem(il_handle, ltvi_Item)
  912. il_handle = 0
  913. END IF
  914. END IF
  915. end event
  916. event ue_tree_add_bro();if not il_handle>0 then return
  917. s_sys_func_parm s_sfp
  918. treeviewitem tvi
  919. tv_func.getitem(il_handle,tvi)
  920. s_sfp.sfunc=tvi.data
  921. s_sfp.opflag=1 // add brother
  922. openwithparm(w_mftree_add,s_sfp)
  923. s_sfp=message.powerobjectparm
  924. if s_sfp.opflag=0 then return // 取消
  925. LONG ll_getitem,ll_newhandle,ll_pahandle
  926. TreeViewItem ltvi_Item,ltvi_PaItem
  927. string ls_item
  928. IF il_handle>0 THEN
  929. ll_getitem=this.GetItem(il_handle, ltvi_Item)
  930. IF ll_getitem>0 THEN
  931. //得到父项,
  932. ll_pahandle=FindItem(ParentTreeItem!, il_handle)
  933. IF ll_pahandle<0 THEN ll_pahandle=0
  934. // ltvi_Item.label=string(s_sfp.sfunc.funcid)+'-'+s_sfp.sfunc.treename
  935. ls_item = String(s_sfp.sfunc.funcid)
  936. ls_item = Space(5 - Len(ls_item)) + ls_item+' - '+s_sfp.sfunc.treename
  937. IF s_sfp.sfunc.mainid > 0 THEN
  938. ls_item += ' ['+String(s_sfp.sfunc.mainid)+']'
  939. END IF
  940. IF s_sfp.sfunc.if_use = 0 THEN
  941. ls_item += ' *'
  942. END IF
  943. ltvi_Item.Label = ls_item
  944. ltvi_Item.Data = s_sfp.sfunc
  945. ltvi_Item.PictureIndex = 6
  946. // ltvi_Item.SelectedPictureIndex = 5
  947. ll_newhandle=this.InsertItemlast(ll_pahandle,ltvi_Item)
  948. this.GetItem(ll_newhandle, ltvi_Item)
  949. this.ExpandItem(ll_pahandle)
  950. //this.editlabel(ll_newhandle)
  951. il_handle=0
  952. END IF
  953. END IF
  954. end event
  955. event ue_tree_add_son();if not il_handle>0 then return
  956. s_sys_func_parm s_sfp
  957. treeviewitem tvi
  958. tv_func.getitem(il_handle,tvi)
  959. s_sfp.sfunc=tvi.data
  960. s_sfp.opflag=2 // add son
  961. openwithparm(w_mftree_add,s_sfp)
  962. s_sfp=message.powerobjectparm
  963. if s_sfp.opflag=0 then return // 取消
  964. LONG ll_getitem,ll_newhandle
  965. TreeViewItem ltvi_Item
  966. string ls_item
  967. IF il_handle>0 THEN
  968. ll_getitem=this.GetItem(il_handle, ltvi_Item)
  969. IF ll_getitem>0 THEN
  970. //ltvi_Item.children=true
  971. // ltvi_Item.label=string(s_sfp.sfunc.funcid)+'-'+s_sfp.sfunc.treename
  972. ls_item = String(s_sfp.sfunc.funcid)
  973. ls_item = Space(5 - Len(ls_item)) + ls_item+' - '+s_sfp.sfunc.treename
  974. IF s_sfp.sfunc.mainid > 0 THEN
  975. ls_item += ' ['+String(s_sfp.sfunc.mainid)+']'
  976. END IF
  977. IF s_sfp.sfunc.if_use = 0 THEN
  978. ls_item += ' *'
  979. END IF
  980. ltvi_Item.Label = ls_item
  981. ltvi_Item.Data = s_sfp.sfunc
  982. ltvi_Item.PictureIndex = 6
  983. ltvi_Item.SelectedPictureIndex = 5
  984. ll_newhandle=this.InsertItemlast(il_handle,ltvi_Item)
  985. this.ExpandItem(il_handle)
  986. //this.editlabel(ll_newhandle)
  987. il_handle=0
  988. END IF
  989. END IF
  990. end event
  991. event ue_tree_del();
  992. LONG ll_getitem
  993. TreeViewItem ltvi_Item
  994. uo_sys_funcpwr uo_sfp
  995. s_sys_func s_sf_ls
  996. IF il_handle>0 THEN
  997. ll_getitem=this.GetItem(il_handle, ltvi_Item)
  998. IF ll_getitem>0 THEN
  999. IF MessageBox ("询问","是否确定要删除当前结点?("+trim(ltvi_Item.label )+")",Question!,YesNo! ) = 2 THEN RETURN
  1000. s_sf_ls=ltvi_Item.data
  1001. uo_sfp.del(s_sf_ls.funcid )
  1002. This.deleteitem(il_handle)
  1003. il_handle=0
  1004. END IF
  1005. END IF
  1006. end event
  1007. event ue_tree_set_son();treeviewitem tvi
  1008. tv_func.GetItem(il_handle,tvi)
  1009. Long ll_getitem
  1010. treeviewitem ltvi_Item
  1011. uo_sys_funcpwr uo_sfp
  1012. s_sys_func s_sf_ls
  1013. IF il_handle > 0 THEN
  1014. ll_getitem = THIS.GetItem(il_handle, ltvi_Item)
  1015. IF ll_getitem > 0 THEN
  1016. s_sf_ls = ltvi_Item.Data
  1017. OpenWithParm(w_func_set_version,s_sf_ls)
  1018. END IF
  1019. cb_1.TriggerEvent(clicked!)
  1020. END IF
  1021. end event
  1022. event ue_tree_add_reportson();IF NOT il_handle > 0 THEN RETURN
  1023. s_sys_func_parm s_sfp
  1024. treeviewitem tvi
  1025. tv_func.GetItem(il_handle,tvi)
  1026. s_sfp.sfunc = tvi.Data
  1027. s_sfp.opflag = 2 // add son
  1028. long ls_rslt = 1
  1029. uo_sys_funcpwr uo_sfp
  1030. ls_rslt=uo_sfp.save( 0,s_sfp.sfunc.funcid,0,9,"报表打印","报表打印",1,0,-1,0, 1001)
  1031. if ls_rslt<>1 then
  1032. goto ext
  1033. end if
  1034. ls_rslt=uo_sfp.save( 0,s_sfp.sfunc.funcid,0,9,"报表数据发送","报表数据发送",1,1,-1,0, 1001 )
  1035. if ls_rslt<>1 then
  1036. goto ext
  1037. end if
  1038. ext:
  1039. if ls_rslt = 0 then
  1040. rollback;
  1041. messagebox('失败',uo_sfp.ins_msg)
  1042. else
  1043. commit;
  1044. messagebox('成功',"成功")
  1045. end if
  1046. end event
  1047. event ue_tree_add_billfunc();//IF Not il_handle > 0 THEN RETURN
  1048. s_sys_func_parm s_sfp
  1049. treeviewitem tvi
  1050. tv_func.GetItem(il_handle,tvi)
  1051. s_sfp.sfunc = tvi.Data
  1052. s_sfp.opflag = 2 // add son
  1053. Open(w_mftree_billfunc)
  1054. //
  1055. String is_billfuncstr
  1056. is_billfuncstr = Message.StringParm
  1057. IF is_billfuncstr = "" THEN RETURN
  1058. Long ls_rslt = 1
  1059. Long ll_sort
  1060. uo_sys_funcpwr uo_sfp
  1061. IF Mid(is_billfuncstr , 1, 1) = "1" THEN
  1062. ll_sort++
  1063. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"新建","新建",1,ll_sort,-1,0, 1001 )
  1064. IF ls_rslt <> 1 THEN
  1065. GOTO ext
  1066. END IF
  1067. END IF
  1068. IF Mid(is_billfuncstr , 2, 1) = "1" THEN
  1069. ll_sort++
  1070. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"删除","删除",1,ll_sort,-1,0, 1001 )
  1071. IF ls_rslt <> 1 THEN
  1072. GOTO ext
  1073. END IF
  1074. END IF
  1075. IF Mid(is_billfuncstr , 3, 1) = "1" THEN
  1076. ll_sort++
  1077. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"确认","确认",1,ll_sort,-1,0, 1001 )
  1078. IF ls_rslt <> 1 THEN
  1079. GOTO ext
  1080. END IF
  1081. END IF
  1082. IF Mid(is_billfuncstr , 4, 1) = "1" THEN
  1083. ll_sort++
  1084. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"反确认","反确认",1,ll_sort,-1,0, 1001 )
  1085. IF ls_rslt <> 1 THEN
  1086. GOTO ext
  1087. END IF
  1088. END IF
  1089. IF Mid(is_billfuncstr , 5, 1) = "1" THEN
  1090. ll_sort++
  1091. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"审核","审核",1,ll_sort,-1,0, 1001 )
  1092. IF ls_rslt <> 1 THEN
  1093. GOTO ext
  1094. END IF
  1095. END IF
  1096. IF Mid(is_billfuncstr , 6, 1) = "1" THEN
  1097. ll_sort++
  1098. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"撤审","撤审",1,ll_sort,-1,0, 1001 )
  1099. IF ls_rslt <> 1 THEN
  1100. GOTO ext
  1101. END IF
  1102. END IF
  1103. IF Mid(is_billfuncstr , 7, 1) = "1" THEN
  1104. ll_sort++
  1105. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"终审","终审",1,ll_sort,-1,0, 1001 )
  1106. IF ls_rslt <> 1 THEN
  1107. GOTO ext
  1108. END IF
  1109. END IF
  1110. IF Mid(is_billfuncstr , 8, 1) = "1" THEN
  1111. ll_sort++
  1112. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"终撤","终撤",1,ll_sort,-1,0, 1001 )
  1113. IF ls_rslt <> 1 THEN
  1114. GOTO ext
  1115. END IF
  1116. END IF
  1117. IF Mid(is_billfuncstr , 9, 1) = "1" THEN
  1118. ll_sort++
  1119. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"添加备注","添加备注",1,ll_sort,-1,0, 1001 )
  1120. IF ls_rslt <> 1 THEN
  1121. GOTO ext
  1122. END IF
  1123. END IF
  1124. IF Mid(is_billfuncstr , 10, 1) = "1" THEN
  1125. ll_sort++
  1126. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,"打印","打印",1,ll_sort,-1,0, 1001 )
  1127. IF ls_rslt <> 1 THEN
  1128. GOTO ext
  1129. END IF
  1130. END IF
  1131. Long ll_pos
  1132. String ls_billfunc
  1133. IF Len(is_billfuncstr) > 10 THEN
  1134. is_billfuncstr = Mid(is_billfuncstr, 11)
  1135. ll_pos = Pos(is_billfuncstr, '~n')
  1136. DO WHILE ll_pos > 0
  1137. ls_billfunc = Left(is_billfuncstr, ll_pos - 1)
  1138. is_billfuncstr = Mid(is_billfuncstr, ll_pos + Len( '~n'))
  1139. ll_sort++
  1140. ls_rslt = uo_sfp.Save( 0,s_sfp.sfunc.funcid,0,9,Trim(ls_billfunc),Trim(ls_billfunc),1,ll_sort,-1,0, 1001 )
  1141. IF ls_rslt <> 1 THEN
  1142. GOTO ext
  1143. END IF
  1144. ll_pos = Pos(is_billfuncstr, '~n')
  1145. LOOP
  1146. END IF
  1147. ext:
  1148. //ROLLBACK;
  1149. IF ls_rslt = 0 THEN
  1150. ROLLBACK;
  1151. MessageBox('失败',uo_sfp.ins_msg)
  1152. ELSE
  1153. COMMIT;
  1154. MessageBox('成功',"成功")
  1155. END IF
  1156. end event
  1157. event clicked;Int ls_state
  1158. treeviewitem tvi
  1159. s_sys_func_parm s_sfp
  1160. Long ll_parentid
  1161. IF tv_func.GetItem(Handle,tvi) <> 1 THEN RETURN
  1162. ls_state = tvi.StatePictureIndex
  1163. IF IsNull(tvi.Data) THEN
  1164. ll_parentid = 0
  1165. ELSE
  1166. s_sfp.sfunc = tvi.Data
  1167. ll_parentid = s_sfp.sfunc.funcid
  1168. END IF
  1169. IF Handle > 0 THEN
  1170. IF ls_state = 2 THEN //孩子全部取消
  1171. wf_set_tvchild(Handle)
  1172. ELSEIF ls_state = 1 THEN //父亲选定
  1173. wf_set_tvparent(Handle)
  1174. END IF
  1175. dw_1.SetFilter('parentid = '+String(ll_parentid))
  1176. dw_1.Filter()
  1177. END IF
  1178. end event
  1179. event rightclicked;IF Handle <= 0 THEN RETURN
  1180. il_handle = Handle
  1181. m_popup om_1
  1182. om_1 = CREATE m_popup
  1183. //把菜单的anyobject指向被右击的对象(dw_1)
  1184. om_1.anyobject = THIS
  1185. //om_1.setmenuitem("添加子项|添加兄弟|编辑|-|删除")
  1186. //可在此调用om_1.setitemdisable(itemorder)函数disable某菜单项。
  1187. om_1.popupmenu(THIS.X+THIS.PointerX(),THIS.Y+THIS.PointerY())
  1188. DESTROY om_1
  1189. end event
  1190. type cb_end from uo_imflatbutton within w_system_setting
  1191. integer x = 2427
  1192. integer width = 261
  1193. integer height = 96
  1194. integer taborder = 170
  1195. boolean bringtotop = true
  1196. string text = "退出"
  1197. string normalpicname = "graphics\btngraphics\exit.bmp"
  1198. end type
  1199. event clicked;call super::clicked;close(parent)
  1200. end event
  1201. type cb_clear_all from uo_imflatbutton within w_system_setting
  1202. integer x = 2418
  1203. integer y = 100
  1204. integer width = 274
  1205. integer height = 96
  1206. integer taborder = 180
  1207. boolean enabled = false
  1208. string text = "合部清除"
  1209. end type
  1210. event clicked;call super::clicked;long ll_handl
  1211. ll_handl = tv_func.finditem(RootTreeItem!,0)
  1212. if ll_handl > 0 then wf_clear_tvchild(ll_handl,1)
  1213. end event
  1214. type cb_select_all from uo_imflatbutton within w_system_setting
  1215. integer x = 2149
  1216. integer y = 100
  1217. integer width = 274
  1218. integer height = 96
  1219. integer taborder = 180
  1220. boolean enabled = false
  1221. string text = "全部选择"
  1222. end type
  1223. event clicked;call super::clicked;long ll_handl
  1224. ll_handl = tv_func.finditem(RootTreeItem!,0)
  1225. if ll_handl > 0 then wf_clear_tvchild(ll_handl,2)
  1226. end event
  1227. type gb_3 from groupbox within w_system_setting
  1228. integer y = 192
  1229. integer width = 3109
  1230. integer height = 36
  1231. integer textsize = -9
  1232. integer weight = 400
  1233. fontcharset fontcharset = gb2312charset!
  1234. fontpitch fontpitch = variable!
  1235. string facename = "宋体"
  1236. long textcolor = 33554432
  1237. long backcolor = 67108864
  1238. end type