w_certi_static.srw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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. type cb_add from uo_imflatbutton within w_certi_static
  210. string tag = "新建Alt+S"
  211. integer width = 192
  212. integer height = 172
  213. integer taborder = 20
  214. boolean bringtotop = true
  215. string text = "新建&S"
  216. string normalpicname = "new.bmp"
  217. integer picsize = 16
  218. toolbaralignment pic_align = alignattop!
  219. boolean border = false
  220. end type
  221. event clicked;call super::clicked;if not f_power_ind(193) then
  222. messagebox('提示','你没有使用权限!',information!,OK!)
  223. return
  224. end if
  225. if dw_tbinfor.rowcount()=0 then
  226. messagebox("提示","没有可添加",information!,OK!)
  227. return
  228. end if
  229. IF dw_edit_mode THEN
  230. string ls_errmsg
  231. int li_currentrow
  232. li_currentrow=dw_uc.getrow()
  233. dw_uc.setrow(li_currentrow)
  234. if isnull(dw_uc.object.static_id[li_currentrow]) or isnull(dw_uc.object.static_script[li_currentrow]) then
  235. messagebox("提示","请输入具体信息",information!,OK!)
  236. return
  237. end if
  238. dw_uc.object.static_id[li_currentrow]=trim(dw_uc.object.static_id[li_currentrow])
  239. dw_uc.object.static_script[li_currentrow]=trim(dw_uc.object.static_script[li_currentrow])
  240. if dw_UC.Update() = -1 then
  241. if pos(ins_sqlerrtext,"Cannot insert duplicate key row")>0 then
  242. ls_errmsg="关键内容重复"
  243. else
  244. ls_errmsg="因为网络,代号重复或其他原因"
  245. end if
  246. rollback;
  247. MessageBox ("错误",ls_errmsg+",保存操作失败!",stopsign!,OK!)
  248. LS_UPDATE_FLAG=FALSE
  249. RETURN
  250. else
  251. commit;
  252. LS_UPDATE_FLAG=TRUE
  253. end if
  254. dw_uc.object.static_id.protect=1
  255. dw_uc.object.static_script.protect=1
  256. ins_sqlerrtext=""
  257. cb_delet.enabled=false
  258. ELSE
  259. long LL_gx_id // 保存联系ID
  260. long LL_Ser_id // 保存选项序列
  261. int li_row, li_cur_row
  262. LL_gx_id=dw_tbinfor.GetRow()
  263. LL_gx_id=dw_tbinfor.object.gx_id[LL_gx_id]
  264. LL_ser_id=dw_uc.RowCount()+1
  265. li_cur_row = dw_UC.GetRow()
  266. li_row = dw_UC.InsertRow (0)
  267. dw_uc.object.gx_id[LL_ser_id]=LL_gx_id
  268. dw_uc.object.static_id.protect=0
  269. dw_uc.object.static_script.protect=0
  270. dw_UC.ScrollToRow (li_row)
  271. dw_UC.SetFocus()
  272. modifyrow_no= li_row
  273. Ls_UpDate_Flag=false
  274. END IF
  275. dw_edit_mode= NOT dw_edit_mode
  276. WF_FACE_CHANGE()
  277. //dw_uc.SetRedraw (true)
  278. end event
  279. type cb_edit from uo_imflatbutton within w_certi_static
  280. string tag = "修改Alt+E"
  281. integer x = 192
  282. integer width = 192
  283. integer height = 172
  284. integer taborder = 30
  285. boolean bringtotop = true
  286. string text = "修改&E"
  287. string normalpicname = "open.bmp"
  288. integer picsize = 16
  289. toolbaralignment pic_align = alignattop!
  290. boolean border = false
  291. end type
  292. event clicked;call super::clicked;if not f_power_ind(193) then
  293. messagebox('提示','你没有使用权限!',information!,OK!)
  294. return
  295. end if
  296. IF dw_edit_mode THEN
  297. if dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=NewModified! or dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=New! then
  298. dw_UC.deleterow(dw_UC.getrow())
  299. else
  300. dw_UC.ReselectRow(dw_UC.getrow())
  301. end if
  302. modifyrow_no = 0
  303. dw_uc.object.static_id.protect=1
  304. dw_uc.object.static_script.protect=1
  305. Ls_update_flag=true
  306. ELSE
  307. dw_UC.SetFocus()
  308. modifyrow_no = dw_UC.getrow()
  309. dw_uc.object.static_id.protect=0
  310. dw_uc.object.static_script.protect=0
  311. END IF
  312. cb_delet.enabled=NOT dw_edit_mode
  313. dw_edit_mode= NOT dw_edit_mode
  314. WF_FACE_CHANGE()
  315. end event
  316. type cb_delet from uo_imflatbutton within w_certi_static
  317. integer x = 384
  318. integer width = 151
  319. integer height = 172
  320. integer taborder = 40
  321. boolean bringtotop = true
  322. string text = "删除"
  323. string normalpicname = "delete.bmp"
  324. integer picsize = 16
  325. toolbaralignment pic_align = alignattop!
  326. boolean border = false
  327. end type
  328. event clicked;call super::clicked;if not f_power_ind(193) then
  329. messagebox('提示','你没有使用权限!',information!,OK!)
  330. return
  331. end if
  332. IF dw_uc.RowCount() = 0 THEN
  333. MessageBox("提示","当前没有可删除的纪录",information!,OK!)
  334. RETURN
  335. END IF
  336. IF MessageBox ("询问","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  337. RETURN
  338. END IF
  339. dw_uc.SetRedraw (FALSE)
  340. dw_uc.DeleteRow (0)
  341. dw_uc.TriggerEvent (RowFocusChanged!)
  342. IF dw_uc.UPDATE() = -1 THEN
  343. ROLLBACK;
  344. MessageBox ("错误","删除记录操作失败!",stopsign!,OK!)
  345. ELSE
  346. COMMIT;
  347. END IF
  348. dw_uc.SetRedraw (TRUE)
  349. end event
  350. type gb_1 from groupbox within w_certi_static
  351. integer y = 196
  352. integer width = 1321
  353. integer height = 1736
  354. integer taborder = 10
  355. integer textsize = -9
  356. integer weight = 400
  357. fontcharset fontcharset = gb2312charset!
  358. fontpitch fontpitch = variable!
  359. string facename = "宋体"
  360. long textcolor = 16711680
  361. long backcolor = 134217739
  362. string text = "静态字段"
  363. end type
  364. type gb_2 from groupbox within w_certi_static
  365. integer x = 1353
  366. integer y = 196
  367. integer width = 1271
  368. integer height = 1736
  369. integer taborder = 30
  370. integer textsize = -9
  371. integer weight = 400
  372. fontcharset fontcharset = gb2312charset!
  373. fontpitch fontpitch = variable!
  374. string facename = "宋体"
  375. long textcolor = 16711680
  376. long backcolor = 134217739
  377. string text = "具体信息"
  378. end type
  379. type cb_retrieve from uo_imflatbutton within w_certi_static
  380. integer x = 535
  381. integer width = 151
  382. integer height = 172
  383. integer taborder = 30
  384. boolean bringtotop = true
  385. string text = "重查"
  386. string normalpicname = "refresh.bmp"
  387. integer picsize = 16
  388. toolbaralignment pic_align = alignattop!
  389. boolean border = false
  390. end type
  391. event clicked;call super::clicked;if dw_uc.rowcount()>0 then
  392. dw_uc.SetRedraw (false)
  393. int li_cur_row
  394. li_cur_row= dw_UC.GetRow()
  395. dw_uc.retrieve(dw_uc.object.gx_id[dw_uc.rowcount()])
  396. if li_cur_row<>0 and li_cur_row<=dw_uc.rowcount() then dw_UC.ScrollToRow (li_cur_row)
  397. dw_uc.SetRedraw (true)
  398. end if
  399. end event
  400. type cb_print from uo_imflatbutton within w_certi_static
  401. integer x = 837
  402. integer width = 151
  403. integer height = 172
  404. integer taborder = 40
  405. boolean bringtotop = true
  406. string text = "预览"
  407. string normalpicname = "print.bmp"
  408. integer picsize = 16
  409. toolbaralignment pic_align = alignattop!
  410. boolean border = false
  411. end type
  412. event clicked;call super::clicked;S_print_MSG LS_PRMSG
  413. LS_PRMSG.obj_dwNAME='dw_statictb_print'
  414. LS_PRMSG.TAG_TEXT=''
  415. LS_PRMSG.SETUP_FLAG=0
  416. LS_PRMSG.PAGECH_FLAG=1
  417. LS_PRMSG.retr_pram_falg=5
  418. Openwithparm(w_publ_preview,LS_PRMSG)
  419. end event
  420. type cb_help from uo_imflatbutton within w_certi_static
  421. string tag = "帮助[F1]"
  422. integer x = 686
  423. integer width = 151
  424. integer height = 172
  425. integer taborder = 30
  426. boolean bringtotop = true
  427. string text = "帮助"
  428. string normalpicname = "help.bmp"
  429. integer picsize = 16
  430. toolbaralignment pic_align = alignattop!
  431. boolean border = false
  432. end type
  433. type r_bar from rectangle within w_certi_static
  434. long linecolor = 16777215
  435. long fillcolor = 1073741824
  436. integer x = 1929
  437. integer width = 73
  438. integer height = 172
  439. end type
  440. event constructor;this.fillcolor = 14215660
  441. this.linecolor = 14215660
  442. this.x = -1
  443. this.y = -1
  444. this.height = ln_bar2.beginy - 5
  445. end event
  446. type ln_bar from line within w_certi_static
  447. long linecolor = 268435456
  448. integer linethickness = 4
  449. integer beginy = 176
  450. integer endx = 2098
  451. integer endy = 176
  452. end type
  453. type ln_bar2 from line within w_certi_static
  454. long linecolor = 16777215
  455. integer linethickness = 4
  456. integer beginy = 180
  457. integer endx = 2098
  458. integer endy = 180
  459. end type