w_timerjob_setting.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. $PBExportHeader$w_timerjob_setting.srw
  2. forward
  3. global type w_timerjob_setting from w_publ_base
  4. end type
  5. type cb_1 from uo_imflatbutton within w_timerjob_setting
  6. end type
  7. type cb_add from uo_imflatbutton within w_timerjob_setting
  8. end type
  9. type cb_edit from uo_imflatbutton within w_timerjob_setting
  10. end type
  11. type cb_del from uo_imflatbutton within w_timerjob_setting
  12. end type
  13. type dw_1 from u_dw_rbtnfilter within w_timerjob_setting
  14. end type
  15. type dw_2 from u_dw_rbtnfilter within w_timerjob_setting
  16. end type
  17. type ddlb_timertype from dropdownlistbox within w_timerjob_setting
  18. end type
  19. type r_bar from rectangle within w_timerjob_setting
  20. end type
  21. type ln_bar from line within w_timerjob_setting
  22. end type
  23. type ln_bar2 from line within w_timerjob_setting
  24. end type
  25. end forward
  26. global type w_timerjob_setting from w_publ_base
  27. integer width = 3877
  28. integer height = 2128
  29. string title = "定时任务设置"
  30. boolean maxbox = true
  31. boolean resizable = true
  32. windowstate windowstate = maximized!
  33. cb_1 cb_1
  34. cb_add cb_add
  35. cb_edit cb_edit
  36. cb_del cb_del
  37. dw_1 dw_1
  38. dw_2 dw_2
  39. ddlb_timertype ddlb_timertype
  40. r_bar r_bar
  41. ln_bar ln_bar
  42. ln_bar2 ln_bar2
  43. end type
  44. global w_timerjob_setting w_timerjob_setting
  45. type variables
  46. long ins_col = 8
  47. uo_bgtr_timer ins_timer
  48. long ins_timertype = 0
  49. end variables
  50. forward prototypes
  51. public subroutine wf_face ()
  52. public function integer wf_save (ref string arg_msg)
  53. public function integer wf_check (ref string arg_msg)
  54. public function integer wf_del (ref string arg_msg)
  55. public subroutine wf_getinfo ()
  56. end prototypes
  57. public subroutine wf_face ();Long ll_i
  58. cb_del.Enabled = Not dw_edit_mode
  59. cb_1.Enabled = Not dw_edit_mode
  60. IF dw_edit_mode THEN
  61. cb_add.Text = "保存"
  62. cb_edit.Text = "放弃"
  63. cb_edit.normalpicname = 'Undo.bmp'
  64. cb_add.normalpicname = 'Save.bmp'
  65. FOR ll_i = 1 To ins_col
  66. dw_1.SetTabOrder(ll_i, 10 * ll_i)
  67. NEXT
  68. ELSE
  69. cb_edit.Text = "修改"
  70. cb_add.Text = "新建"
  71. cb_edit.normalpicname = 'OPEN.bmp'
  72. cb_add.normalpicname = 'new.bmp'
  73. FOR ll_i = 1 To ins_col
  74. dw_1.SetTabOrder(ll_i, 0)
  75. NEXT
  76. END IF
  77. cb_edit.of_init_draw()
  78. cb_add.of_init_draw()
  79. cb_edit.of_paint()
  80. cb_add.of_paint()
  81. cb_edit.TriggerEvent('ue_textchange')
  82. cb_add.TriggerEvent('ue_textchange')
  83. end subroutine
  84. public function integer wf_save (ref string arg_msg);Int rslt = 1
  85. Long ll_row
  86. ll_row = dw_1.GetRow()
  87. IF ll_row <= 0 THEN
  88. rslt = 0
  89. arg_msg = '没有保存对象'
  90. GOTO ext
  91. END IF
  92. ins_timer.ID = dw_1.Object.ID[ll_row]
  93. ins_timer.Name = dw_1.Object.Name[ll_row]
  94. ins_timer.TimerType = dw_1.Object.TimerType[ll_row]
  95. ins_timer.TimerParm = dw_1.Object.TimerParm[ll_row]
  96. ins_timer.TaskType = dw_1.Object.TaskType[ll_row]
  97. ins_timer.TaskParm = dw_1.Object.TaskParm[ll_row]
  98. ins_timer.NextExecTime = dw_1.Object.NextExecTime[ll_row]
  99. ins_timer.IsRunning = dw_1.Object.IsRunning[ll_row]
  100. IF ins_timer.uf_save(Ref arg_msg) <> 1 THEN
  101. rslt = 0
  102. GOTO ext
  103. END IF
  104. IF ins_timer.ID <> dw_1.Object.ID[ll_row] THEN
  105. dw_1.Object.ID[ll_row] = ins_timer.ID
  106. END IF
  107. ext:
  108. RETURN rslt
  109. end function
  110. public function integer wf_check (ref string arg_msg);Int rslt = 1
  111. IF dw_1.AcceptText() <> 1 THEN
  112. rslt = 0
  113. arg_msg = '内容与数据库存不符'
  114. GOTO ext
  115. END IF
  116. Long ll_row
  117. ll_row = dw_1.GetRow()
  118. IF ll_row <= 0 THEN
  119. rslt = 0
  120. arg_msg = '没有保存目标'
  121. GOTO ext
  122. END IF
  123. IF Trim(dw_1.Object.Name[ll_row]) = '' THEN
  124. rslt = 0
  125. arg_msg = '名称不能为空'
  126. dw_1.SetColumn('name')
  127. GOTO ext
  128. END IF
  129. IF dw_1.Object.TimerType[ll_row] = 0 THEN
  130. rslt = 0
  131. arg_msg = '请选择计时类型'
  132. dw_1.SetColumn('TimerType')
  133. GOTO ext
  134. END IF
  135. IF dw_1.Object.TaskType[ll_row] = 0 THEN
  136. rslt = 0
  137. arg_msg = '请选择任务类型'
  138. dw_1.SetColumn('TaskType')
  139. GOTO ext
  140. END IF
  141. ext:
  142. IF rslt = 0 THEN dw_1.SetFocus()
  143. RETURN rslt
  144. end function
  145. public function integer wf_del (ref string arg_msg);Int rslt = 1
  146. Long ll_row
  147. ll_row = dw_1.GetRow()
  148. IF ll_row <= 0 THEN
  149. rslt = 0
  150. arg_msg = '没有删除对象'
  151. GOTO ext
  152. END IF
  153. IF ins_timer.uf_del(dw_1.Object.ID[ll_row], Ref arg_msg) <> 1 THEN
  154. rslt = 0
  155. GOTO ext
  156. END IF
  157. dw_1.DeleteRow(ll_row)
  158. ext:
  159. RETURN rslt
  160. end function
  161. public subroutine wf_getinfo ();Long ll_row
  162. ll_row = dw_1.GetRow()
  163. IF ll_row <= 0 THEN RETURN
  164. String arg_msg
  165. IF ins_timer.uf_getinfo(dw_1.Object.ID[ll_row], Ref arg_msg) <> 1 THEN
  166. MessageBox('错误', arg_msg)
  167. RETURN
  168. END IF
  169. dw_1.Object.name[ll_row] = ins_timer.name
  170. dw_1.Object.TimerType[ll_row] = ins_timer.TimerType
  171. dw_1.Object.TimerParm[ll_row] = ins_timer.TimerParm
  172. dw_1.Object.TaskType[ll_row] = ins_timer.TaskType
  173. dw_1.Object.TaskParm[ll_row] = ins_timer.TaskParm
  174. dw_1.Object.NextExecTime[ll_row] = ins_timer.NextExecTime
  175. dw_1.Object.IsRunning[ll_row] = ins_timer.IsRunning
  176. dw_1.Object.LastExecTime[ll_row] = ins_timer.LastExecTime
  177. dw_1.Object.opemp[ll_row] = ins_timer.opemp
  178. dw_1.Object.opdate[ll_row] = ins_timer.opdate
  179. dw_1.Object.modemp[ll_row] = ins_timer.modemp
  180. dw_1.Object.moddate[ll_row] = ins_timer.moddate
  181. dw_1.Object.c_emp[ll_row] = ins_timer.c_emp
  182. dw_1.Object.c_date[ll_row] = ins_timer.c_date
  183. end subroutine
  184. on w_timerjob_setting.create
  185. int iCurrent
  186. call super::create
  187. this.cb_1=create cb_1
  188. this.cb_add=create cb_add
  189. this.cb_edit=create cb_edit
  190. this.cb_del=create cb_del
  191. this.dw_1=create dw_1
  192. this.dw_2=create dw_2
  193. this.ddlb_timertype=create ddlb_timertype
  194. this.r_bar=create r_bar
  195. this.ln_bar=create ln_bar
  196. this.ln_bar2=create ln_bar2
  197. iCurrent=UpperBound(this.Control)
  198. this.Control[iCurrent+1]=this.cb_1
  199. this.Control[iCurrent+2]=this.cb_add
  200. this.Control[iCurrent+3]=this.cb_edit
  201. this.Control[iCurrent+4]=this.cb_del
  202. this.Control[iCurrent+5]=this.dw_1
  203. this.Control[iCurrent+6]=this.dw_2
  204. this.Control[iCurrent+7]=this.ddlb_timertype
  205. this.Control[iCurrent+8]=this.r_bar
  206. this.Control[iCurrent+9]=this.ln_bar
  207. this.Control[iCurrent+10]=this.ln_bar2
  208. end on
  209. on w_timerjob_setting.destroy
  210. call super::destroy
  211. destroy(this.cb_1)
  212. destroy(this.cb_add)
  213. destroy(this.cb_edit)
  214. destroy(this.cb_del)
  215. destroy(this.dw_1)
  216. destroy(this.dw_2)
  217. destroy(this.ddlb_timertype)
  218. destroy(this.r_bar)
  219. destroy(this.ln_bar)
  220. destroy(this.ln_bar2)
  221. end on
  222. event closequery;call super::closequery;IF dw_edit_mode THEN
  223. IF MessageBox('提问', '编辑状态下,是否退出窗口?', Question!,YesNo!) = 2 THEN
  224. RETURN 1
  225. END IF
  226. END IF
  227. end event
  228. event open;call super::open;dw_1.SetTransobject(sqlca)
  229. dw_2.SetTransObject(sqlca)
  230. cb_1.TriggerEvent(Clicked!)
  231. ins_timer = create uo_bgtr_timer
  232. end event
  233. event resize;call super::resize;
  234. IF This.Width < 3840 THEN
  235. This.Width = 3840
  236. END IF
  237. IF This.Height < 2024 THEN
  238. This.Height = 2024
  239. END IF
  240. r_bar.Width = This.Width
  241. ln_bar.EndX = This.Width
  242. ln_bar2.EndX = This.Width
  243. dw_1.Width = This.WorkSpaceWidth() - dw_1.X
  244. dw_2.Width = dw_1.Width
  245. dw_2.Height = This.WorkSpaceHeight() - dw_2.Y
  246. end event
  247. event close;call super::close;destroy ins_timer
  248. end event
  249. type cb_func from w_publ_base`cb_func within w_timerjob_setting
  250. boolean visible = false
  251. integer x = 1463
  252. integer y = 1012
  253. end type
  254. type cb_exit from w_publ_base`cb_exit within w_timerjob_setting
  255. integer x = 603
  256. integer width = 151
  257. integer height = 164
  258. integer picsize = 16
  259. toolbaralignment pic_align = alignattop!
  260. boolean border = false
  261. end type
  262. type cb_1 from uo_imflatbutton within w_timerjob_setting
  263. integer x = 453
  264. integer width = 151
  265. integer height = 164
  266. integer taborder = 80
  267. boolean bringtotop = true
  268. string text = "刷新"
  269. string normalpicname = "refresh.BMP"
  270. integer picsize = 16
  271. toolbaralignment pic_align = alignattop!
  272. boolean border = false
  273. end type
  274. event clicked;call super::clicked;dw_1.Retrieve(ins_timertype)
  275. dw_1.Trigger event rowfocuschanged(dw_1.GetRow())
  276. end event
  277. type cb_add from uo_imflatbutton within w_timerjob_setting
  278. integer width = 151
  279. integer height = 164
  280. integer taborder = 90
  281. boolean bringtotop = true
  282. string text = "新建"
  283. string normalpicname = "new.BMP"
  284. integer picsize = 16
  285. toolbaralignment pic_align = alignattop!
  286. boolean border = false
  287. end type
  288. event clicked;call super::clicked;String arg_msg
  289. Long ll_row
  290. IF dw_edit_mode THEN
  291. IF wf_check(Ref arg_msg) <> 1 THEN
  292. MessageBox(publ_operator, arg_msg)
  293. RETURN
  294. END IF
  295. IF wf_save(Ref arg_msg) <> 1 THEN
  296. MessageBox(publ_operator, arg_msg)
  297. RETURN
  298. END IF
  299. ELSE
  300. ll_row = dw_1.InsertRow(0)
  301. dw_1.SetRow(ll_row)
  302. dw_1.ScrollToRow(ll_row)
  303. dw_1.SetFocus()
  304. END IF
  305. dw_edit_mode = Not dw_edit_mode
  306. wf_face()
  307. IF Not dw_edit_mode THEN
  308. wf_getinfo()
  309. dw_1.AcceptText()
  310. END IF
  311. end event
  312. type cb_edit from uo_imflatbutton within w_timerjob_setting
  313. integer x = 151
  314. integer width = 151
  315. integer height = 164
  316. integer taborder = 100
  317. boolean bringtotop = true
  318. string text = "修改"
  319. string normalpicname = "open.BMP"
  320. integer picsize = 16
  321. toolbaralignment pic_align = alignattop!
  322. boolean border = false
  323. end type
  324. event clicked;call super::clicked;IF dw_edit_mode THEN
  325. IF MessageBox('提问','是否确定要放弃保存当前资料?', Question!, YesNo!) = 2 THEN
  326. RETURN
  327. END IF
  328. IF dw_1.Object.ID[dw_1.GetRow()] = 0 THEN
  329. dw_1.DeleteRow(dw_1.GetRow())
  330. ELSE
  331. wf_getinfo()
  332. dw_1.AcceptText()
  333. END IF
  334. ELSE
  335. IF dw_1.GetRow() <= 0 THEN
  336. MessageBox(publ_operator, '请选择修改对象')
  337. RETURN
  338. END IF
  339. END IF
  340. dw_edit_mode = Not dw_edit_mode
  341. wf_face()
  342. end event
  343. type cb_del from uo_imflatbutton within w_timerjob_setting
  344. integer x = 302
  345. integer width = 151
  346. integer height = 164
  347. integer taborder = 110
  348. boolean bringtotop = true
  349. string text = "删除"
  350. string normalpicname = "delete.BMP"
  351. integer picsize = 16
  352. toolbaralignment pic_align = alignattop!
  353. boolean border = false
  354. end type
  355. event clicked;call super::clicked;IF dw_edit_mode THEN RETURN
  356. IF MessageBox ("IF","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  357. RETURN
  358. END IF
  359. String arg_msg
  360. IF wf_del(Ref arg_msg) <> 1 THEN
  361. MessageBox(publ_operator, arg_msg)
  362. RETURN
  363. END IF
  364. end event
  365. type dw_1 from u_dw_rbtnfilter within w_timerjob_setting
  366. integer y = 184
  367. integer width = 2240
  368. integer height = 980
  369. integer taborder = 20
  370. boolean bringtotop = true
  371. string dataobject = "dw_bgtr_timer"
  372. boolean hscrollbar = true
  373. boolean vscrollbar = true
  374. boolean hsplitscroll = true
  375. boolean rbutton_filter_use = true
  376. boolean rbutton_setposition_use = true
  377. boolean titleclick_sort_use = true
  378. end type
  379. event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1
  380. end event
  381. event rowfocuschanged;call super::rowfocuschanged;This.SelectRow(0, False)
  382. IF currentrow <= 0 OR currentrow > this.Rowcount() THEN RETURN
  383. This.SelectRow(currentrow, True)
  384. long ll_id
  385. ll_id = this.GetItemNumber(currentrow, "ID")
  386. if ll_id > 0 then
  387. dw_2.Retrieve(ll_id)
  388. end if
  389. end event
  390. type dw_2 from u_dw_rbtnfilter within w_timerjob_setting
  391. integer y = 1164
  392. integer width = 2240
  393. integer height = 980
  394. integer taborder = 30
  395. boolean bringtotop = true
  396. string dataobject = "dw_bgtr_timer_log"
  397. boolean hscrollbar = true
  398. boolean vscrollbar = true
  399. boolean hsplitscroll = true
  400. boolean rbutton_filter_use = true
  401. boolean rbutton_setposition_use = true
  402. boolean titleclick_sort_use = true
  403. end type
  404. type ddlb_timertype from dropdownlistbox within w_timerjob_setting
  405. integer x = 809
  406. integer y = 52
  407. integer width = 251
  408. integer height = 452
  409. integer taborder = 20
  410. boolean bringtotop = true
  411. integer textsize = -9
  412. integer weight = 400
  413. fontcharset fontcharset = gb2312charset!
  414. fontpitch fontpitch = variable!
  415. string facename = "宋体"
  416. long textcolor = 33554432
  417. string text = "循环"
  418. string item[] = {"一次","循环","全部"}
  419. borderstyle borderstyle = stylelowered!
  420. end type
  421. event constructor;This.Text = '循环'
  422. ins_timertype = 0
  423. end event
  424. event selectionchanged;IF This.Text = '循环' THEN
  425. ins_timertype = 0
  426. ELSEIF This.Text = '一次' THEN
  427. ins_timertype = 1
  428. ELSE
  429. ins_timertype = -1
  430. END IF
  431. cb_1.TriggerEvent(Clicked!)
  432. end event
  433. type r_bar from rectangle within w_timerjob_setting
  434. long linecolor = 16777215
  435. integer linethickness = 4
  436. long fillcolor = 1073741824
  437. integer x = 1454
  438. integer y = 4
  439. integer width = 146
  440. integer height = 68
  441. end type
  442. event constructor;this.fillcolor = 14215660
  443. this.linecolor = 14215660
  444. this.x = -1
  445. this.y = -1
  446. this.height = ln_bar.beginy - 5
  447. end event
  448. type ln_bar from line within w_timerjob_setting
  449. long linecolor = 268435456
  450. integer linethickness = 4
  451. integer beginy = 168
  452. integer endx = 2007
  453. integer endy = 168
  454. end type
  455. type ln_bar2 from line within w_timerjob_setting
  456. long linecolor = 16777215
  457. integer linethickness = 4
  458. integer beginy = 172
  459. integer endx = 2039
  460. integer endy = 172
  461. end type