123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568 |
- $PBExportHeader$w_timerjob_setting.srw
- forward
- global type w_timerjob_setting from w_publ_base
- end type
- type cb_1 from uo_imflatbutton within w_timerjob_setting
- end type
- type cb_add from uo_imflatbutton within w_timerjob_setting
- end type
- type cb_edit from uo_imflatbutton within w_timerjob_setting
- end type
- type cb_del from uo_imflatbutton within w_timerjob_setting
- end type
- type dw_1 from u_dw_rbtnfilter within w_timerjob_setting
- end type
- type dw_2 from u_dw_rbtnfilter within w_timerjob_setting
- end type
- type ddlb_timertype from dropdownlistbox within w_timerjob_setting
- end type
- type r_bar from rectangle within w_timerjob_setting
- end type
- type ln_bar from line within w_timerjob_setting
- end type
- type ln_bar2 from line within w_timerjob_setting
- end type
- end forward
- global type w_timerjob_setting from w_publ_base
- integer width = 3877
- integer height = 2128
- string title = "定时任务设置"
- boolean maxbox = true
- boolean resizable = true
- windowstate windowstate = maximized!
- cb_1 cb_1
- cb_add cb_add
- cb_edit cb_edit
- cb_del cb_del
- dw_1 dw_1
- dw_2 dw_2
- ddlb_timertype ddlb_timertype
- r_bar r_bar
- ln_bar ln_bar
- ln_bar2 ln_bar2
- end type
- global w_timerjob_setting w_timerjob_setting
- type variables
- long ins_col = 8
- uo_bgtr_timer ins_timer
- long ins_timertype = 0
- end variables
- forward prototypes
- public subroutine wf_face ()
- public function integer wf_save (ref string arg_msg)
- public function integer wf_check (ref string arg_msg)
- public function integer wf_del (ref string arg_msg)
- public subroutine wf_getinfo ()
- end prototypes
- public subroutine wf_face ();Long ll_i
- cb_del.Enabled = Not dw_edit_mode
- cb_1.Enabled = Not dw_edit_mode
- IF dw_edit_mode THEN
- cb_add.Text = "保存"
- cb_edit.Text = "放弃"
- cb_edit.normalpicname = 'Undo.bmp'
- cb_add.normalpicname = 'Save.bmp'
-
- FOR ll_i = 1 To ins_col
- dw_1.SetTabOrder(ll_i, 10 * ll_i)
- NEXT
-
- ELSE
- cb_edit.Text = "修改"
- cb_add.Text = "新建"
- cb_edit.normalpicname = 'OPEN.bmp'
- cb_add.normalpicname = 'new.bmp'
-
- FOR ll_i = 1 To ins_col
- dw_1.SetTabOrder(ll_i, 0)
- NEXT
-
- END IF
- cb_edit.of_init_draw()
- cb_add.of_init_draw()
- cb_edit.of_paint()
- cb_add.of_paint()
- cb_edit.TriggerEvent('ue_textchange')
- cb_add.TriggerEvent('ue_textchange')
- end subroutine
- public function integer wf_save (ref string arg_msg);Int rslt = 1
- Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- rslt = 0
- arg_msg = '没有保存对象'
- GOTO ext
- END IF
- ins_timer.ID = dw_1.Object.ID[ll_row]
- ins_timer.Name = dw_1.Object.Name[ll_row]
- ins_timer.TimerType = dw_1.Object.TimerType[ll_row]
- ins_timer.TimerParm = dw_1.Object.TimerParm[ll_row]
- ins_timer.TaskType = dw_1.Object.TaskType[ll_row]
- ins_timer.TaskParm = dw_1.Object.TaskParm[ll_row]
- ins_timer.NextExecTime = dw_1.Object.NextExecTime[ll_row]
- ins_timer.IsRunning = dw_1.Object.IsRunning[ll_row]
- IF ins_timer.uf_save(Ref arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- IF ins_timer.ID <> dw_1.Object.ID[ll_row] THEN
- dw_1.Object.ID[ll_row] = ins_timer.ID
- END IF
- ext:
- RETURN rslt
- end function
- public function integer wf_check (ref string arg_msg);Int rslt = 1
- IF dw_1.AcceptText() <> 1 THEN
- rslt = 0
- arg_msg = '内容与数据库存不符'
- GOTO ext
- END IF
- Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- rslt = 0
- arg_msg = '没有保存目标'
- GOTO ext
- END IF
- IF Trim(dw_1.Object.Name[ll_row]) = '' THEN
- rslt = 0
- arg_msg = '名称不能为空'
- dw_1.SetColumn('name')
- GOTO ext
- END IF
- IF dw_1.Object.TimerType[ll_row] = 0 THEN
- rslt = 0
- arg_msg = '请选择计时类型'
- dw_1.SetColumn('TimerType')
- GOTO ext
- END IF
- IF dw_1.Object.TaskType[ll_row] = 0 THEN
- rslt = 0
- arg_msg = '请选择任务类型'
- dw_1.SetColumn('TaskType')
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN dw_1.SetFocus()
- RETURN rslt
- end function
- public function integer wf_del (ref string arg_msg);Int rslt = 1
- Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- rslt = 0
- arg_msg = '没有删除对象'
- GOTO ext
- END IF
- IF ins_timer.uf_del(dw_1.Object.ID[ll_row], Ref arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- dw_1.DeleteRow(ll_row)
- ext:
- RETURN rslt
- end function
- public subroutine wf_getinfo ();Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN RETURN
- String arg_msg
- IF ins_timer.uf_getinfo(dw_1.Object.ID[ll_row], Ref arg_msg) <> 1 THEN
- MessageBox('错误', arg_msg)
- RETURN
- END IF
- dw_1.Object.name[ll_row] = ins_timer.name
- dw_1.Object.TimerType[ll_row] = ins_timer.TimerType
- dw_1.Object.TimerParm[ll_row] = ins_timer.TimerParm
- dw_1.Object.TaskType[ll_row] = ins_timer.TaskType
- dw_1.Object.TaskParm[ll_row] = ins_timer.TaskParm
- dw_1.Object.NextExecTime[ll_row] = ins_timer.NextExecTime
- dw_1.Object.IsRunning[ll_row] = ins_timer.IsRunning
- dw_1.Object.LastExecTime[ll_row] = ins_timer.LastExecTime
- dw_1.Object.opemp[ll_row] = ins_timer.opemp
- dw_1.Object.opdate[ll_row] = ins_timer.opdate
- dw_1.Object.modemp[ll_row] = ins_timer.modemp
- dw_1.Object.moddate[ll_row] = ins_timer.moddate
- dw_1.Object.c_emp[ll_row] = ins_timer.c_emp
- dw_1.Object.c_date[ll_row] = ins_timer.c_date
- end subroutine
- on w_timerjob_setting.create
- int iCurrent
- call super::create
- this.cb_1=create cb_1
- this.cb_add=create cb_add
- this.cb_edit=create cb_edit
- this.cb_del=create cb_del
- this.dw_1=create dw_1
- this.dw_2=create dw_2
- this.ddlb_timertype=create ddlb_timertype
- this.r_bar=create r_bar
- this.ln_bar=create ln_bar
- this.ln_bar2=create ln_bar2
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_1
- this.Control[iCurrent+2]=this.cb_add
- this.Control[iCurrent+3]=this.cb_edit
- this.Control[iCurrent+4]=this.cb_del
- this.Control[iCurrent+5]=this.dw_1
- this.Control[iCurrent+6]=this.dw_2
- this.Control[iCurrent+7]=this.ddlb_timertype
- this.Control[iCurrent+8]=this.r_bar
- this.Control[iCurrent+9]=this.ln_bar
- this.Control[iCurrent+10]=this.ln_bar2
- end on
- on w_timerjob_setting.destroy
- call super::destroy
- destroy(this.cb_1)
- destroy(this.cb_add)
- destroy(this.cb_edit)
- destroy(this.cb_del)
- destroy(this.dw_1)
- destroy(this.dw_2)
- destroy(this.ddlb_timertype)
- destroy(this.r_bar)
- destroy(this.ln_bar)
- destroy(this.ln_bar2)
- end on
- event closequery;call super::closequery;IF dw_edit_mode THEN
- IF MessageBox('提问', '编辑状态下,是否退出窗口?', Question!,YesNo!) = 2 THEN
- RETURN 1
- END IF
- END IF
- end event
- event open;call super::open;dw_1.SetTransobject(sqlca)
- dw_2.SetTransObject(sqlca)
- cb_1.TriggerEvent(Clicked!)
- ins_timer = create uo_bgtr_timer
- end event
- event resize;call super::resize;
- IF This.Width < 3840 THEN
- This.Width = 3840
- END IF
- IF This.Height < 2024 THEN
- This.Height = 2024
- END IF
- r_bar.Width = This.Width
- ln_bar.EndX = This.Width
- ln_bar2.EndX = This.Width
- dw_1.Width = This.WorkSpaceWidth() - dw_1.X
- dw_2.Width = dw_1.Width
- dw_2.Height = This.WorkSpaceHeight() - dw_2.Y
- end event
- event close;call super::close;destroy ins_timer
- end event
- type cb_func from w_publ_base`cb_func within w_timerjob_setting
- boolean visible = false
- integer x = 1463
- integer y = 1012
- end type
- type cb_exit from w_publ_base`cb_exit within w_timerjob_setting
- integer x = 603
- integer width = 151
- integer height = 164
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type cb_1 from uo_imflatbutton within w_timerjob_setting
- integer x = 453
- integer width = 151
- integer height = 164
- integer taborder = 80
- boolean bringtotop = true
- string text = "刷新"
- string normalpicname = "refresh.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;dw_1.Retrieve(ins_timertype)
- dw_1.Trigger event rowfocuschanged(dw_1.GetRow())
- end event
- type cb_add from uo_imflatbutton within w_timerjob_setting
- integer width = 151
- integer height = 164
- integer taborder = 90
- boolean bringtotop = true
- string text = "新建"
- string normalpicname = "new.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;String arg_msg
- Long ll_row
- IF dw_edit_mode THEN
- IF wf_check(Ref arg_msg) <> 1 THEN
- MessageBox(publ_operator, arg_msg)
- RETURN
- END IF
-
- IF wf_save(Ref arg_msg) <> 1 THEN
- MessageBox(publ_operator, arg_msg)
- RETURN
- END IF
-
- ELSE
- ll_row = dw_1.InsertRow(0)
- dw_1.SetRow(ll_row)
- dw_1.ScrollToRow(ll_row)
- dw_1.SetFocus()
- END IF
- dw_edit_mode = Not dw_edit_mode
- wf_face()
- IF Not dw_edit_mode THEN
- wf_getinfo()
- dw_1.AcceptText()
- END IF
- end event
- type cb_edit from uo_imflatbutton within w_timerjob_setting
- integer x = 151
- integer width = 151
- integer height = 164
- integer taborder = 100
- boolean bringtotop = true
- string text = "修改"
- string normalpicname = "open.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF dw_edit_mode THEN
- IF MessageBox('提问','是否确定要放弃保存当前资料?', Question!, YesNo!) = 2 THEN
- RETURN
- END IF
-
- IF dw_1.Object.ID[dw_1.GetRow()] = 0 THEN
- dw_1.DeleteRow(dw_1.GetRow())
- ELSE
- wf_getinfo()
- dw_1.AcceptText()
- END IF
-
- ELSE
- IF dw_1.GetRow() <= 0 THEN
- MessageBox(publ_operator, '请选择修改对象')
- RETURN
- END IF
- END IF
- dw_edit_mode = Not dw_edit_mode
- wf_face()
- end event
- type cb_del from uo_imflatbutton within w_timerjob_setting
- integer x = 302
- integer width = 151
- integer height = 164
- integer taborder = 110
- boolean bringtotop = true
- string text = "删除"
- string normalpicname = "delete.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF dw_edit_mode THEN RETURN
- IF MessageBox ("IF","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- String arg_msg
- IF wf_del(Ref arg_msg) <> 1 THEN
- MessageBox(publ_operator, arg_msg)
- RETURN
- END IF
- end event
- type dw_1 from u_dw_rbtnfilter within w_timerjob_setting
- integer y = 184
- integer width = 2240
- integer height = 980
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_bgtr_timer"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1
- end event
- event rowfocuschanged;call super::rowfocuschanged;This.SelectRow(0, False)
- IF currentrow <= 0 OR currentrow > this.Rowcount() THEN RETURN
- This.SelectRow(currentrow, True)
- long ll_id
- ll_id = this.GetItemNumber(currentrow, "ID")
- if ll_id > 0 then
- dw_2.Retrieve(ll_id)
- end if
- end event
- type dw_2 from u_dw_rbtnfilter within w_timerjob_setting
- integer y = 1164
- integer width = 2240
- integer height = 980
- integer taborder = 30
- boolean bringtotop = true
- string dataobject = "dw_bgtr_timer_log"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- type ddlb_timertype from dropdownlistbox within w_timerjob_setting
- integer x = 809
- integer y = 52
- integer width = 251
- integer height = 452
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "循环"
- string item[] = {"一次","循环","全部"}
- borderstyle borderstyle = stylelowered!
- end type
- event constructor;This.Text = '循环'
- ins_timertype = 0
- end event
- event selectionchanged;IF This.Text = '循环' THEN
- ins_timertype = 0
- ELSEIF This.Text = '一次' THEN
- ins_timertype = 1
- ELSE
- ins_timertype = -1
- END IF
- cb_1.TriggerEvent(Clicked!)
- end event
- type r_bar from rectangle within w_timerjob_setting
- long linecolor = 16777215
- integer linethickness = 4
- long fillcolor = 1073741824
- integer x = 1454
- integer y = 4
- integer width = 146
- integer height = 68
- end type
- event constructor;this.fillcolor = 14215660
- this.linecolor = 14215660
- this.x = -1
- this.y = -1
- this.height = ln_bar.beginy - 5
- end event
- type ln_bar from line within w_timerjob_setting
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 168
- integer endx = 2007
- integer endy = 168
- end type
- type ln_bar2 from line within w_timerjob_setting
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 172
- integer endx = 2039
- integer endy = 172
- end type
|