$PBExportHeader$w_new_admsg.srw forward global type w_new_admsg from w_publ_base end type type mle_msg from multilineedit within w_new_admsg end type type sle_msgtitle from singlelineedit within w_new_admsg end type type st_2 from statictext within w_new_admsg end type type mle_objdpm from multilineedit within w_new_admsg end type type dw_1 from u_dw_rbtnfilter within w_new_admsg end type type rb_usergrp from radiobutton within w_new_admsg end type type rb_user from radiobutton within w_new_admsg end type type cb_que from uo_imflatbutton within w_new_admsg end type type cb_1 from uo_imflatbutton within w_new_admsg end type type cb_6 from uo_imflatbutton within w_new_admsg end type type cb_2 from uo_imflatbutton within w_new_admsg end type type cb_3 from uo_imflatbutton within w_new_admsg end type type st_1 from statictext within w_new_admsg end type type sle_billcode from singlelineedit within w_new_admsg end type type st_3 from statictext within w_new_admsg end type type st_4 from statictext within w_new_admsg end type type dw_msg_fj from datawindow within w_new_admsg end type type st_5 from statictext within w_new_admsg end type type st_6 from statictext within w_new_admsg end type end forward global type w_new_admsg from w_publ_base integer x = 23 integer y = 24 integer width = 2853 integer height = 2072 string title = "请输入新消息" mle_msg mle_msg sle_msgtitle sle_msgtitle st_2 st_2 mle_objdpm mle_objdpm dw_1 dw_1 rb_usergrp rb_usergrp rb_user rb_user cb_que cb_que cb_1 cb_1 cb_6 cb_6 cb_2 cb_2 cb_3 cb_3 st_1 st_1 sle_billcode sle_billcode st_3 st_3 st_4 st_4 dw_msg_fj dw_msg_fj st_5 st_5 st_6 st_6 end type global w_new_admsg w_new_admsg type variables uo_transmsg uo_msg Blob ins_fjdata[] //附件转换为的blob Long ins_max_fj = 0//附件数目 end variables forward prototypes public function integer wf_addobjdpm (string arg_objdpm) public function integer wf_dw () end prototypes public function integer wf_addobjdpm (string arg_objdpm);string tmp_objdpm tmp_objdpm=trim(mle_objdpm.text) if tmp_objdpm = '' then mle_objdpm.text=arg_objdpm else if pos(tmp_objdpm,arg_objdpm) > 0 and len(tmp_objdpm) = len(arg_objdpm) then return 0 if pos(tmp_objdpm,';'+arg_objdpm+';') > 0 then return 0 if pos(tmp_objdpm,arg_objdpm+';') > 0 then return 0 if pos(tmp_objdpm,';'+arg_objdpm) > 0 then return 0 mle_objdpm.text=tmp_objdpm + ';'+arg_objdpm end if return 1 end function public function integer wf_dw ();dw_1.setredraw(false) if rb_user.checked then dw_1.dataobject='dw_objdpm_user' else dw_1.dataobject='dw_objdpm_usergrp' end if dw_1.settransobject(sqlca) dw_1.retrieve(sys_scid) dw_1.setredraw(true) return 1 end function on w_new_admsg.create int iCurrent call super::create this.mle_msg=create mle_msg this.sle_msgtitle=create sle_msgtitle this.st_2=create st_2 this.mle_objdpm=create mle_objdpm this.dw_1=create dw_1 this.rb_usergrp=create rb_usergrp this.rb_user=create rb_user this.cb_que=create cb_que this.cb_1=create cb_1 this.cb_6=create cb_6 this.cb_2=create cb_2 this.cb_3=create cb_3 this.st_1=create st_1 this.sle_billcode=create sle_billcode this.st_3=create st_3 this.st_4=create st_4 this.dw_msg_fj=create dw_msg_fj this.st_5=create st_5 this.st_6=create st_6 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.mle_msg this.Control[iCurrent+2]=this.sle_msgtitle this.Control[iCurrent+3]=this.st_2 this.Control[iCurrent+4]=this.mle_objdpm this.Control[iCurrent+5]=this.dw_1 this.Control[iCurrent+6]=this.rb_usergrp this.Control[iCurrent+7]=this.rb_user this.Control[iCurrent+8]=this.cb_que this.Control[iCurrent+9]=this.cb_1 this.Control[iCurrent+10]=this.cb_6 this.Control[iCurrent+11]=this.cb_2 this.Control[iCurrent+12]=this.cb_3 this.Control[iCurrent+13]=this.st_1 this.Control[iCurrent+14]=this.sle_billcode this.Control[iCurrent+15]=this.st_3 this.Control[iCurrent+16]=this.st_4 this.Control[iCurrent+17]=this.dw_msg_fj this.Control[iCurrent+18]=this.st_5 this.Control[iCurrent+19]=this.st_6 end on on w_new_admsg.destroy call super::destroy destroy(this.mle_msg) destroy(this.sle_msgtitle) destroy(this.st_2) destroy(this.mle_objdpm) destroy(this.dw_1) destroy(this.rb_usergrp) destroy(this.rb_user) destroy(this.cb_que) destroy(this.cb_1) destroy(this.cb_6) destroy(this.cb_2) destroy(this.cb_3) destroy(this.st_1) destroy(this.sle_billcode) destroy(this.st_3) destroy(this.st_4) destroy(this.dw_msg_fj) destroy(this.st_5) destroy(this.st_6) end on event close;f_setProfileString (sys_empid,this.classname(), "x",string(this.x)) f_setProfileString (sys_empid,this.classname(), "y",string(this.y)) end event event open;THIS.TriggerEvent('ue_before_open') //wf_movetocenter() s_admsg s_msg s_msg = Message.PowerObjectParm wf_dw() IF Integer(f_ProfileString (sys_empid,THIS.ClassName(), "x",String(THIS.X))) = 0 THEN THIS.X = 23 THIS.Y = 24 ELSE THIS.X = Integer(f_ProfileString (sys_empid,THIS.ClassName(), "x",String(THIS.X))) THIS.Y = Integer(f_ProfileString (sys_empid,THIS.ClassName(), "y",String(THIS.Y))) END IF IF s_msg.ifback = 1 THEN mle_objdpm.Text = s_msg.sendemp sle_billcode.Text = s_msg.billcode sle_msgtitle.Text = '回复:'+s_msg.msgtitle mle_msg.Text = '----------原始消息------'+'~r~n'+s_msg.msg +'~r~n'+'------------------------' +'~r~n' else sle_billcode.Text = s_msg.billcode END IF end event event key;if keydown(KeyControl!) and keydown(keyS!) then cb_que.triggerevent(clicked!) return 1 end if end event type cb_func from w_publ_base`cb_func within w_new_admsg boolean visible = false integer x = 14 integer y = 1092 integer width = 133 integer taborder = 10 boolean enabled = false string text = "" end type type cb_exit from w_publ_base`cb_exit within w_new_admsg integer x = 1696 integer y = 1864 integer taborder = 110 string text = "取消" end type type mle_msg from multilineedit within w_new_admsg integer x = 251 integer y = 464 integer width = 1915 integer height = 912 integer taborder = 50 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean vscrollbar = true integer limit = 1000 borderstyle borderstyle = stylelowered! end type event modified;keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab return 1 end event type sle_msgtitle from singlelineedit within w_new_admsg event key pbm_keydown integer x = 251 integer y = 296 integer width = 1915 integer height = 84 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type event modified;keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab return 1 end event type st_2 from statictext within w_new_admsg integer x = 23 integer y = 312 integer width = 224 integer height = 48 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 = "标题:" alignment alignment = right! boolean focusrectangle = false end type type mle_objdpm from multilineedit within w_new_admsg event key pbm_dwnkey integer x = 251 integer width = 1915 integer height = 296 integer taborder = 20 boolean bringtotop = true integer textsize = -11 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean vscrollbar = true boolean displayonly = true borderstyle borderstyle = stylelowered! end type type dw_1 from u_dw_rbtnfilter within w_new_admsg integer x = 2176 integer y = 76 integer width = 658 integer height = 1764 integer taborder = 130 boolean bringtotop = true string dataobject = "dw_objdpm_user" boolean vscrollbar = true end type event rowfocuschanged;if currentrow<=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end event event doubleclicked;if row<=0 then return string ls_objdpm if rb_user.checked then ls_objdpm=dw_1.object.username[row] else ls_objdpm=dw_1.object.usergroup[row] end if wf_addobjdpm(ls_objdpm) end event type rb_usergrp from radiobutton within w_new_admsg integer x = 2473 integer y = 12 integer width = 247 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "用户组" end type event clicked;wf_dw() end event type rb_user from radiobutton within w_new_admsg integer x = 2226 integer y = 12 integer width = 247 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "用户" boolean checked = true end type event clicked;wf_dw() end event type cb_que from uo_imflatbutton within w_new_admsg integer x = 850 integer y = 1864 integer width = 439 integer height = 96 integer taborder = 60 string text = "发送[Ctrl+s]" end type event clicked;call super::clicked;String ls_objdpm,ls_msgtitle,ls_s_msg,arg_msg,ls_billcode Boolean ifcommit Long ls_i ls_objdpm = Trim(mle_objdpm.Text) ls_msgtitle = Trim(sle_msgtitle.Text) ls_s_msg = Trim(mle_msg.Text) ls_billcode = Trim(sle_billcode.Text) IF ins_max_fj = 0 THEN ifcommit = TRUE ELSE ifcommit = FALSE END IF IF uo_msg.f_create_admsg(sys_empid,publ_operator,ls_objdpm,ls_msgtitle,ls_s_msg,arg_msg,0,ls_billcode,ifcommit) = 0 THEN MessageBox('系统提示','消息发送失败{'+arg_msg+'}') RETURN END IF FOR ls_i = 1 TO ins_max_fj IF ls_i = ins_max_fj THEN ifcommit = TRUE ELSE ifcommit = FALSE END IF IF uo_msg.f_save_fj(uo_msg.uo_msgid,dw_msg_fj.Object.fjname[ls_i],ins_fjdata[ls_i],dw_msg_fj.Object.fjsize[ls_i],dw_msg_fj.Object.fjtype[ls_i],arg_msg,ifcommit) = 0 THEN MessageBox('系统提示','消息发送失败{'+arg_msg+'}') RETURN END IF NEXT Close(PARENT) end event type cb_1 from uo_imflatbutton within w_new_admsg integer x = 5 integer y = 1516 integer width = 247 integer height = 76 integer taborder = 70 boolean bringtotop = true string text = "添附件" end type event clicked;call super::clicked;Integer i Long ls_i,ls_j,ls_newrow,ls_filesize Blob ls_filedata String Pathname,ls_filename String Filename[],errmsg i = GetFileSaveName("选择附件",Pathname,Filename[],"*","程序文件,*.*") IF i = 1 AND Trim(Pathname) <> '' THEN FOR ls_i = 1 TO UpperBound(Filename) IF UpperBound(Filename) = 1 THEN ls_filename = Pathname ELSE ls_filename = Pathname + '\'+Filename[ls_i] END IF IF dw_msg_fj.Find( 'fjpath='+"'"+ls_filename+"'", 0, dw_msg_fj.RowCount()) > 0 THEN CONTINUE; END IF IF f_filetoblob(ls_filename,ls_filedata,errmsg) = 0 THEN MessageBox('系统提示',errmsg) RETURN END IF ls_filesize = Len(ls_filedata) ls_newrow = dw_msg_fj.InsertRow(0) dw_msg_fj.Object.fjname[ls_newrow] = Filename[ls_i] dw_msg_fj.Object.fjpath[ls_newrow] = ls_filename dw_msg_fj.Object.fjsize[ls_newrow] = ls_filesize ins_max_fj++ ins_fjdata[ins_max_fj] = ls_filedata NEXT END IF end event type cb_6 from uo_imflatbutton within w_new_admsg integer x = 5 integer y = 1596 integer width = 247 integer height = 76 integer taborder = 120 boolean bringtotop = true string text = "添链接" end type event clicked;call super::clicked;s_inputbox s_ipb String ls_linkpath = '' Long ls_newrow s_ipb.Title = '请输入超链接路径' OpenWithParm(w_inputbox,s_ipb) ls_linkpath = Message.StringParm IF Trim(ls_linkpath) = '' THEN RETURN END IF ls_newrow = dw_msg_fj.InsertRow(0) dw_msg_fj.Object.fjname[ls_newrow] = ls_linkpath dw_msg_fj.Object.fjpath[ls_newrow] = ls_linkpath dw_msg_fj.Object.fjtype[ls_newrow] = 1 //0为文件,1为超链接 ins_max_fj++ ins_fjdata[ins_max_fj] = Blob(ls_linkpath) end event type cb_2 from uo_imflatbutton within w_new_admsg integer x = 5 integer y = 1676 integer width = 247 integer height = 76 integer taborder = 80 boolean bringtotop = true string text = "删条目" end type event clicked;call super::clicked;Long lrow Long ls_i,ls_j = 0 Blob ls_filedata[] lrow = dw_msg_fj.GetRow() IF lrow <= 0 THEN MessageBox('系统提示','请先选择目标!') RETURN END IF FOR ls_i = 1 To (lrow - 1) ls_j++ ls_filedata[ls_j] = ins_fjdata[ls_i] NEXT FOR ls_i = (lrow + 1) TO UpperBound(ins_fjdata) ls_j++ ls_filedata[ls_j] = ins_fjdata[ls_i] NEXT ins_fjdata[] = ls_filedata[] ins_max_fj = UpperBound(ins_fjdata) dw_msg_fj.DeleteRow(lrow) end event type cb_3 from uo_imflatbutton within w_new_admsg integer x = 5 integer y = 1756 integer width = 247 integer height = 76 integer taborder = 100 boolean bringtotop = true string text = "清空" end type event clicked;call super::clicked;Long ls_i Blob ls_null[] ins_fjdata[] = ls_null[] ins_max_fj = 0 IF dw_msg_fj.RowCount() > 0 THEN FOR ls_i = dw_msg_fj.RowCount() TO 1 STEP -1 dw_msg_fj.DeleteRow(ls_i) NEXT END IF end event type st_1 from statictext within w_new_admsg integer x = 23 integer y = 124 integer width = 224 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "收件人:" alignment alignment = right! boolean focusrectangle = false end type type sle_billcode from singlelineedit within w_new_admsg event key pbm_keydown integer x = 251 integer y = 380 integer width = 1915 integer height = 84 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type event modified;keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab return 1 end event type st_3 from statictext within w_new_admsg integer x = 23 integer y = 396 integer width = 224 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "相关号:" alignment alignment = right! boolean focusrectangle = false end type type st_4 from statictext within w_new_admsg integer x = 23 integer y = 916 integer width = 224 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "内容:" alignment alignment = right! boolean focusrectangle = false end type type dw_msg_fj from datawindow within w_new_admsg integer x = 251 integer y = 1376 integer width = 1915 integer height = 464 integer taborder = 90 boolean bringtotop = true string dataobject = "dw_msg_fj" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type type st_5 from statictext within w_new_admsg integer x = 23 integer y = 1392 integer width = 224 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "附件:" alignment alignment = right! boolean focusrectangle = false end type type st_6 from statictext within w_new_admsg integer x = 23 integer y = 1448 integer width = 224 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "链接:" alignment alignment = right! boolean focusrectangle = false end type