$PBExportHeader$w_oa_workreminddef.srw forward global type w_oa_workreminddef from window end type type cb_exit from uo_imflatbutton within w_oa_workreminddef end type type cb_3 from uo_imflatbutton within w_oa_workreminddef end type type cb_2 from uo_imflatbutton within w_oa_workreminddef end type type cb_1 from uo_imflatbutton within w_oa_workreminddef end type type em_1 from editmask within w_oa_workreminddef end type type em_2 from editmask within w_oa_workreminddef end type type cb_5 from commandbutton within w_oa_workreminddef end type type cbx_2 from checkbox within w_oa_workreminddef end type type cbx_1 from checkbox within w_oa_workreminddef end type type cb_4 from uo_imflatbutton within w_oa_workreminddef end type type dw_type from datawindow within w_oa_workreminddef end type type dw_result from datawindow within w_oa_workreminddef end type type dw_list from datawindow within w_oa_workreminddef end type type ln_bar2 from line within w_oa_workreminddef end type type ln_bar from line within w_oa_workreminddef end type type r_bar from rectangle within w_oa_workreminddef end type type pipeline_1 from pipeline within w_oa_workreminddef end type end forward global type w_oa_workreminddef from window integer width = 3611 integer height = 2380 boolean titlebar = true string title = "工作提醒定义" boolean controlmenu = true boolean minbox = true boolean maxbox = true windowtype windowtype = popup! long backcolor = 67108864 string icon = "AppIcon!" boolean center = true event ue_delete_cur ( ) event ue_delete_p ( ) event ue_retrieve_list ( ) event ue_retrieve_result ( ) cb_exit cb_exit cb_3 cb_3 cb_2 cb_2 cb_1 cb_1 em_1 em_1 em_2 em_2 cb_5 cb_5 cbx_2 cbx_2 cbx_1 cbx_1 cb_4 cb_4 dw_type dw_type dw_result dw_result dw_list dw_list ln_bar2 ln_bar2 ln_bar ln_bar r_bar r_bar pipeline_1 pipeline_1 end type global w_oa_workreminddef w_oa_workreminddef type variables boolean ib_edit long il_curid=-1 string is_curMOD='' uo_oa_workremind uo_wrm //string is_cansee int ii_EDITCOL = 17 end variables forward prototypes public subroutine wf_refresh () public function boolean wf_check (ref string arg_msg) public function s_oa_workremind_timetype wf_releasetimetype (string arg_parm) end prototypes event ue_delete_cur(); //删除 IF DW_list.GetRow() <= 0 THEN MessageBox('',"没有操作目标记录") RETURN END IF IF MessageBox(publ_operator,'是否要确定删除当前记录', Exclamation!, YesNo!, 2) = 2 THEN RETURN END IF String arg_msg IF NOT uo_wrm.uf_delete(il_curID,arg_msg) THEN MessageBox (publ_operator,arg_msg,Exclamation!,OK!) RETURN END IF DW_list.SetRedraw (FALSE) Long curRow curRow = DW_list.GetRow() DW_list.DeleteRow (curRow) //dw_list.TriggerEvent (rowfocuschanged!) DW_list.SetRedraw (TRUE) dw_result.Reset() dw_result.InsertRow(0) end event event ue_delete_p();IF MessageBox(publ_operator,'准备删除多条记录!~r~n是否要确定执行', Exclamation!, YesNo!, 2) = 2 THEN RETURN END IF Long cnt String arg_msg //todo 批删除 IF dw_list.RowCount() = 0 THEN MessageBox('',"当前没有操作记录") RETURN END IF dw_list.SetRedraw (FALSE) Long cnt2 cnt2 = dw_list.RowCount() FOR cnt = 1 TO cnt2 IF dw_list.Object.Selected[cnt ] = 1 THEN Long curID curID = dw_list.Object.wrmid[cnt] // dw_list.DeleteRow (0) DELETE FROM oa_workremindDef Where wrmid = :curID; IF NOT uo_wrm.uf_delete(curID,arg_msg) THEN // rollback; GOTO ext MessageBox (publ_operator,arg_msg,Exclamation!,OK!) // goto ext // else // commit; END IF END IF NEXT //dw_list.TriggerEvent (rowfocuschanged!) dw_list.Retrieve(is_curMOD) dw_result.Reset() dw_result.InsertRow(0) ext: dw_list.SetRedraw (TRUE) end event event ue_retrieve_list();IF dw_type.GetRow() > 0 THEN String ls_ModuleName ls_ModuleName = dw_type.Object.ModuleName[dw_type.GetRow()] dw_list.Retrieve(ls_ModuleName) this.triggerevent('ue_retrieve_result') ELSE dw_list.Reset() END IF end event event ue_retrieve_result();IF dw_list.GetRow() > 0 THEN long ll_wrmid ll_wrmid = dw_list.Object.WrmID[dw_list.GetRow()] dw_result.Retrieve(ll_wrmid) ELSE dw_result.Reset() END IF end event public subroutine wf_refresh ();Long i IF ib_edit THEN //当前处于编辑状态 cb_1.normalpicname = 'save.bmp' cb_2.normalpicname = 'undo.bmp' cb_2.Text = "放弃" cb_1.Text = "保存" cb_3.Enabled = FALSE cb_4.Enabled = FALSE FOR i = 1 TO ii_EDITCOL dw_result.SetTabOrder(i,10 * i) NEXT ELSE cb_1.normalpicname = 'new.bmp' cb_2.normalpicname = 'open.bmp' cb_1.Text = "新建" cb_2.Text = "修改" cb_3.Enabled = TRUE cb_4.Enabled = TRUE FOR i = 1 TO ii_EDITCOL dw_result.SetTabOrder(i,0) NEXT END IF cb_1.of_init_draw() cb_2.of_init_draw() cb_1.of_paint() cb_2.of_paint() cb_1.TriggerEvent('ue_textchange') cb_2.TriggerEvent('ue_textchange') end subroutine public function boolean wf_check (ref string arg_msg);//检查页面内容合法性 String ls_sqlStr IF dw_result.RowCount() <> 0 THEN ls_sqlStr = dw_result.Object.Expressions[1] IF NOT uo_wrm.uf_chk_synax(ls_sqlStr,arg_msg)THEN RETURN FALSE END IF END IF RETURN TRUE end function public function s_oa_workremind_timetype wf_releasetimetype (string arg_parm);s_oa_workremind_timetype ins_timetype string timeStr[] f_oa_workremind_splitstr(arg_parm,"!",ref timeStr) if pos(arg_parm,"rep")<>0 then ins_timetype.checktype=timeStr[1] ins_timetype.IntervalType=timeStr[2] ins_timetype.Interval=timeStr[3] ins_timetype.freType=timeStr[4] ins_timetype.fre=timeStr[5] ins_timetype.startDate=timeStr[6] elseif pos(arg_parm,"once")<>0 then ins_timetype.checktype=timeStr[1] ins_timetype.oncedate=timeStr[2] ins_timetype.oncetime=timeStr[3] end if return ins_timetype end function on w_oa_workreminddef.create this.cb_exit=create cb_exit this.cb_3=create cb_3 this.cb_2=create cb_2 this.cb_1=create cb_1 this.em_1=create em_1 this.em_2=create em_2 this.cb_5=create cb_5 this.cbx_2=create cbx_2 this.cbx_1=create cbx_1 this.cb_4=create cb_4 this.dw_type=create dw_type this.dw_result=create dw_result this.dw_list=create dw_list this.ln_bar2=create ln_bar2 this.ln_bar=create ln_bar this.r_bar=create r_bar this.pipeline_1=create pipeline_1 this.Control[]={this.cb_exit,& this.cb_3,& this.cb_2,& this.cb_1,& this.em_1,& this.em_2,& this.cb_5,& this.cbx_2,& this.cbx_1,& this.cb_4,& this.dw_type,& this.dw_result,& this.dw_list,& this.ln_bar2,& this.ln_bar,& this.r_bar} end on on w_oa_workreminddef.destroy destroy(this.cb_exit) destroy(this.cb_3) destroy(this.cb_2) destroy(this.cb_1) destroy(this.em_1) destroy(this.em_2) destroy(this.cb_5) destroy(this.cbx_2) destroy(this.cbx_1) destroy(this.cb_4) destroy(this.dw_type) destroy(this.dw_result) destroy(this.dw_list) destroy(this.ln_bar2) destroy(this.ln_bar) destroy(this.r_bar) destroy(this.pipeline_1) end on event resize;ln_bar.endx = this.width ln_bar2.endx = this.width r_bar.Width = ln_bar2.EndX dw_type.height=this.height - dw_type.y - 140 dw_list.height=this.height - dw_list.y - 150 - dw_result.height dw_result.y = dw_list.y + dw_list.height + 10 dw_list.width = this.width - dw_list.x - 40 dw_result.width = this.width - dw_result.x - 40 end event event open; dw_list.setTrans(sqlca) dw_result.setTrans(sqlca) dw_type.setTrans(sqlca) dw_result.retrieve(0) dw_result.insertrow(0) string ls_msg ib_edit=false //wf_refresh() uo_wrm=create uo_oa_workremind // uo_wrm.uf_get_cansee(publ_userid,ref is_cansee,ref ls_msg) dw_type.retrieve() // dw_list.retrieve(is_curMOD) if dw_list.rowcount()=0 then // dw_list.insertrow(0) // goto ext end if //dw_result. //ext: //em_2.text=string(today()) //em_1.text=string(now()) end event event close;destroy uo_wrm end event type cb_exit from uo_imflatbutton within w_oa_workreminddef integer x = 713 integer width = 165 integer height = 172 integer taborder = 10 string text = "退出" boolean cancel = true string normalpicname = "exit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;close(parent) end event type cb_3 from uo_imflatbutton within w_oa_workreminddef integer x = 549 integer width = 165 integer height = 172 integer taborder = 10 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;m_Dfc_Control_PopupMenu dmPopupMenu String menustr menustr = "Text=删除当前项~tEvent=ue_delete_cur" menustr = menustr + "|" + "Text=批删除~tEvent=ue_delete_p" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = CREATE m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(THIS, menustr) dmPopupMenu.mf_PopMenu() DESTROY dmPopupMenu END IF end event type cb_2 from uo_imflatbutton within w_oa_workreminddef integer x = 357 integer width = 192 integer height = 172 integer taborder = 10 boolean bringtotop = true string text = "修改&E" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; IF ib_edit THEN IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN RETURN END IF ELSE END IF ib_edit = NOT ib_edit wf_refresh() IF NOT ib_edit THEN parent.triggerevent('ue_retrieve_result') END IF end event type cb_1 from uo_imflatbutton within w_oa_workreminddef integer x = 165 integer width = 192 integer height = 172 integer taborder = 10 boolean bringtotop = true string text = "新建&S" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;s_userworkremind uwrm String arg_msg = " " Long ll_row IF ib_edit THEN dw_result.AcceptText() // IF NOT wf_check(arg_msg) THEN // MessageBox('',arg_msg) // RETURN // END IF ll_row = dw_result.GetRow() IF ll_row <= 0 THEN MessageBox('',"请选择目标行") RETURN END IF // 保存 IF dw_result.Object.wrmid[ll_row] <> -1 THEN uwrm.wrmid = Long( dw_result.Object.wrmid[ll_row]) ELSE Long NewWrmId SELECT max(wrmid) INTO :NewWrmId FROM oa_workreminddef; NewWrmId++ uwrm.wrmid = NewWrmId END IF IF IsNull(uwrm.wrmid) THEN uwrm.wrmid = 1 END IF uwrm.wrmcode = String( dw_result.Object.wrmcode[ll_row]) uwrm.Expressions = String( dw_result.Object.Expressions[ll_row]) uwrm.expressionsmx = String( dw_result.Object.expressionsmx[ll_row]) uwrm.WrmType = Long( dw_result.Object.WrmType[ll_row]) uwrm.ChkTimeRule = String( dw_result.Object.ChkTimeRule[ll_row]) uwrm.Funcid = Long( dw_result.Object.Funcid[ll_row]) uwrm.WinName = String( dw_result.Object.WinName[ll_row]) uwrm.ModuleName = String( dw_result.Object.ModuleName[ll_row]) uwrm.Ifsc = Long( dw_result.Object.Ifsc[ll_row]) uwrm.Ifstorage = Long( dw_result.Object.Ifstorage[ll_row]) uwrm.ifcusarea = Long( dw_result.Object.ifcusarea[ll_row]) uwrm.ifoutrep = Long( dw_result.Object.ifoutrep[ll_row]) uwrm.ifspttype = Long( dw_result.Object.ifspttype[ll_row]) uwrm.ifdftwin = Long( dw_result.Object.ifdftwin[ll_row]) uwrm.ifautoopen = Long( dw_result.Object.ifautoopen[ll_row]) uwrm.WrmName = String( dw_result.Object.WrmName[ll_row]) uwrm.Operationstr = String(dw_result.Object.Operationstr[ll_row]) uwrm.timeDirection = String(dw_result.Object.ChkTimedir[ll_row]) Boolean rslt = TRUE rslt = uo_wrm.uf_save(uwrm,arg_msg) // uo_wrm.uf_test("hi") IF NOT rslt THEN MessageBox('',arg_msg) RETURN ELSE //dw_list.Retrieve(is_curMOD) dw_result.Retrieve(uwrm.wrmid) MessageBox('系统提示',"保存成功") END IF ib_edit = NOT ib_edit wf_refresh() ELSE //新建 dw_result.Reset() dw_result.InsertRow(0) ib_edit = TRUE wf_refresh() END IF end event type em_1 from editmask within w_oa_workreminddef boolean visible = false integer x = 1915 integer y = 124 integer width = 352 integer height = 64 integer taborder = 50 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 maskdatatype maskdatatype = timemask! string mask = "hh:mm:ss" boolean spin = true double increment = 1 string minmax = "00:00:00~~23:59:59" end type type em_2 from editmask within w_oa_workreminddef boolean visible = false integer x = 1915 integer y = 32 integer width = 389 integer height = 76 integer taborder = 40 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "none" borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "YYYY-MM-DD" boolean spin = true double increment = 1 string minmax = "1900-01-01~~2999-12-31" end type type cb_5 from commandbutton within w_oa_workreminddef boolean visible = false integer x = 2359 integer y = 88 integer width = 311 integer height = 80 integer taborder = 50 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "测试" end type event clicked;if f_oa_workremind_chkdate(string(dw_result.object.ChkTimeRule[1]),datetime(date(em_2.text),time(em_1.text)))then messagebox('',"时间符合") else messagebox('',"不合要求") end if end event type cbx_2 from checkbox within w_oa_workreminddef boolean visible = false integer x = 1431 integer y = 100 integer width = 265 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "反选" end type event clicked;cbx_2.checked=false cbx_1.checked=false long cnt for cnt=1 to dw_list.rowcount() if dw_list.object.selected[cnt]=1 then dw_list.object.selected[cnt]=0 else dw_list.object.selected[cnt]=1 end if next end event event constructor;this.BackColor=14215660 end event type cbx_1 from checkbox within w_oa_workreminddef boolean visible = false integer x = 1170 integer y = 100 integer width = 224 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "全选" end type event clicked;long cnt,curState if cbx_1.checked then curstate=1 else curState=0 end if for cnt=1 to dw_list.rowcount() dw_list.object.selected[cnt]=curState next end event event constructor;this.BackColor=14215660 end event type cb_4 from uo_imflatbutton within w_oa_workreminddef integer width = 165 integer height = 172 integer taborder = 40 string text = "刷新" string normalpicname = "refresh.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;dw_type.retrieve() //dw_type.setRow(1) end event type dw_type from datawindow within w_oa_workreminddef integer y = 188 integer width = 1083 integer height = 2040 integer taborder = 40 string title = "none" string dataobject = "dw_oa_remind_modlist" boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;if ib_edit then IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN RETURN else ib_edit=false wf_refresh() END IF end if if currentrow > 0 then this.selectrow(0, false) this.setrow(currentrow) this.selectrow(currentrow, true) end if cbx_1.checked=false parent.triggerevent('ue_retrieve_list') //is_curMOD=dw_type.object.ModuleName[currentrow] //dw_list.retrieve(is_curMOD) end event event rowfocuschanging;IF ib_edit THEN return 1 end event event clicked; if row > 0 then this.selectrow(0, false) this.setrow(row) this.selectrow(row, true) end if end event type dw_result from datawindow within w_oa_workreminddef integer x = 1097 integer y = 764 integer width = 2491 integer height = 1472 integer taborder = 40 string title = "none" string dataobject = "dw_oa_remainddef_ff" boolean livescroll = true borderstyle borderstyle = stylelowered! end type event itemchanged; string name long id if dwo.name="funcid" then id=long(data) select menuname into :name from sys_func_pwr where mainid = :id; dw_result.object.winname[1]=name dw_result.accepttext() elseif dwo.name="winname" then name=data select mainid into :id from sys_func_pwr where menuname = :name; dw_result.object.funcid[1]=id dw_result.accepttext() end if end event event doubleclicked;String ls_chkRule String ls_tag ls_tag = "!" IF ib_edit THEN IF dwo.Name = "chktimedir" THEN s_oa_workremind_timetype ins_parm ins_parm = wf_releasetimetype(String(dw_result.Object.chktimeRule[1])) OpenWithParm(w_oa_workremind_detonate,ins_parm) s_oa_workremind_timetype ins_timetype ins_timetype = Message.PowerObjectParm IF NOT IsNull(ins_timetype) THEN dw_result.Object.chktimedir[1] = ins_timetype.direction ls_chkRule = ins_timetype.checkType+ls_tag ls_chkRule += ins_timetype.oncedate+ls_tag ls_chkRule += ins_timetype.oncetime+ls_tag ls_chkRule += ins_timetype.IntervalType+ls_tag ls_chkRule += ins_timetype.Interval+ls_tag ls_chkRule += ins_timetype.freType+ls_tag ls_chkRule += ins_timetype.fre+ls_tag ls_chkRule += ins_timetype.startDate dw_result.Object.chktimeRule[1] = ls_chkRule END IF END IF END IF end event type dw_list from datawindow within w_oa_workreminddef integer x = 1097 integer y = 192 integer width = 2496 integer height = 560 integer taborder = 30 string title = "none" string dataobject = "dw_oa_remainddef" boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged; if currentrow > 0 then this.selectrow(0, false) this.setrow(currentrow) this.selectrow(currentrow, true) end if parent.triggerevent('ue_retrieve_result') end event event rowfocuschanging;IF ib_edit THEN return 1 end event event clicked;if row > 0 then this.selectrow(0, false) this.setrow(row) this.selectrow(row, true) il_curid = Long(dw_list.Object.WrmID[row]) dw_result.Retrieve(il_curid) end if end event type ln_bar2 from line within w_oa_workreminddef long linecolor = 16777215 integer linethickness = 4 integer beginy = 184 integer endx = 3323 integer endy = 184 end type type ln_bar from line within w_oa_workreminddef long linecolor = 268435456 integer linethickness = 4 integer beginy = 180 integer endx = 3323 integer endy = 180 end type type r_bar from rectangle within w_oa_workreminddef long linecolor = 16777215 long fillcolor = 1073741824 integer x = 1737 integer width = 73 integer height = 172 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_bar2.beginy - 5 this.width=ln_bar2.endx end event type pipeline_1 from pipeline within w_oa_workreminddef descriptor "pb_nvo" = "true" end type on pipeline_1.create call super::create TriggerEvent( this, "constructor" ) end on on pipeline_1.destroy TriggerEvent( this, "destructor" ) call super::destroy end on