w_certi_static.srw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. $PBExportHeader$w_certi_static.srw
  2. forward
  3. global type w_certi_static from w_publ_base
  4. end type
  5. type dw_tbinfor from u_dw_rbtnfilter within w_certi_static
  6. end type
  7. type dw_uc from datawindow within w_certi_static
  8. end type
  9. type cb_add from uo_imflatbutton within w_certi_static
  10. end type
  11. type cb_edit from uo_imflatbutton within w_certi_static
  12. end type
  13. type cb_delet from uo_imflatbutton within w_certi_static
  14. end type
  15. type gb_1 from groupbox within w_certi_static
  16. end type
  17. type gb_2 from groupbox within w_certi_static
  18. end type
  19. type cb_retrieve from uo_imflatbutton within w_certi_static
  20. end type
  21. type cb_print from uo_imflatbutton within w_certi_static
  22. end type
  23. type cb_help from uo_imflatbutton within w_certi_static
  24. end type
  25. type r_bar from rectangle within w_certi_static
  26. end type
  27. type ln_bar from line within w_certi_static
  28. end type
  29. type ln_bar2 from line within w_certi_static
  30. end type
  31. end forward
  32. global type w_certi_static from w_publ_base
  33. integer width = 2670
  34. integer height = 2052
  35. string title = "人事静态信息"
  36. dw_tbinfor dw_tbinfor
  37. dw_uc dw_uc
  38. cb_add cb_add
  39. cb_edit cb_edit
  40. cb_delet cb_delet
  41. gb_1 gb_1
  42. gb_2 gb_2
  43. cb_retrieve cb_retrieve
  44. cb_print cb_print
  45. cb_help cb_help
  46. r_bar r_bar
  47. ln_bar ln_bar
  48. ln_bar2 ln_bar2
  49. end type
  50. global w_certi_static w_certi_static
  51. type variables
  52. BOOLEAN LS_UPDATE_FLAG=TRUE
  53. LONG MODIFYROW_NO=0,CRL_ROW //当前行记录
  54. s_edit_tran PARA_OBJ //环境信息用于查询
  55. string keyword_STRING //关键字 未用
  56. DATE FIRST_DATE //查询开始日
  57. DATE END_DATE //查询结束日,比表达日后一天
  58. INT CHILD_COLUMN_INT //明细DW锁定列数
  59. string ins_sqlerrtext
  60. boolean if_retrieveing=false
  61. long point_currow
  62. end variables
  63. forward prototypes
  64. public function integer wf_face_change ()
  65. end prototypes
  66. public function integer wf_face_change ();IF dw_edit_mode THEN
  67. cb_retrieve.Enabled = FALSE
  68. cb_delet.Enabled = FALSE
  69. cb_print.Enabled = FALSE
  70. cb_edit.Text = "放弃&E"
  71. cb_add.Text = "保存&S"
  72. cb_edit.normalpicname = 'Undo.bmp'
  73. cb_add.normalpicname = 'Save.bmp'
  74. ELSE
  75. cb_retrieve.Enabled = TRUE
  76. cb_delet.Enabled = TRUE
  77. cb_print.Enabled = TRUE
  78. cb_edit.Text = "修改&E"
  79. cb_add.Text = "新建&S"
  80. cb_edit.normalpicname = 'OPEN.bmp'
  81. cb_add.normalpicname = 'new.bmp'
  82. END IF
  83. cb_edit.of_init_draw()
  84. cb_add.of_init_draw()
  85. cb_edit.of_paint()
  86. cb_add.of_paint()
  87. cb_add.triggerevent('ue_textchange')
  88. cb_edit.triggerevent('ue_textchange')
  89. RETURN 1
  90. end function
  91. on w_certi_static.create
  92. int iCurrent
  93. call super::create
  94. this.dw_tbinfor=create dw_tbinfor
  95. this.dw_uc=create dw_uc
  96. this.cb_add=create cb_add
  97. this.cb_edit=create cb_edit
  98. this.cb_delet=create cb_delet
  99. this.gb_1=create gb_1
  100. this.gb_2=create gb_2
  101. this.cb_retrieve=create cb_retrieve
  102. this.cb_print=create cb_print
  103. this.cb_help=create cb_help
  104. this.r_bar=create r_bar
  105. this.ln_bar=create ln_bar
  106. this.ln_bar2=create ln_bar2
  107. iCurrent=UpperBound(this.Control)
  108. this.Control[iCurrent+1]=this.dw_tbinfor
  109. this.Control[iCurrent+2]=this.dw_uc
  110. this.Control[iCurrent+3]=this.cb_add
  111. this.Control[iCurrent+4]=this.cb_edit
  112. this.Control[iCurrent+5]=this.cb_delet
  113. this.Control[iCurrent+6]=this.gb_1
  114. this.Control[iCurrent+7]=this.gb_2
  115. this.Control[iCurrent+8]=this.cb_retrieve
  116. this.Control[iCurrent+9]=this.cb_print
  117. this.Control[iCurrent+10]=this.cb_help
  118. this.Control[iCurrent+11]=this.r_bar
  119. this.Control[iCurrent+12]=this.ln_bar
  120. this.Control[iCurrent+13]=this.ln_bar2
  121. end on
  122. on w_certi_static.destroy
  123. call super::destroy
  124. destroy(this.dw_tbinfor)
  125. destroy(this.dw_uc)
  126. destroy(this.cb_add)
  127. destroy(this.cb_edit)
  128. destroy(this.cb_delet)
  129. destroy(this.gb_1)
  130. destroy(this.gb_2)
  131. destroy(this.cb_retrieve)
  132. destroy(this.cb_print)
  133. destroy(this.cb_help)
  134. destroy(this.r_bar)
  135. destroy(this.ln_bar)
  136. destroy(this.ln_bar2)
  137. end on
  138. event open;call super::open;long i
  139. dw_edit_mode=false
  140. dw_uc.settransobject(sqlca)
  141. dw_tbinfor.settransobject(sqlca)
  142. dw_tbinfor.retrieve()
  143. dw_uc.object.static_id.protect=1
  144. dw_uc.object.static_script.protect=1
  145. end event
  146. event resize;call super::resize;ln_bar.endx = this.width
  147. ln_bar2.endx = this.width
  148. r_bar.width = this.width
  149. end event
  150. event key;call super::key;IF KeyDown(KeyF1!) THEN
  151. cb_help.TriggerEvent(clicked!)
  152. end if
  153. end event
  154. type cb_func from w_publ_base`cb_func within w_certi_static
  155. boolean visible = false
  156. integer x = 1486
  157. integer width = 279
  158. boolean enabled = false
  159. end type
  160. type cb_exit from w_publ_base`cb_exit within w_certi_static
  161. integer x = 987
  162. integer width = 151
  163. integer height = 172
  164. integer picsize = 16
  165. toolbaralignment pic_align = alignattop!
  166. boolean border = false
  167. end type
  168. type dw_tbinfor from u_dw_rbtnfilter within w_certi_static
  169. integer x = 18
  170. integer y = 256
  171. integer width = 1275
  172. integer height = 1652
  173. integer taborder = 20
  174. boolean bringtotop = true
  175. string dataobject = "dw_tbinfor"
  176. boolean hscrollbar = true
  177. boolean vscrollbar = true
  178. end type
  179. event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
  180. RBUTTON_FILTER_USE=true //右键查询功能开关
  181. end event
  182. event rowfocuschanged;call super::rowfocuschanged;if this.getrow()<=0 then
  183. dw_uc.reset()
  184. return
  185. end if
  186. point_currow=this.getrow()
  187. dw_uc.retrieve(this.object.gx_id[this.getrow()])
  188. if this.getrow()>0 and this.getrow()<=this.rowcount() then
  189. dw_tbinfor.selectrow(0,false)
  190. dw_tbinfor.selectrow(this.getrow(),true)
  191. END IF
  192. end event
  193. event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1
  194. end event
  195. type dw_uc from datawindow within w_certi_static
  196. integer x = 1385
  197. integer y = 256
  198. integer width = 1189
  199. integer height = 1652
  200. integer taborder = 30
  201. boolean bringtotop = true
  202. string title = "none"
  203. string dataobject = "dw_static_script"
  204. boolean hscrollbar = true
  205. boolean vscrollbar = true
  206. boolean livescroll = true
  207. borderstyle borderstyle = stylelowered!
  208. end type
  209. event clicked;IF row > 0 then
  210. THIS.selectrow(0,false)
  211. THIS.selectrow(row,true)
  212. THIS.setrow(row)
  213. end if
  214. end event
  215. type cb_add from uo_imflatbutton within w_certi_static
  216. string tag = "新建Alt+S"
  217. integer width = 192
  218. integer height = 172
  219. integer taborder = 20
  220. boolean bringtotop = true
  221. string text = "新建&S"
  222. string normalpicname = "new.bmp"
  223. integer picsize = 16
  224. toolbaralignment pic_align = alignattop!
  225. boolean border = false
  226. end type
  227. event clicked;call super::clicked;if not f_power_ind(193) then
  228. messagebox('提示','你没有使用权限!',information!,OK!)
  229. return
  230. end if
  231. if dw_tbinfor.rowcount()=0 then
  232. messagebox("提示","没有可添加",information!,OK!)
  233. return
  234. end if
  235. IF dw_edit_mode THEN
  236. string ls_errmsg
  237. int li_currentrow
  238. li_currentrow=dw_uc.getrow()
  239. dw_uc.setrow(li_currentrow)
  240. if isnull(dw_uc.object.static_id[li_currentrow]) or isnull(dw_uc.object.static_script[li_currentrow]) then
  241. messagebox("提示","请输入具体信息",information!,OK!)
  242. return
  243. end if
  244. dw_uc.object.static_id[li_currentrow]=trim(dw_uc.object.static_id[li_currentrow])
  245. dw_uc.object.static_script[li_currentrow]=trim(dw_uc.object.static_script[li_currentrow])
  246. if dw_UC.Update() = -1 then
  247. if pos(ins_sqlerrtext,"Cannot insert duplicate key row")>0 then
  248. ls_errmsg="关键内容重复"
  249. else
  250. ls_errmsg="因为网络,代号重复或其他原因"
  251. end if
  252. rollback;
  253. MessageBox ("错误",ls_errmsg+",保存操作失败!",stopsign!,OK!)
  254. LS_UPDATE_FLAG=FALSE
  255. RETURN
  256. else
  257. commit;
  258. LS_UPDATE_FLAG=TRUE
  259. end if
  260. dw_uc.object.static_id.protect=1
  261. dw_uc.object.static_script.protect=1
  262. ins_sqlerrtext=""
  263. cb_delet.enabled=false
  264. ELSE
  265. long LL_gx_id // 保存联系ID
  266. long LL_Ser_id // 保存选项序列
  267. int li_row, li_cur_row
  268. LL_gx_id=dw_tbinfor.GetRow()
  269. LL_gx_id=dw_tbinfor.object.gx_id[LL_gx_id]
  270. LL_ser_id=dw_uc.RowCount()+1
  271. li_cur_row = dw_UC.GetRow()
  272. li_row = dw_UC.InsertRow (0)
  273. dw_uc.object.gx_id[LL_ser_id]=LL_gx_id
  274. dw_uc.object.static_id.protect=0
  275. dw_uc.object.static_script.protect=0
  276. dw_UC.ScrollToRow (li_row)
  277. dw_UC.SetFocus()
  278. modifyrow_no= li_row
  279. Ls_UpDate_Flag=false
  280. END IF
  281. dw_edit_mode= NOT dw_edit_mode
  282. WF_FACE_CHANGE()
  283. //dw_uc.SetRedraw (true)
  284. end event
  285. type cb_edit from uo_imflatbutton within w_certi_static
  286. string tag = "修改Alt+E"
  287. integer x = 192
  288. integer width = 192
  289. integer height = 172
  290. integer taborder = 30
  291. boolean bringtotop = true
  292. string text = "修改&E"
  293. string normalpicname = "open.bmp"
  294. integer picsize = 16
  295. toolbaralignment pic_align = alignattop!
  296. boolean border = false
  297. end type
  298. event clicked;call super::clicked;if not f_power_ind(193) then
  299. messagebox('提示','你没有使用权限!',information!,OK!)
  300. return
  301. end if
  302. IF dw_edit_mode THEN
  303. if dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=NewModified! or dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=New! then
  304. dw_UC.deleterow(dw_UC.getrow())
  305. else
  306. dw_UC.ReselectRow(dw_UC.getrow())
  307. end if
  308. modifyrow_no = 0
  309. dw_uc.object.static_id.protect=1
  310. dw_uc.object.static_script.protect=1
  311. Ls_update_flag=true
  312. ELSE
  313. dw_UC.SetFocus()
  314. modifyrow_no = dw_UC.getrow()
  315. dw_uc.object.static_id.protect=0
  316. dw_uc.object.static_script.protect=0
  317. END IF
  318. cb_delet.enabled=NOT dw_edit_mode
  319. dw_edit_mode= NOT dw_edit_mode
  320. WF_FACE_CHANGE()
  321. end event
  322. type cb_delet from uo_imflatbutton within w_certi_static
  323. integer x = 384
  324. integer width = 151
  325. integer height = 172
  326. integer taborder = 40
  327. boolean bringtotop = true
  328. string text = "删除"
  329. string normalpicname = "delete.bmp"
  330. integer picsize = 16
  331. toolbaralignment pic_align = alignattop!
  332. boolean border = false
  333. end type
  334. event clicked;call super::clicked;if not f_power_ind(193) then
  335. messagebox('提示','你没有使用权限!',information!,OK!)
  336. return
  337. end if
  338. IF dw_uc.RowCount() = 0 THEN
  339. MessageBox("提示","当前没有可删除的纪录",information!,OK!)
  340. RETURN
  341. END IF
  342. IF MessageBox ("询问","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  343. RETURN
  344. END IF
  345. dw_uc.SetRedraw (FALSE)
  346. dw_uc.DeleteRow (0)
  347. dw_uc.TriggerEvent (RowFocusChanged!)
  348. IF dw_uc.UPDATE() = -1 THEN
  349. ROLLBACK;
  350. MessageBox ("错误","删除记录操作失败!",stopsign!,OK!)
  351. ELSE
  352. COMMIT;
  353. END IF
  354. dw_uc.SetRedraw (TRUE)
  355. end event
  356. type gb_1 from groupbox within w_certi_static
  357. integer y = 196
  358. integer width = 1321
  359. integer height = 1736
  360. integer taborder = 10
  361. integer textsize = -9
  362. integer weight = 400
  363. fontcharset fontcharset = gb2312charset!
  364. fontpitch fontpitch = variable!
  365. string facename = "宋体"
  366. long textcolor = 16711680
  367. long backcolor = 134217739
  368. string text = "静态字段"
  369. end type
  370. type gb_2 from groupbox within w_certi_static
  371. integer x = 1353
  372. integer y = 196
  373. integer width = 1271
  374. integer height = 1736
  375. integer taborder = 30
  376. integer textsize = -9
  377. integer weight = 400
  378. fontcharset fontcharset = gb2312charset!
  379. fontpitch fontpitch = variable!
  380. string facename = "宋体"
  381. long textcolor = 16711680
  382. long backcolor = 134217739
  383. string text = "具体信息"
  384. end type
  385. type cb_retrieve from uo_imflatbutton within w_certi_static
  386. integer x = 535
  387. integer width = 151
  388. integer height = 172
  389. integer taborder = 30
  390. boolean bringtotop = true
  391. string text = "重查"
  392. string normalpicname = "refresh.bmp"
  393. integer picsize = 16
  394. toolbaralignment pic_align = alignattop!
  395. boolean border = false
  396. end type
  397. event clicked;call super::clicked;if dw_uc.rowcount()>0 then
  398. dw_uc.SetRedraw (false)
  399. int li_cur_row
  400. li_cur_row= dw_UC.GetRow()
  401. dw_uc.retrieve(dw_uc.object.gx_id[dw_uc.rowcount()])
  402. if li_cur_row<>0 and li_cur_row<=dw_uc.rowcount() then dw_UC.ScrollToRow (li_cur_row)
  403. dw_uc.SetRedraw (true)
  404. end if
  405. end event
  406. type cb_print from uo_imflatbutton within w_certi_static
  407. integer x = 837
  408. integer width = 151
  409. integer height = 172
  410. integer taborder = 40
  411. boolean bringtotop = true
  412. string text = "预览"
  413. string normalpicname = "print.bmp"
  414. integer picsize = 16
  415. toolbaralignment pic_align = alignattop!
  416. boolean border = false
  417. end type
  418. event clicked;call super::clicked;S_print_MSG LS_PRMSG
  419. LS_PRMSG.obj_dwNAME='dw_statictb_print'
  420. LS_PRMSG.TAG_TEXT=''
  421. LS_PRMSG.SETUP_FLAG=0
  422. LS_PRMSG.PAGECH_FLAG=1
  423. LS_PRMSG.retr_pram_falg=5
  424. Openwithparm(w_publ_preview,LS_PRMSG)
  425. end event
  426. type cb_help from uo_imflatbutton within w_certi_static
  427. string tag = "帮助[F1]"
  428. integer x = 686
  429. integer width = 151
  430. integer height = 172
  431. integer taborder = 30
  432. boolean bringtotop = true
  433. string text = "帮助"
  434. string normalpicname = "help.bmp"
  435. integer picsize = 16
  436. toolbaralignment pic_align = alignattop!
  437. boolean border = false
  438. end type
  439. type r_bar from rectangle within w_certi_static
  440. long linecolor = 16777215
  441. long fillcolor = 1073741824
  442. integer x = 1929
  443. integer width = 73
  444. integer height = 172
  445. end type
  446. event constructor;this.fillcolor = 14215660
  447. this.linecolor = 14215660
  448. this.x = -1
  449. this.y = -1
  450. this.height = ln_bar2.beginy - 5
  451. end event
  452. type ln_bar from line within w_certi_static
  453. long linecolor = 268435456
  454. integer linethickness = 4
  455. integer beginy = 176
  456. integer endx = 2098
  457. integer endy = 176
  458. end type
  459. type ln_bar2 from line within w_certi_static
  460. long linecolor = 16777215
  461. integer linethickness = 4
  462. integer beginy = 180
  463. integer endx = 2098
  464. integer endy = 180
  465. end type