123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698 |
- $PBExportHeader$w_msg_send.srw
- forward
- global type w_msg_send from w_publ_base
- end type
- type sle_msgtitle from singlelineedit within w_msg_send
- end type
- type st_2 from statictext within w_msg_send
- end type
- type mle_objdpm from multilineedit within w_msg_send
- end type
- type dw_1 from u_dw_rbtnfilter within w_msg_send
- end type
- type rb_usergrp from radiobutton within w_msg_send
- end type
- type rb_user from radiobutton within w_msg_send
- end type
- type cb_que from uo_imflatbutton within w_msg_send
- end type
- type cb_1 from uo_imflatbutton within w_msg_send
- end type
- type st_1 from statictext within w_msg_send
- end type
- type sle_billcode from singlelineedit within w_msg_send
- end type
- type st_3 from statictext within w_msg_send
- end type
- type dw_msg_fj from datawindow within w_msg_send
- end type
- type uo_html from uo_html_editor within w_msg_send
- end type
- type ln_bar from line within w_msg_send
- end type
- type ln_bar2 from line within w_msg_send
- end type
- type r_bar from rectangle within w_msg_send
- end type
- end forward
- global type w_msg_send from w_publ_base
- integer x = 23
- integer y = 24
- integer width = 3502
- integer height = 2468
- string title = "请输入新消息"
- event ue_fj_del ( )
- event ue_fj_del_all ( )
- event ue_fj_add_link ( )
- event ue_fj_add ( )
- 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
- st_1 st_1
- sle_billcode sle_billcode
- st_3 st_3
- dw_msg_fj dw_msg_fj
- uo_html uo_html
- ln_bar ln_bar
- ln_bar2 ln_bar2
- r_bar r_bar
- end type
- global w_msg_send w_msg_send
- 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
- event ue_fj_del();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
- event ue_fj_del_all();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
- event ue_fj_add_link();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
- event ue_fj_add();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
- 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,1) > 0 and len(tmp_objdpm) = len(arg_objdpm) then return 0
- if pos(tmp_objdpm,';'+arg_objdpm+';',1) > 0 then return 0
- if pos(tmp_objdpm,arg_objdpm+';',1) > 0 then return 0
- if pos(tmp_objdpm,';'+arg_objdpm,1) > 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_msg_send.create
- int iCurrent
- call super::create
- 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.st_1=create st_1
- this.sle_billcode=create sle_billcode
- this.st_3=create st_3
- this.dw_msg_fj=create dw_msg_fj
- this.uo_html=create uo_html
- this.ln_bar=create ln_bar
- this.ln_bar2=create ln_bar2
- this.r_bar=create r_bar
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.sle_msgtitle
- this.Control[iCurrent+2]=this.st_2
- this.Control[iCurrent+3]=this.mle_objdpm
- this.Control[iCurrent+4]=this.dw_1
- this.Control[iCurrent+5]=this.rb_usergrp
- this.Control[iCurrent+6]=this.rb_user
- this.Control[iCurrent+7]=this.cb_que
- this.Control[iCurrent+8]=this.cb_1
- this.Control[iCurrent+9]=this.st_1
- this.Control[iCurrent+10]=this.sle_billcode
- this.Control[iCurrent+11]=this.st_3
- this.Control[iCurrent+12]=this.dw_msg_fj
- this.Control[iCurrent+13]=this.uo_html
- this.Control[iCurrent+14]=this.ln_bar
- this.Control[iCurrent+15]=this.ln_bar2
- this.Control[iCurrent+16]=this.r_bar
- end on
- on w_msg_send.destroy
- call super::destroy
- 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.st_1)
- destroy(this.sle_billcode)
- destroy(this.st_3)
- destroy(this.dw_msg_fj)
- destroy(this.uo_html)
- destroy(this.ln_bar)
- destroy(this.ln_bar2)
- destroy(this.r_bar)
- 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')
- 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
- uo_html.uf_sethtml('<DIV><FONT face=Verdana color=#000080 size=2> </FONT></DIV><DIV><FONT face=Verdana color=#000080 size=2> </FONT></DIV><DIV><FONT face=Verdana color=#000080 size=2> </FONT></DIV><HR color=#b5c4df SIZE=1>' + s_msg.msg)
- 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
- event resize;call super::resize;if newwidth < 3493 then this.width = 3493
- if newheight < 2388 then this.height = 2388
- ln_bar.endx = this.width
- ln_bar2.endx = this.width
- r_bar.width = this.width
- dw_1.x = this.width - dw_1.width - 40
- rb_user.x = dw_1.x + 50
- rb_usergrp.x = dw_1.x + 300
- mle_objdpm.width = dw_1.x - mle_objdpm.x
- sle_msgtitle.width = mle_objdpm.width
- uo_html.width = dw_1.x - uo_html.x
- dw_msg_fj.width = uo_html.width
- dw_1.height = this.height - dw_1.y - 140
- uo_html.height = this.height - uo_html.y - dw_msg_fj.height - 140
- dw_msg_fj.y = uo_html.y + uo_html.height
- end event
- type cb_func from w_publ_base`cb_func within w_msg_send
- 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_msg_send
- integer x = 594
- integer width = 151
- integer height = 164
- integer taborder = 110
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type sle_msgtitle from singlelineedit within w_msg_send
- event key pbm_keydown
- integer x = 256
- integer y = 504
- integer width = 2546
- 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_msg_send
- integer x = 23
- integer y = 520
- 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_msg_send
- event key pbm_dwnkey
- integer x = 256
- integer y = 200
- integer width = 2542
- 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_msg_send
- integer x = 2821
- integer y = 260
- integer width = 658
- integer height = 1764
- integer taborder = 130
- boolean bringtotop = true
- string dataobject = "dw_objdpm_user"
- boolean vscrollbar = true
- boolean rbutton_filter_use = 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_msg_send
- integer x = 3118
- integer y = 196
- 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_msg_send
- integer x = 2871
- integer y = 196
- 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_msg_send
- integer width = 398
- integer height = 164
- integer taborder = 60
- string text = "发送[Ctrl+s]"
- string normalpicname = "email_view2.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- 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(uo_html.uf_gethtml( ))
- 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_msg_send
- integer x = 398
- integer width = 197
- integer height = 164
- integer taborder = 70
- boolean bringtotop = true
- string text = "附件"
- string normalpicname = "email_fj.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,ls_level
- menustr = "Text=添附件~tEvent=ue_fj_add"
- menustr = menustr + "|" + "Text=添链接~tEvent=ue_fj_add_link"
- menustr = menustr + "|" + "Text=-"
- menustr = menustr + "|" + "Text=删条目~tEvent=ue_fj_del"
- menustr = menustr + "|" + "Text=清空~tEvent=ue_fj_del_all"
-
- 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 st_1 from statictext within w_msg_send
- integer x = 23
- integer y = 200
- 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_msg_send
- event key pbm_keydown
- integer x = 256
- integer y = 596
- integer width = 704
- 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_msg_send
- integer x = 23
- integer y = 612
- 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_msg_send
- integer y = 1668
- integer width = 2807
- integer height = 696
- 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
- event rbuttondown; m_Dfc_Control_PopupMenu dmPopupMenu
- String menustr,ls_level
- menustr = "Text=添附件~tEvent=ue_fj_add"
- menustr = menustr + "|" + "Text=添链接~tEvent=ue_fj_add_link"
- menustr = menustr + "|" + "Text=-"
- if row > 0 then
- this.scrolltorow(row)
- menustr = menustr + "|" + "Text=删条目~tEvent=ue_fj_del"
- end if
- menustr = menustr + "|" + "Text=清空~tEvent=ue_fj_del_all"
-
- 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
- event rowfocuschanged;this.selectrow(0, false)
- if currentrow > 0 then
- this.selectrow(currentrow, true)
- end if
- end event
- type uo_html from uo_html_editor within w_msg_send
- integer y = 696
- integer width = 2807
- integer height = 912
- integer taborder = 60
- boolean bringtotop = true
- end type
- on uo_html.destroy
- call uo_html_editor::destroy
- end on
- type ln_bar from line within w_msg_send
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 172
- integer endx = 3200
- integer endy = 172
- end type
- type ln_bar2 from line within w_msg_send
- long linecolor = 16777215
- integer linethickness = 4
- integer beginx = 14
- integer beginy = 176
- integer endx = 3278
- integer endy = 176
- end type
- type r_bar from rectangle within w_msg_send
- long linecolor = 16777215
- integer linethickness = 4
- long fillcolor = 1073741824
- integer x = 2126
- integer y = 40
- integer width = 87
- 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
|