$PBExportHeader$w_oa_workreminduser.srw forward global type w_oa_workreminduser from window end type type cb_5 from uo_imflatbutton within w_oa_workreminduser end type type cb_2 from uo_imflatbutton within w_oa_workreminduser end type type cb_exit from uo_imflatbutton within w_oa_workreminduser end type type dw_list from datawindow within w_oa_workreminduser end type type tv_1 from datawindow within w_oa_workreminduser end type type cbx_2 from checkbox within w_oa_workreminduser end type type cbx_1 from checkbox within w_oa_workreminduser end type type cb_1 from uo_imflatbutton within w_oa_workreminduser end type type r_bar from rectangle within w_oa_workreminduser end type type ln_bar2 from line within w_oa_workreminduser end type type ln_bar from line within w_oa_workreminduser end type end forward global type w_oa_workreminduser from window integer width = 3611 integer height = 2380 boolean titlebar = true string title = "工作提醒用户订阅" boolean controlmenu = true boolean minbox = true windowtype windowtype = popup! long backcolor = 67108864 string icon = "AppIcon!" boolean center = true cb_5 cb_5 cb_2 cb_2 cb_exit cb_exit dw_list dw_list tv_1 tv_1 cbx_2 cbx_2 cbx_1 cbx_1 cb_1 cb_1 r_bar r_bar ln_bar2 ln_bar2 ln_bar ln_bar end type global w_oa_workreminduser w_oa_workreminduser type variables string is_curmod='' long il_curid=-1 uo_oa_workremind u_wrm s_wrm_right user_remindRight[] boolean ib_edit=false string is_cansee end variables forward prototypes public subroutine wf_refresh () end prototypes public subroutine wf_refresh ();if ib_edit then dw_list.setTabOrder("selected",10) cbx_1.enabled=true cbx_2.enabled=true cb_1.enabled=true cb_2.text="放弃" cbx_1.checked=false cbx_2.checked=false cb_2.normalpicname = 'undo.bmp' else dw_list.setTabOrder("selected",0) cbx_1.enabled=false cbx_2.enabled=false cb_1.enabled=false cb_2.text="修改" cb_2.normalpicname = 'open.bmp' 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 on w_oa_workreminduser.create this.cb_5=create cb_5 this.cb_2=create cb_2 this.cb_exit=create cb_exit this.dw_list=create dw_list this.tv_1=create tv_1 this.cbx_2=create cbx_2 this.cbx_1=create cbx_1 this.cb_1=create cb_1 this.r_bar=create r_bar this.ln_bar2=create ln_bar2 this.ln_bar=create ln_bar this.Control[]={this.cb_5,& this.cb_2,& this.cb_exit,& this.dw_list,& this.tv_1,& this.cbx_2,& this.cbx_1,& this.cb_1,& this.r_bar,& this.ln_bar2,& this.ln_bar} end on on w_oa_workreminduser.destroy destroy(this.cb_5) destroy(this.cb_2) destroy(this.cb_exit) destroy(this.dw_list) destroy(this.tv_1) destroy(this.cbx_2) destroy(this.cbx_1) destroy(this.cb_1) destroy(this.r_bar) destroy(this.ln_bar2) destroy(this.ln_bar) end on event resize;ln_bar.EndX = THIS.Width ln_bar2.EndX = THIS.Width r_bar.Width = ln_bar2.EndX //long width1,height1 //width1 = width - 118 //height1 =height - 400 //tv_1.height=height1 // //dw_list.width=width1 - tv_1.x - tv_1.width - 2 //dw_list.height=height1 //dw_list.x=tv_1.x+tv_1.width+10 //dw_list.y=tv_1.y dw_list.X = tv_1.X + tv_1.Width + 10 dw_list.Width = THIS.Width - dw_list.X - 40 tv_1.Height = THIS.Height - tv_1.Y - 140 dw_list.Height = tv_1.Height end event event open;String ls_userid = publ_operator String ls_right,arg_msg Long ll_wrmid Long cnt_wrm = 0,cnt dw_list.SetTabOrder("selected",0) tv_1.SetTrans(sqlca) dw_list.SetTrans(sqlca) u_wrm = CREATE uo_oa_workremind //获取用户订阅列表 IF NOT u_wrm.uf_get_userworkremind(REF ls_right,publ_userid,REF arg_msg) THEN MessageBox('',arg_msg) RETURN END IF //得到用户可视订阅列 IF NOT u_wrm.uf_get_Cansee(publ_userid,REF is_cansee,REF arg_msg) THEN MessageBox('',arg_msg) RETURN END IF String list[] f_oa_workremind_splitstr(is_cansee,",",REF list) //取提醒定义表的提醒id列 //declare cr cursor for //select wrmid //from oa_workreminddef //where wrmid in (:is_cansee); //open cr; //fetch cr into :ll_wrmid; FOR cnt = 1 TO UpperBound(list) cnt_wrm++ user_remindRight[cnt_wrm].wrmid = Long(list[cnt]) user_remindRight[cnt_wrm].Selected = 0 // fetch cr into :ll_wrmid; NEXT //close cr; IF ls_right <> '' AND cnt_wrm <> 0 THEN FOR cnt = 1 TO cnt_wrm String ls_curWrmid ls_curWrmid = String(user_remindRight[cnt].wrmid) IF Pos(ls_right,ls_curWrmid) <> 0 THEN user_remindRight[cnt].Selected = 1 END IF NEXT END IF IF is_cansee <> "" THEN tv_1.Retrieve(is_cansee) // dw_list.retrieve( is_curmod , is_cansee ) //f_oa_workremind_retrieve_list(ref dw_list,is_cansee,is_curmod) // f_oa_workremind_setRight(user_remindRight,dw_list) END IF end event type cb_5 from uo_imflatbutton within w_oa_workreminduser integer x = 37 integer width = 169 integer height = 172 integer taborder = 10 string text = "刷新" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; f_oa_workremind_retrieve_list(REF dw_list,is_cansee,is_curMOD) f_oa_workremind_setRight(user_remindRight,dw_list) end event type cb_2 from uo_imflatbutton within w_oa_workreminduser integer x = 379 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 end if ib_edit=not ib_edit wf_refresh() end event type cb_exit from uo_imflatbutton within w_oa_workreminduser integer x = 571 integer width = 165 integer height = 172 integer taborder = 20 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 dw_list from datawindow within w_oa_workreminduser integer x = 1330 integer y = 184 integer width = 2258 integer height = 1344 integer taborder = 30 string title = "工作提醒用户订阅" 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) Long ll_curid ll_curid = Long(dw_list.Object.WrmID[currentrow]) il_curid = ll_curid END IF end event event clicked; if row > 0 then this.selectrow(0, false) this.setrow(row) this.selectrow(row, true) end if end event type tv_1 from datawindow within w_oa_workreminduser integer y = 184 integer width = 1326 integer height = 1348 integer taborder = 20 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 END IF END IF if currentrow > 0 then this.selectrow(0, false) this.setrow(currentrow) this.selectrow(currentrow, true) end if ib_edit = FALSE wf_refresh() is_curMOD = tv_1.Object.ModuleName[currentrow] //dw_list.retrieve(is_curMOD,is_cansee) //f_oa_workremind_retrieve_list(REF dw_list,is_cansee,is_curMOD) //f_oa_workremind_setRight(user_remindRight,dw_list) cb_5.triggerevent(clicked!) end event event clicked; if row > 0 then this.selectrow(0, false) this.setrow(row) this.selectrow(row, true) end if end event event rowfocuschanging;IF ib_edit THEN return 1 end event type cbx_2 from checkbox within w_oa_workreminduser integer x = 1074 integer y = 72 integer width = 238 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 boolean enabled = false 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_workreminduser integer x = 814 integer y = 72 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 = 134217739 boolean enabled = false 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_1 from uo_imflatbutton within w_oa_workreminduser integer x = 206 integer width = 174 integer height = 172 integer taborder = 10 boolean enabled = false string text = "保存" string normalpicname = "SAVE.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;long cnt string new_right[]={'',''},arg_msg //复制一份订阅表 for cnt=1 to dw_list.rowcount() if dw_list.object.selected[cnt]=1 then new_right[1]+=string(dw_list.object.wrmid[cnt])+"," end if new_right[2]+=string(dw_list.object.wrmid[cnt])+"," next f_oa_workremind_saveright(new_right,ref user_remindRight) string new_right1='' for cnt=1 to UpperBound(user_remindRight) if user_remindRight[cnt].selected=1 then new_right1+= string(user_remindRight[cnt].wrmid)+"," end if next ib_edit=false wf_refresh() //dw_list.retrieve(is_curmod) //f_oa_workremind_retrieve_list(ref dw_list,is_cansee,is_curmod) //f_oa_workremind_setRight(user_remindRight,ref dw_list) cb_5.triggerevent(clicked!) if not u_wrm.uf_add_userworkremind(new_right1,publ_userid,arg_msg) then messagebox('',arg_msg) end if end event type r_bar from rectangle within w_oa_workreminduser long linecolor = 16777215 long fillcolor = 1073741824 integer x = 1330 integer y = 8 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 ln_bar2 from line within w_oa_workreminduser long linecolor = 16777215 integer linethickness = 4 integer beginy = 180 integer endx = 3323 integer endy = 180 end type type ln_bar from line within w_oa_workreminduser long linecolor = 268435456 integer linethickness = 4 integer beginy = 176 integer endx = 3323 integer endy = 176 end type