123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- $PBExportHeader$w_email_signmanage.srw
- forward
- global type w_email_signmanage from window
- end type
- type cb_5 from commandbutton within w_email_signmanage
- end type
- type cb_4 from picturebutton within w_email_signmanage
- end type
- type cb_3 from commandbutton within w_email_signmanage
- end type
- type cb_2 from commandbutton within w_email_signmanage
- end type
- type cb_1 from commandbutton within w_email_signmanage
- end type
- type uo_1 from uo_html_editor within w_email_signmanage
- end type
- type dw_1 from datawindow within w_email_signmanage
- end type
- type gb_1 from groupbox within w_email_signmanage
- end type
- type gb_2 from groupbox within w_email_signmanage
- end type
- type gb_3 from groupbox within w_email_signmanage
- end type
- end forward
- global type w_email_signmanage from window
- integer width = 3433
- integer height = 1328
- boolean titlebar = true
- string title = "签名管理"
- boolean controlmenu = true
- boolean minbox = true
- boolean maxbox = true
- boolean resizable = true
- long backcolor = 67108864
- string icon = "AppIcon!"
- boolean center = true
- cb_5 cb_5
- cb_4 cb_4
- cb_3 cb_3
- cb_2 cb_2
- cb_1 cb_1
- uo_1 uo_1
- dw_1 dw_1
- gb_1 gb_1
- gb_2 gb_2
- gb_3 gb_3
- end type
- global w_email_signmanage w_email_signmanage
- type variables
- uo_email_sign uo_sign
- transaction fj_tran
- boolean addnew=false
- int newid ,ll_currrow
- end variables
- forward prototypes
- public subroutine wf_save ()
- public function string of_globalreplace1 (string as_source, string as_old, string as_new)
- public function string of_globalreplace (string as_source, string as_old, string as_new)
- end prototypes
- public subroutine wf_save ();//
- end subroutine
- public function string of_globalreplace1 (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos
- as_source=trim(as_source)
- as_old=trim(as_old)
- ll_pos = Pos(as_source,as_old)
- IF ll_pos > 0 Then
- ll_oldlen = Len(as_old)
- ll_newlen = Len(as_new)
- as_source = Replace(as_source,ll_pos,ll_oldlen,as_new)
- ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen)
- END IF
- RETURN as_source
- end function
- public function string of_globalreplace (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos
- as_source=trim(as_source)
- as_old=trim(as_old)
- ll_pos = Pos(as_source,as_old)
- IF ll_pos > 0 Then
- ll_oldlen = Len(as_old)
- ll_newlen = Len(as_new)
- DO WHILE ll_pos > 0
- as_source = Replace(as_source,ll_pos,ll_oldlen,as_new)
- ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen)
- LOOP
- END IF
- RETURN as_source
- end function
- on w_email_signmanage.create
- this.cb_5=create cb_5
- this.cb_4=create cb_4
- this.cb_3=create cb_3
- this.cb_2=create cb_2
- this.cb_1=create cb_1
- this.uo_1=create uo_1
- this.dw_1=create dw_1
- this.gb_1=create gb_1
- this.gb_2=create gb_2
- this.gb_3=create gb_3
- this.Control[]={this.cb_5,&
- this.cb_4,&
- this.cb_3,&
- this.cb_2,&
- this.cb_1,&
- this.uo_1,&
- this.dw_1,&
- this.gb_1,&
- this.gb_2,&
- this.gb_3}
- end on
- on w_email_signmanage.destroy
- destroy(this.cb_5)
- destroy(this.cb_4)
- destroy(this.cb_3)
- destroy(this.cb_2)
- destroy(this.cb_1)
- destroy(this.uo_1)
- destroy(this.dw_1)
- destroy(this.gb_1)
- destroy(this.gb_2)
- destroy(this.gb_3)
- end on
- event open;
- uo_sign = Create uo_email_sign
- Long ll_ConnectionID
- String arg_msg
- IF sys_email_sqlca.DBHandle() > 0 THEN
- fj_tran = sys_email_sqlca
- ELSE
- MessageBox('系统提示','要使用邮件功能,请先定义邮件数据库')
- RETURN
- END IF
- uo_sign.uf_settrans(fj_tran)
- uo_sign.ownerid = publ_userid
- dw_1.SetTrans(fj_tran)
- dw_1.Retrieve(publ_userid)
- dw_1.SetRow(1)
- end event
- type cb_5 from commandbutton within w_email_signmanage
- integer x = 2903
- integer y = 1120
- integer width = 329
- integer height = 84
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "保存并退出"
- end type
- event clicked;String content,ls_msg
- Long row
- row = ll_currrow
- IF row = 0 Or dw_1.RowCount() < row THEN
- GOTO ext
- END IF
- content = uo_1.uf_gethtml()
- IF Pos(content,"<DIV id=signName") <> 0 THEN
- content = of_globalreplace1(content,"<DIV id=signName",'<DIV id=signName style="MARGIN-TOP: 0px; cellpadding: 0px; cellspacing: 0px" valign="top" height="100%" width="100%"><DIV ')
-
- content = content+"</DIV>"
-
- END IF
- uo_sign.signcontent = content
- uo_sign.id = dw_1.Object.id[row]
- uo_sign.signname = dw_1.Object.signname[row]
- uo_sign.uf_save(Ref ls_msg)
- ext:
- Close(Parent)
- end event
- type cb_4 from picturebutton within w_email_signmanage
- integer x = 105
- integer y = 84
- integer width = 78
- integer height = 64
- integer taborder = 30
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string picturename = "delete.bmp"
- alignment htextalign = left!
- end type
- event clicked;long row,ll_id
- string ls_msg
- row=dw_1.getrow()
- uo_1.uf_sethtml("")
- if row=0 then
- return
- end if
- ll_id=dw_1.object.id[row]
- dw_1.deleterow(row)
- if uo_sign.uf_delete(ll_id,ref ls_msg)=0 then
- messagebox('',ls_msg)
- return
- end if
- uo_1.uf_sethtml("")
- addnew=false
- //dw_1.trigger event rowfocuschanged(dw_1.getrow())
- end event
- type cb_3 from commandbutton within w_email_signmanage
- integer x = 23
- integer y = 80
- integer width = 78
- integer height = 68
- integer taborder = 30
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "+"
- end type
- event clicked;OpenWithParm(w_getname,'签名')
- String ls_name,ls_msg
- ls_name = Message.StringParm
- IF ls_name = '' THEN
- RETURN
- END IF
- addnew = True
- dw_1.trigger event rowfocuschanging(dw_1.getrow(),1)
- uo_sign.uf_reset()
- uo_sign.signname = ls_name
- uo_sign.uf_save(Ref ls_msg)
- uo_1.uf_sethtml(uo_sign.signcontent)
- addnew = False
- dw_1.Retrieve(publ_userid)
- ll_currrow=dw_1.rowcount()
- end event
- type cb_2 from commandbutton within w_email_signmanage
- integer x = 2510
- integer y = 1120
- integer width = 325
- integer height = 84
- integer taborder = 40
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "取消"
- end type
- event clicked;close(parent)
- end event
- type cb_1 from commandbutton within w_email_signmanage
- integer x = 2080
- integer y = 1120
- integer width = 329
- integer height = 84
- integer taborder = 30
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "保存"
- end type
- event clicked;String content,ls_msg
- Long row
- row = ll_currrow
- IF row = 0 or dw_1.rowcount() <row THEN
- GOTO ext
- end if
- content = uo_1.uf_gethtml()
- IF Pos(content,"<DIV id=signName") <> 0 THEN
- content=of_globalreplace1(content,"<DIV id=signName",'<DIV id=signName style="MARGIN-TOP: 0px; cellpadding: 0px; cellspacing: 0px" valign="top" height="100%" width="100%"><DIV ')
- content = content+"</DIV>"
-
- END IF
- uo_sign.signcontent = content
- uo_sign.id = dw_1.Object.id[row]
- uo_sign.signname = dw_1.Object.signname[row]
- uo_sign.uf_save(Ref ls_msg)
- ext:
- end event
- type uo_1 from uo_html_editor within w_email_signmanage
- integer x = 850
- integer y = 92
- integer width = 2510
- integer height = 960
- integer taborder = 30
- end type
- on uo_1.destroy
- call uo_html_editor::destroy
- end on
- type dw_1 from datawindow within w_email_signmanage
- integer x = 18
- integer y = 152
- integer width = 786
- integer height = 900
- integer taborder = 20
- string title = "none"
- string dataobject = "dw_email_signlist"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event doubleclicked;
- if row=0 then
- return
- end if
- string ls_signname,ls_msg
- ls_signname=this.object.signname[row]
- openwithparm(w_getname,ls_signname)
- ls_signname=message.stringparm
- if ls_signname='' then
- return
- end if
- uo_sign.signname=ls_signname
- if uo_sign.uf_save(ref ls_msg)=0 then
- messagebox('',ls_msg)
- end if
- end event
- event rowfocuschanged;//string content
- //content=uo_1.uf_gethtml()
- //uo_sign.signcontent=content
- string ls_msg
- //messagebox('',string(currentrow))
- if currentrow=0 then
- return
- end if
- ///保存之前内容
- ///保存之前内容
- newid=this.object.id[currentrow]
- if uo_sign.uf_set_sign(newid,publ_userid,ref ls_msg)=0 then
- messagebox('',ls_msg)
- return
- end if
- uo_1.uf_sethtml(uo_sign.signcontent)
- end event
- event rowfocuschanging;//String content,ls_msg
- //
- //IF currentrow = 0 THEN
- // RETURN
- //END IF
- //IF addnew THEN
- // content = uo_1.uf_gethtml()
- //
- ////IF Pos(content,"<DIV id=signName") = 0 and len(content)>200 THEN
- //// content=of_globalreplace1(content,"</DIV>","")
- //// content = left(content,Len(content) - 6)
- //// content = content+"</DIV></DIV>"
- ////
- ////END IF
- //
- // uo_sign.signcontent = content
- // uo_sign.id = This.Object.id[currentrow]
- // uo_sign.signname = This.Object.signname[currentrow]
- // uo_sign.uf_save(Ref ls_msg)
- //ELSE
- // addnew = True
- //END IF
- //
- //
- //
- //
- //
- end event
- event clicked;//string content
- //content=uo_1.uf_gethtml()
- //uo_sign.signcontent=content
- string ls_msg
- //messagebox('',string(currentrow))
- if dw_1.getrow()=0 then
- return
- end if
- ll_currrow = row
- ///保存之前内容
- ///保存之前内容
- newid=this.object.id[dw_1.getrow()]
- if uo_sign.uf_set_sign(newid,publ_userid,ref ls_msg)=0 then
- messagebox('',ls_msg)
- return
- end if
- uo_1.uf_sethtml(uo_sign.signcontent)
- end event
- type gb_1 from groupbox within w_email_signmanage
- integer width = 832
- integer height = 1080
- integer taborder = 10
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "选择签名"
- end type
- type gb_2 from groupbox within w_email_signmanage
- integer x = 832
- integer width = 2551
- integer height = 1076
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "编辑签名"
- end type
- type gb_3 from groupbox within w_email_signmanage
- integer y = 1260
- integer width = 2871
- integer height = 496
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- boolean enabled = false
- string text = "选择账号默认签名"
- end type
|