$PBExportHeader$w_msg_newstyle.srw forward global type w_msg_newstyle from w_publ_base end type type r_bg from rectangle within w_msg_newstyle end type type dw_list from datawindow within w_msg_newstyle end type type dw_msg from datawindow within w_msg_newstyle end type type dw_fj from datawindow within w_msg_newstyle end type type st_fjtitle from statictext within w_msg_newstyle end type type st_empname from statictext within w_msg_newstyle end type type mle_edit from multilineedit within w_msg_newstyle end type type cb_send from commandbutton within w_msg_newstyle end type type st_3 from statictext within w_msg_newstyle end type type st_add_msg from statictext within w_msg_newstyle end type type p_add_msg from picture within w_msg_newstyle end type type st_fjtitle_sub from statictext within w_msg_newstyle end type type shl_old from statichyperlink within w_msg_newstyle end type type p_fj_add from picture within w_msg_newstyle end type type st_fj_add from statictext within w_msg_newstyle end type type sle_title from singlelineedit within w_msg_newstyle end type type ln_1 from line within w_msg_newstyle end type type ln_3 from line within w_msg_newstyle end type type st_title_tip_warp from statictext within w_msg_newstyle end type type st_title_tip from statictext within w_msg_newstyle end type type st_msg_tip_warp from statictext within w_msg_newstyle end type type st_msg_tip from statictext within w_msg_newstyle end type type sle_billcode from singlelineedit within w_msg_newstyle end type type st_billcode_tip_warp from statictext within w_msg_newstyle end type type st_billcode_tip from statictext within w_msg_newstyle end type type sle_find from singlelineedit within w_msg_newstyle end type type st_1 from statictext within w_msg_newstyle end type type p_filter_close from picture within w_msg_newstyle end type type st_search_tip_warp from statictext within w_msg_newstyle end type type st_search_tip from statictext within w_msg_newstyle end type type st_no_fj from statictext within w_msg_newstyle end type type r_1 from rectangle within w_msg_newstyle end type end forward global type w_msg_newstyle from w_publ_base integer width = 4704 integer height = 2876 string title = "内部消息" boolean maxbox = true long backcolor = 16777215 event ue_msg_setroll ( ) event ue_open_fj ( ) event ue_download_fj ( ) event ue_add_fj ( ) event ue_ifshow_tip ( ) event ue_retrieve_msg ( ) event ue_retrieve_fj ( ) event ue_retrieve_list ( ) event ue_retrieve_all ( ) r_bg r_bg dw_list dw_list dw_msg dw_msg dw_fj dw_fj st_fjtitle st_fjtitle st_empname st_empname mle_edit mle_edit cb_send cb_send st_3 st_3 st_add_msg st_add_msg p_add_msg p_add_msg st_fjtitle_sub st_fjtitle_sub shl_old shl_old p_fj_add p_fj_add st_fj_add st_fj_add sle_title sle_title ln_1 ln_1 ln_3 ln_3 st_title_tip_warp st_title_tip_warp st_title_tip st_title_tip st_msg_tip_warp st_msg_tip_warp st_msg_tip st_msg_tip sle_billcode sle_billcode st_billcode_tip_warp st_billcode_tip_warp st_billcode_tip st_billcode_tip sle_find sle_find st_1 st_1 p_filter_close p_filter_close st_search_tip_warp st_search_tip_warp st_search_tip st_search_tip st_no_fj st_no_fj r_1 r_1 end type global w_msg_newstyle w_msg_newstyle type variables String smax1,smax2,spos1 string fjfilepathname = 'fjtemp' string ins_openfile_log[] //用于退出后删除 long ins_openfile_log_p=0 //用于退出后删除 s_msg_fj ins_msg_fj[],ins_fj_empty[] s_msg_newstyle ins_msg_tmp[] string ins_empname long ins_empid uo_transmsg uo_msg boolean ins_iffocus_title = false,ins_iffocus_msg = false,ins_iffocus_billcode = false string ori_select_msg,ori_select_fj s_edit_index_tran s_open long ins_toprow = 200 end variables forward prototypes public subroutine wf_addlog_tempfilepathname (string arg_filepathname) public subroutine wf_del_tempfilepathname () end prototypes event ue_msg_setroll();////String smax1 //smax1 = dw_msg.Describe("DataWindow.VerticalScrollMaximum") //dw_msg.Modify("DataWindow.VerticalScrollPosition='"+smax1+"'") // smax2 = dw_msg.Describe("DataWindow.VerticalScrollMaximum") long ll_spos2 If long(smax1) > 0 Then ll_spos2 = long(spos1) * (long(smax2) / long(smax1)) Else ll_spos2 = long(smax1) End If dw_msg.Modify("DataWindow.VerticalScrollPosition='"+String(ll_spos2)+"'") end event event ue_open_fj();int rslt = 1 string ls_pathname string errmsg string lsNull setnull(lsNull) string arg_filename blob arg_blob long arg_fjid long ll_row string arg_msg ll_row = dw_fj.getrow() if ll_row <= 0 then return arg_fjid = dw_fj.object.sys_admsg_fj_fjid[ll_row] arg_filename = dw_fj.object.sys_admsg_fj_filename[ll_row] SELECTBLOB fileblob INTO :arg_blob FROM Sys_admsg_fj WHERE fjid = :arg_fjid; if sqlca.sqlcode <> 0 then rslt = 0 arg_msg = '获取内部消息附件失败,' + sqlca.sqlerrtext goto ext end if ls_pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+arg_filename IF FileExists(ls_pathname) THEN FileDelete(ls_pathname) IF f_blobtofile(ls_pathname,arg_blob,errmsg) = 0 THEN rslt = 0 GOTO ext END IF wf_addlog_tempfilepathname(ls_pathname) //打开附件 ShellExecute32( Handle(THIS), lsNull, ls_pathname, lsNull, lsNull, 1 ) ext: IF rslt = 0 THEN MessageBox('系统提示',errmsg) END IF end event event ue_download_fj();Int rslt = 1 String ls_pathname String errmsg String lsNull SetNull(lsNull) String arg_filename Blob arg_blob Long arg_fjid,i Long ll_row String arg_msg ll_row = dw_fj.GetRow() If ll_row <= 0 Then Return arg_fjid = dw_fj.Object.sys_admsg_fj_fjid[ll_row] arg_filename = dw_fj.Object.sys_admsg_fj_filename[ll_row] ls_pathname = arg_filename long pos1 string ls_filetypename pos1 = pos(arg_filename,'.',1) IF pos1 > 0 THEN ls_filetypename = mid(arg_filename,pos1 + 1, len(arg_filename)) i = GetFileSaveName("另存为",ls_pathname,arg_filename,"*","*."+ls_filetypename+",*."+ls_filetypename) ELSE ls_filetypename = '' i = GetFileSaveName("另存为",ls_pathname,arg_filename,"*","*.*,*.*") END IF If i = 1 And Trim(ls_pathname) <> '' Then SelectBlob fileblob Into :arg_blob From Sys_admsg_fj Where fjid = :arg_fjid; If sqlca.SQLCode <> 0 Then rslt = 0 arg_msg = '获取内部消息附件失败,' + sqlca.SQLErrText Goto ext End If If f_blobtofile(ls_pathname,arg_blob,errmsg) = 0 Then rslt = 0 Goto ext End If messagebox('系统提示','附件保存成功') End If ext: If rslt = 0 Then MessageBox('系统提示',errmsg) End If end event event ue_add_fj();s_msg_newstyle s_add_fj s_add_fj.arg_s_fj = ins_msg_fj openwithparm(w_msg_fj_add_newstyle,s_add_fj) s_add_fj = message.powerobjectparm ins_msg_fj = s_add_fj.arg_s_fj if UpperBound(ins_msg_fj) > 0 then st_fj_add.text = '已添加'+string(UpperBound(ins_msg_fj))+'个附件' else st_fj_add.text = '添加附件' end if mle_edit.setfocus() end event event ue_ifshow_tip();If ins_iffocus_title = False And ins_iffocus_msg = False And ins_iffocus_billcode = False Then //先判断是否需要执行,避免界面控件频繁刷新 If st_title_tip_warp.Visible = True Then st_title_tip_warp.Visible = False st_title_tip.Visible = False st_msg_tip_warp.Visible = False st_msg_tip.Visible = False st_billcode_tip_warp.Visible = False st_billcode_tip.Visible = False End If Else If st_title_tip_warp.Visible = False Then st_title_tip_warp.BringToTop = True st_title_tip.BringToTop = True st_title_tip_warp.Visible = True st_title_tip.Visible = True st_msg_tip_warp.BringToTop = True st_msg_tip.BringToTop = True st_msg_tip_warp.Visible = True st_msg_tip.Visible = True st_billcode_tip_warp.BringToTop = True st_billcode_tip.BringToTop = True st_billcode_tip_warp.Visible = True st_billcode_tip.Visible = True End If End If end event event ue_retrieve_msg();String ls_wherestr,ls_newselect String arg_msg String ls_findstr string ls_orderbystr ls_wherestr = " WHERE (sys_admsgmx.empid = "+String(sys_empid)+" and sys_admsg.sendempid = "+String(ins_empid) ls_wherestr += "or sys_admsgmx.empid = "+String(ins_empid) +" and sys_admsg.sendempid = "+String(sys_empid)+") " If Trim(sle_find.Text) <> '' Then ls_findstr = '%'+Trim(sle_find.Text)+'%' ls_wherestr += " and (sys_admsg.s_msg like '" +ls_findstr+"'" +& " or sys_admsg.s_msgtitle like '" +ls_findstr+"'" +& " or isnull(u_saletask.relcode,'') like '" +ls_findstr+"'" +& " or sys_admsg.billcode like '" +ls_findstr+"')" End If //ls_orderbystr = ' order by sys_admsgmx.dealdt desc' //ls_newselect = 'select top '+string(ins_toprow)+' '+mid( ori_select_msg , 8) + ls_wherestr + ls_orderbystr ls_newselect = ori_select_msg + ls_wherestr dw_msg.Modify("datawindow.table.select = ~"" + ls_newselect+ "~"") dw_msg.Retrieve() //更新收件人是我的消息的已读标记 If dw_msg.Find('read_flag = 0 and empid = '+String(sys_empid),1,dw_msg.RowCount()) > 0 Then Update Sys_admsgmx Set read_flag = 1 From Sys_admsg Inner JOIN Sys_admsgmx ON Sys_admsg.msgid = Sys_admsgmx.msgid Where sys_admsg.sendempid = :ins_empid And Sys_admsgmx.empid = :sys_empid; If sqlca.SQLCode <> 0 Then arg_msg = '更新已读标记失败,'+sqlca.SQLErrText Rollback; Else Commit; End If End If //String smax1 smax1 = dw_msg.Describe("DataWindow.VerticalScrollMaximum") dw_msg.Modify("DataWindow.VerticalScrollPosition='"+smax1+"'") dw_msg.SetFocus() end event event ue_retrieve_fj();string ls_wherestr,ls_newselect,ls_findstr ls_wherestr= " WHERE (sys_admsgmx.empid = "+string(sys_empid)+" and sys_admsg.sendempid = "+string(ins_empid) ls_wherestr += "or sys_admsgmx.empid = "+string(ins_empid) +" and sys_admsg.sendempid = "+string(sys_empid)+") " If Trim(sle_find.Text) <> '' Then ls_findstr = '%'+Trim(sle_find.Text)+'%' ls_wherestr += " and (sys_admsg.s_msg like '" +ls_findstr+"'" +& " or sys_admsg.s_msgtitle like '" +ls_findstr+"'" +& " or isnull(u_saletask.relcode,'') like '" +ls_findstr+"'" +& " or sys_admsg.billcode like '" +ls_findstr+"')" End If ls_newselect = ori_select_fj + ls_wherestr dw_fj.Modify("datawindow.table.select = ~"" + ls_newselect+ "~"") dw_fj.Retrieve() st_no_fj.visible = (dw_fj.rowcount() = 0) end event event ue_retrieve_list();String ls_findstr If Trim(sle_find.Text) <> '' Then ls_findstr = '%'+sle_find.Text+'%' End If dw_list.Retrieve(sys_empid,ls_findstr) end event event ue_retrieve_all();This.TriggerEvent('ue_retrieve_list') If dw_list.RowCount() > 0 Then ins_empname = dw_list.Object.empname[1] ins_empid = dw_list.Object.empid[1] st_empname.Text = ins_empname // //刷新 dw_msg及 dw_fj,并更新已读标记,同时更新dw_list的 s_msgtitle,s_msgtitle_ori This.TriggerEvent('ue_retrieve_msg') This.TriggerEvent('ue_retrieve_fj') ////// // else dw_msg.reset() dw_fj.reset() End If end event public subroutine wf_addlog_tempfilepathname (string arg_filepathname);//wf_addlog_tempfilepathname if isnull(arg_filepathname) or len(trim(arg_filepathname))<3 then return ins_openfile_log_p++ ins_openfile_log[ins_openfile_log_p]=arg_filepathname end subroutine public subroutine wf_del_tempfilepathname ();long li for li=1 to ins_openfile_log_p if len(trim(ins_openfile_log[li]))<=0 then else FileDelete(ins_openfile_log[li]) end if next end subroutine on w_msg_newstyle.create int iCurrent call super::create this.r_bg=create r_bg this.dw_list=create dw_list this.dw_msg=create dw_msg this.dw_fj=create dw_fj this.st_fjtitle=create st_fjtitle this.st_empname=create st_empname this.mle_edit=create mle_edit this.cb_send=create cb_send this.st_3=create st_3 this.st_add_msg=create st_add_msg this.p_add_msg=create p_add_msg this.st_fjtitle_sub=create st_fjtitle_sub this.shl_old=create shl_old this.p_fj_add=create p_fj_add this.st_fj_add=create st_fj_add this.sle_title=create sle_title this.ln_1=create ln_1 this.ln_3=create ln_3 this.st_title_tip_warp=create st_title_tip_warp this.st_title_tip=create st_title_tip this.st_msg_tip_warp=create st_msg_tip_warp this.st_msg_tip=create st_msg_tip this.sle_billcode=create sle_billcode this.st_billcode_tip_warp=create st_billcode_tip_warp this.st_billcode_tip=create st_billcode_tip this.sle_find=create sle_find this.st_1=create st_1 this.p_filter_close=create p_filter_close this.st_search_tip_warp=create st_search_tip_warp this.st_search_tip=create st_search_tip this.st_no_fj=create st_no_fj this.r_1=create r_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.r_bg this.Control[iCurrent+2]=this.dw_list this.Control[iCurrent+3]=this.dw_msg this.Control[iCurrent+4]=this.dw_fj this.Control[iCurrent+5]=this.st_fjtitle this.Control[iCurrent+6]=this.st_empname this.Control[iCurrent+7]=this.mle_edit this.Control[iCurrent+8]=this.cb_send this.Control[iCurrent+9]=this.st_3 this.Control[iCurrent+10]=this.st_add_msg this.Control[iCurrent+11]=this.p_add_msg this.Control[iCurrent+12]=this.st_fjtitle_sub this.Control[iCurrent+13]=this.shl_old this.Control[iCurrent+14]=this.p_fj_add this.Control[iCurrent+15]=this.st_fj_add this.Control[iCurrent+16]=this.sle_title this.Control[iCurrent+17]=this.ln_1 this.Control[iCurrent+18]=this.ln_3 this.Control[iCurrent+19]=this.st_title_tip_warp this.Control[iCurrent+20]=this.st_title_tip this.Control[iCurrent+21]=this.st_msg_tip_warp this.Control[iCurrent+22]=this.st_msg_tip this.Control[iCurrent+23]=this.sle_billcode this.Control[iCurrent+24]=this.st_billcode_tip_warp this.Control[iCurrent+25]=this.st_billcode_tip this.Control[iCurrent+26]=this.sle_find this.Control[iCurrent+27]=this.st_1 this.Control[iCurrent+28]=this.p_filter_close this.Control[iCurrent+29]=this.st_search_tip_warp this.Control[iCurrent+30]=this.st_search_tip this.Control[iCurrent+31]=this.st_no_fj this.Control[iCurrent+32]=this.r_1 end on on w_msg_newstyle.destroy call super::destroy destroy(this.r_bg) destroy(this.dw_list) destroy(this.dw_msg) destroy(this.dw_fj) destroy(this.st_fjtitle) destroy(this.st_empname) destroy(this.mle_edit) destroy(this.cb_send) destroy(this.st_3) destroy(this.st_add_msg) destroy(this.p_add_msg) destroy(this.st_fjtitle_sub) destroy(this.shl_old) destroy(this.p_fj_add) destroy(this.st_fj_add) destroy(this.sle_title) destroy(this.ln_1) destroy(this.ln_3) destroy(this.st_title_tip_warp) destroy(this.st_title_tip) destroy(this.st_msg_tip_warp) destroy(this.st_msg_tip) destroy(this.sle_billcode) destroy(this.st_billcode_tip_warp) destroy(this.st_billcode_tip) destroy(this.sle_find) destroy(this.st_1) destroy(this.p_filter_close) destroy(this.st_search_tip_warp) destroy(this.st_search_tip) destroy(this.st_no_fj) destroy(this.r_1) end on event open;call super::open;ori_select_msg = dw_msg.Describe("DataWindow.Table.Select") ori_select_fj = dw_fj.Describe("DataWindow.Table.Select") dw_list.SetTransObject(sqlca) dw_msg.SetTransObject(sqlca) dw_fj.SetTransObject(sqlca) s_open = Message.PowerObjectParm If s_open.b_string <> '' Then //外面调用,定位到选定的发送人 This.TriggerEvent('ue_retrieve_list') Long ll_row_f,ll_row_f_msg ll_row_f = dw_list.Find('empname = "'+s_open.b_string+'"',1,dw_list.RowCount()) If ll_row_f <= 0 Then ll_row_f = 1 End If If dw_list.RowCount() > 0 Then dw_list.SetRow(ll_row_f) ins_empname = dw_list.Object.empname[ll_row_f] ins_empid = dw_list.Object.empid[ll_row_f] st_empname.Text = ins_empname This.TriggerEvent('ue_retrieve_msg') This.TriggerEvent('ue_retrieve_fj') dw_list.SetRow(ll_row_f) dw_list.ScrollToRow(ll_row_f) If s_open.b_long > 0 Then ll_row_f_msg = dw_msg.Find('msgid = '+String(s_open.b_long),1,dw_msg.RowCount()) dw_msg.SetRow(ll_row_f_msg) dw_msg.ScrollToRow(ll_row_f_msg) End If End If Else This.TriggerEvent('ue_retrieve_all') //String smax1 smax1 = dw_msg.Describe("DataWindow.VerticalScrollMaximum") dw_msg.Modify("DataWindow.VerticalScrollPosition='"+smax1+"'") End If If dw_msg.RowCount() > 0 Then dw_msg.SetRow(dw_msg.RowCount()) End If // //if dw_list.rowcount() > 0 then // ins_empname = dw_list.object.empname[1] // ins_empid = dw_list.object.empid[1] // st_empname.text = ins_empname // // //将XX条未读 改为 最近一条的标题,因为点击进来就是已读了 // dw_list.Object.s_msgtitle[1] = dw_list.Object.s_msgtitle_ori[1] // // ////刷新 dw_msg及 dw_fj,并更新已读标记,同时更新dw_list的 s_msgtitle,s_msgtitle_ori // this.triggerevent('ue_retrieve_msg') // this.triggerevent('ue_retrieve_fj') // //////// // //end if // dw_msg.SetFocus() //This.PostEvent('ue_msg_setroll') end event event resize;call super::resize;/////各代码前后顺序不要随便改动,涉及到相对位置,有严格的先后顺序 this.setredraw(false) r_bg.width = this.workspacewidth() + 10 r_bg.height= ln_1.BeginY + 4 ln_1.BeginX = 0 // dw_msg.x ln_1.EndX = This.WorkSpaceWidth() + 10 //ln_3.BeginX //dw_msg.x + dw_msg.width ln_3.BeginY = ln_1.BeginY ln_3.EndY = This.WorkSpaceHeight() + 10 // dw_fj.y + dw_fj.height dw_list.Height = This.WorkSpaceHeight() - dw_list.Y - 10 dw_fj.X = This.WorkSpaceWidth() - dw_fj.Width - 10 ln_3.BeginX = dw_fj.X - 4 ln_3.EndX = ln_3.BeginX //记录当前滚动条位置,用于resize后让滚动条回到该位置,否则滚动条会在最顶部 Long ll_spos2 spos1 = dw_msg.Describe("DataWindow.VerticalScrollPosition") smax1 = dw_msg.Describe("DataWindow.VerticalScrollMaximum") dw_msg.x = dw_list.x + dw_list.width + 10 dw_msg.object.s_msg.width = This.WorkSpaceWidth() - dw_msg.X - dw_fj.Width - 25 - 300// dw_msg.width - 400 dw_msg.object.s_msgtitle.width = This.WorkSpaceWidth() - dw_msg.X - dw_fj.Width - 25 - 300//dw_msg.width - 400 dw_msg.Height = This.WorkSpaceHeight() - dw_msg.Y - 830 // 830是录入部分的高度 dw_msg.Width = This.WorkSpaceWidth() - dw_msg.X - dw_fj.Width - 25 mle_edit.X = dw_msg.X mle_edit.Width = dw_msg.Width sle_title.x = mle_edit.X sle_title.y = dw_msg.Y + dw_msg.Height + 24 sle_title.width = mle_edit.Width mle_edit.Y = sle_title.y + sle_title.height + 4 //dw_msg.Y + dw_msg.Height + 24 st_title_tip_warp.y = sle_title.y st_title_tip.y = sle_title.y + 16 st_msg_tip_warp.y = mle_edit.y st_msg_tip.y = mle_edit.y + 16 cb_send.X = mle_edit.X + mle_edit.Width - cb_send.Width cb_send.Y = This.WorkSpaceHeight() - 116 sle_billcode.x = mle_edit.X sle_billcode.y = cb_send.Y st_billcode_tip_warp.y = sle_billcode.y st_billcode_tip.y = sle_billcode.y + 16 mle_edit.height = sle_billcode.y - 4 - mle_edit.y p_fj_add.y = cb_send.y + 8 st_fj_add.y = cb_send.y + 16 st_fjtitle.x = dw_fj.x + 42 st_fjtitle_sub.x = st_fjtitle.x + st_fjtitle.width + 5 dw_fj.height = This.WorkSpaceHeight() - dw_fj.Y - 10 shl_old.x = dw_msg.x + dw_msg.width - shl_old.width - 10 st_no_fj.x = dw_fj.x + 389 //还原滚动条位置 this.postevent('ue_msg_setroll') this.setredraw(true) end event event close;call super::close;// 删除临时文件 wf_del_tempfilepathname() end event type cb_func from w_publ_base`cb_func within w_msg_newstyle boolean visible = false integer taborder = 30 end type type cb_exit from w_publ_base`cb_exit within w_msg_newstyle boolean visible = false end type type r_bg from rectangle within w_msg_newstyle long linecolor = 33554432 linestyle linestyle = transparent! integer linethickness = 4 long fillcolor = 29920514 integer width = 521 integer height = 176 end type type dw_list from datawindow within w_msg_newstyle integer x = 14 integer y = 132 integer width = 987 integer height = 2612 integer taborder = 60 boolean bringtotop = true string title = "none" string dataobject = "dw_msg_userlist_newstyle_demo" boolean vscrollbar = true boolean border = false boolean livescroll = true borderstyle borderstyle = stylelowered! end type event clicked;If row > 0 Then Long i Boolean lb_iffind = False Long cnt,ll_find,ll_row_f cnt = UpperBound(ins_msg_tmp) //记录原有发送对象的未发送内容 For i = 1 To cnt If ins_msg_tmp[i].empname = ins_empname Then lb_iffind = True ll_find = i Exit End If Next If lb_iffind = False Then cnt++ ins_msg_tmp[cnt].empname = ins_empname ins_msg_tmp[cnt].empid = ins_empid ll_find = cnt End If ins_msg_tmp[ll_find].s_msgtitle = Trim(sle_title.Text) ins_msg_tmp[ll_find].s_msg = Trim(mle_edit.Text) ins_msg_tmp[ll_find].billcode = Trim(sle_billcode.Text) ins_msg_tmp[ll_find].arg_s_fj = ins_msg_fj //更新换行前的那一行内容为【正在编辑发送内容】 ll_row_f = dw_list.Find('empid = '+String(ins_empid),1,dw_list.RowCount()) If ll_row_f > 0 Then If Trim(sle_title.Text) <> '' Or Trim(mle_edit.Text) <> '' or Trim(sle_billcode.Text) <> '' Or UpperBound(ins_msg_fj) > 0 Then dw_list.Object.s_msgtitle[ll_row_f] = '[正在编辑发送内容]' dw_list.Object.editing[ll_row_f] = 1 Else // if trim(sle_find.text) = '' then dw_list.Object.s_msgtitle[ll_row_f] = dw_list.Object.s_msgtitle_ori[ll_row_f] // end if dw_list.Object.editing[ll_row_f] = 0 End If End If /////// // ////新的一行信息 ins_empname = This.Object.empname[row] ins_empid = This.Object.empid[row] //将XX条未读 改为 最近一条的标题,因为点击进来就是已读了 // if trim(sle_find.text) = '' then dw_list.Object.s_msgtitle[row] = dw_list.Object.s_msgtitle_ori[row] // end if dw_list.Object.editing[row] = 0 st_empname.Text = ins_empname ins_msg_fj = ins_fj_empty sle_title.Text = '' mle_edit.Text = '' sle_billcode.Text = '' ////还原之前编辑未发送的内容 For i = 1 To UpperBound(ins_msg_tmp) If ins_empname = ins_msg_tmp[i].empname Then sle_title.Text = ins_msg_tmp[i].s_msgtitle mle_edit.Text = ins_msg_tmp[i].s_msg ins_msg_fj = ins_msg_tmp[i].arg_s_fj sle_billcode.Text = ins_msg_tmp[i].billcode End If Next If UpperBound(ins_msg_fj) > 0 Then st_fj_add.Text = '已添加'+String(UpperBound(ins_msg_fj))+'个附件' Else st_fj_add.Text = '添加附件' End If ////// ////刷新 dw_msg及 dw_fj,并更新已读标记,同时更新dw_list的 s_msgtitle,s_msgtitle_ori parent.triggerevent('ue_retrieve_msg') parent.triggerevent('ue_retrieve_fj') //////// If Trim(sle_title.Text) <> '' Or Trim(mle_edit.Text) <> '' or Trim(sle_billcode.Text) <> '' Or UpperBound(ins_msg_fj) > 0 Then mle_edit.setfocus() end if End If end event type dw_msg from datawindow within w_msg_newstyle integer x = 1006 integer y = 132 integer width = 2446 integer height = 1904 integer taborder = 70 boolean bringtotop = true string title = "none" string dataobject = "dw_msg_mainface_newstyle_demo" boolean vscrollbar = true boolean border = false boolean livescroll = true end type event clicked;if row > 0 then if dwo.name = 'relcode' then long ll_scid string ls_code ll_scid = this.object.scid[row] ls_code = this.object.billcode[row] IF ls_code <> '' THEN f_open_win(ll_scid,ls_code) END IF elseif dwo.name = 'p_fj' or dwo.name = 'fjstr' then s_edit_index_tran s_fj_open s_fj_open.b_long = this.object.msgid[row] openwithparm(w_msg_fj_view_newstyle,s_fj_open) end if end if end event type dw_fj from datawindow within w_msg_newstyle integer x = 3483 integer y = 132 integer width = 1202 integer height = 2600 integer taborder = 80 boolean bringtotop = true string title = "none" string dataobject = "dw_msg_fj_newstyle_demo" boolean vscrollbar = true boolean border = false boolean livescroll = true end type event doubleclicked;parent.triggerevent('ue_open_fj') end event event clicked;if row > 0 then this.setrow(row) if dwo.name = 't_download' then parent.triggerevent('ue_download_fj') end if end if end event type st_fjtitle from statictext within w_msg_newstyle integer x = 3525 integer y = 40 integer width = 329 integer height = 60 boolean bringtotop = true integer textsize = -11 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16777215 long backcolor = 29920514 string text = "附件汇总" boolean focusrectangle = false end type type st_empname from statictext within w_msg_newstyle integer x = 1019 integer y = 40 integer width = 320 integer height = 60 boolean bringtotop = true integer textsize = -11 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16777215 long backcolor = 29920514 string text = "姓名" boolean focusrectangle = false end type type mle_edit from multilineedit within w_msg_newstyle integer x = 1019 integer y = 2148 integer width = 2423 integer height = 528 integer taborder = 40 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 boolean vscrollbar = true boolean autovscroll = true borderstyle borderstyle = stylelowered! end type event losefocus;ins_iffocus_msg = false parent.triggerevent('ue_ifshow_tip') end event event getfocus;ins_iffocus_msg = true parent.triggerevent('ue_ifshow_tip') end event type cb_send from commandbutton within w_msg_newstyle integer x = 3136 integer y = 2684 integer width = 306 integer height = 92 integer taborder = 90 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "发送" end type event clicked;String ls_objdpm,ls_msgtitle,ls_s_msg,arg_msg,ls_billcode Boolean ifcommit Long ls_i ls_objdpm = ins_empname ls_msgtitle = Trim(sle_title.Text) ls_s_msg = Trim(mle_edit.Text) ls_billcode = Trim(sle_billcode.Text) If Trim(ls_objdpm) = '' Then MessageBox('系统提示','请指定收件人') Return End If if ls_s_msg = '' then MessageBox('系统提示','请输入消息内容') Return End If If Trim(ls_msgtitle) = '' Then if len(ls_s_msg) > 12 then ls_msgtitle = left(ls_s_msg,12) + '...' else ls_msgtitle = ls_s_msg end if // MessageBox('系统提示','请输入标题') // sle_title.SetFocus() // Return End If Blob ls_filedata,ls_filedate_arr[] Long ll_cnt_fj Long ll_FileID For ls_i = 1 To UpperBound(ins_msg_fj) If f_filetoblob(ins_msg_fj[ls_i].fjpath,ls_filedata,arg_msg) = 0 Then MessageBox('系统提示','文件读取失败:'+ ins_msg_fj[ls_i].fjname+'~r~n'+arg_msg) Return End If ins_msg_fj[ls_i].filedata = ls_filedata Next If ll_cnt_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('系统提示','消息发送失败'+'~r~n'+arg_msg) Return End If For ls_i = 1 To UpperBound(ins_msg_fj) If ls_i = UpperBound(ins_msg_fj) Then ifcommit = True Else ifcommit = False End If If uo_msg.f_save_fj(uo_msg.uo_msgid,& ins_msg_fj[ls_i].fjname,& ins_msg_fj[ls_i].filedata,& 0,& 0,arg_msg,ifcommit) = 0 Then MessageBox('系统提示','添加附件失败'+'~r~n'+arg_msg) Return End If Next sle_title.Text = '' mle_edit.Text = '' sle_billcode.Text = '' ins_msg_fj = ins_fj_empty st_fj_add.text = '添加附件' //刷新dw_msg,dw_fj Parent.TriggerEvent('ue_retrieve_msg') Parent.TriggerEvent('ue_retrieve_fj') end event type st_3 from statictext within w_msg_newstyle integer x = 32 integer y = 40 integer width = 402 integer height = 60 boolean bringtotop = true integer textsize = -11 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16777215 long backcolor = 29920514 string text = "历史联系人" boolean focusrectangle = false end type type st_add_msg from statictext within w_msg_newstyle integer x = 549 integer y = 44 integer width = 411 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string pointer = "HyperLink!" long textcolor = 16777215 long backcolor = 29920514 string text = "新联系人/群发" boolean focusrectangle = false end type event clicked;s_admsg s_msg,s_return s_msg.ifback = 0 openwithparm(w_msg_send_normal,s_msg) s_return = message.powerobjectparm if s_return.ifsend = 1 then //刷新 parent.triggerevent('ue_retrieve_all') end if end event type p_add_msg from picture within w_msg_newstyle integer x = 466 integer y = 40 integer width = 73 integer height = 64 boolean bringtotop = true string pointer = "HyperLink!" string picturename = "msg_add_newstyle.jpg" boolean focusrectangle = false end type event clicked;st_add_msg.triggerevent(clicked!) end event type st_fjtitle_sub from statictext within w_msg_newstyle integer x = 3849 integer y = 44 integer width = 402 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16777215 long backcolor = 29920514 string text = "双击可打开附件" boolean focusrectangle = false end type type shl_old from statichyperlink within w_msg_newstyle integer x = 3008 integer y = 44 integer width = 466 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string pointer = "HyperLink!" long textcolor = 16777215 long backcolor = 29920514 string text = "进入传统消息管理" boolean focusrectangle = false end type event clicked;long ll_msgid if dw_msg.getrow() > 0 then ll_msgid = dw_msg.object.msgid[dw_msg.getrow()] end if OpenWithParm(w_email_view,ll_msgid) end event type p_fj_add from picture within w_msg_newstyle integer x = 1632 integer y = 2692 integer width = 73 integer height = 64 boolean bringtotop = true boolean originalsize = true string picturename = "mt_fj_add.png" boolean focusrectangle = false end type event clicked;parent.triggerevent('ue_add_fj') end event type st_fj_add from statictext within w_msg_newstyle integer x = 1723 integer y = 2700 integer width = 535 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 134217856 long backcolor = 16777215 string text = "添加附件" boolean focusrectangle = false end type event clicked;parent.triggerevent('ue_add_fj') end event type sle_title from singlelineedit within w_msg_newstyle event key pbm_keydown integer x = 1019 integer y = 2048 integer width = 2423 integer height = 92 integer taborder = 20 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 borderstyle borderstyle = stylelowered! end type event key;if key = keyenter! then mle_edit.setfocus() end if end event event getfocus;ins_iffocus_title = true parent.triggerevent('ue_ifshow_tip') end event event losefocus;ins_iffocus_title = false parent.triggerevent('ue_ifshow_tip') end event type ln_1 from line within w_msg_newstyle long linecolor = 30988504 integer linethickness = 4 integer beginx = 1033 integer beginy = 124 integer endx = 2080 integer endy = 124 end type type ln_3 from line within w_msg_newstyle long linecolor = 30988504 integer linethickness = 4 integer beginx = 3474 integer beginy = 152 integer endx = 3474 integer endy = 712 end type type st_title_tip_warp from statictext within w_msg_newstyle boolean visible = false integer x = 759 integer y = 2048 integer width = 247 integer height = 92 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 alignment alignment = center! boolean border = true long bordercolor = 8421504 boolean focusrectangle = false end type type st_title_tip from statictext within w_msg_newstyle boolean visible = false integer x = 782 integer y = 2064 integer width = 197 integer height = 60 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 string text = "标题" alignment alignment = center! boolean focusrectangle = false end type type st_msg_tip_warp from statictext within w_msg_newstyle boolean visible = false integer x = 759 integer y = 2152 integer width = 247 integer height = 92 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 alignment alignment = center! boolean border = true long bordercolor = 8421504 boolean focusrectangle = false end type type st_msg_tip from statictext within w_msg_newstyle boolean visible = false integer x = 782 integer y = 2168 integer width = 197 integer height = 60 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 string text = "正文" alignment alignment = center! boolean focusrectangle = false end type type sle_billcode from singlelineedit within w_msg_newstyle event key pbm_keydown integer x = 1019 integer y = 2680 integer width = 549 integer height = 92 integer taborder = 50 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 borderstyle borderstyle = stylelowered! end type event getfocus;ins_iffocus_billcode = true parent.triggerevent('ue_ifshow_tip') end event event losefocus;ins_iffocus_billcode = false parent.triggerevent('ue_ifshow_tip') end event type st_billcode_tip_warp from statictext within w_msg_newstyle boolean visible = false integer x = 759 integer y = 2680 integer width = 247 integer height = 92 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 alignment alignment = center! boolean border = true long bordercolor = 8421504 boolean focusrectangle = false end type type st_billcode_tip from statictext within w_msg_newstyle boolean visible = false integer x = 782 integer y = 2700 integer width = 197 integer height = 60 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 string text = "相关号" alignment alignment = center! boolean focusrectangle = false end type type sle_find from singlelineedit within w_msg_newstyle event key pbm_keydown integer x = 1522 integer y = 36 integer width = 1339 integer height = 60 integer taborder = 20 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 boolean border = false end type event key;If Key = keyenter! Then Parent.TriggerEvent('ue_retrieve_all') sle_find.SetFocus() End If end event event getfocus; st_search_tip_warp.BringToTop = True st_search_tip.BringToTop = True st_search_tip_warp.Visible = True st_search_tip.Visible = True end event event losefocus;st_search_tip.visible = false st_search_tip_warp.visible = false end event type st_1 from statictext within w_msg_newstyle integer x = 1385 integer y = 36 integer width = 123 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 16777215 string text = "搜索" alignment alignment = right! boolean focusrectangle = false end type event clicked;sle_find.setfocus() end event type p_filter_close from picture within w_msg_newstyle integer x = 2875 integer y = 32 integer width = 73 integer height = 64 boolean bringtotop = true boolean originalsize = true string picturename = "dm_close.png" boolean focusrectangle = false end type event clicked;If Trim(sle_find.Text) <> '' Then sle_find.Text = '' Parent.TriggerEvent('ue_retrieve_all') End If sle_find.SetFocus() end event type st_search_tip_warp from statictext within w_msg_newstyle boolean visible = false integer x = 1367 integer y = 120 integer width = 800 integer height = 92 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 alignment alignment = center! boolean border = true long bordercolor = 8421504 boolean focusrectangle = false end type type st_search_tip from statictext within w_msg_newstyle boolean visible = false integer x = 1403 integer y = 136 integer width = 727 integer height = 60 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 8421504 long backcolor = 15793151 string text = "可搜索标题、正文、相关号" alignment alignment = center! boolean focusrectangle = false end type type st_no_fj from statictext within w_msg_newstyle boolean visible = false integer x = 3872 integer y = 308 integer width = 421 integer height = 104 boolean bringtotop = true integer textsize = -15 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = fixed! fontfamily fontfamily = modern! string facename = "黑体" long textcolor = 8421504 string text = "没有附件" boolean focusrectangle = false end type type r_1 from rectangle within w_msg_newstyle long linecolor = 12632256 integer linethickness = 4 long fillcolor = 16777215 integer x = 1367 integer y = 12 integer width = 1600 integer height = 100 end type