private void DataPlay() { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (this.Request.QueryString["id"] != null) { this.txtid.Value = this.Request.QueryString["id"].ToString(); } HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.txtid.Value); if (dt.Rows.Count > 0) { this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString(); this.txtid.Value = dt.Rows[0]["ID"].ToString(); this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.txtfsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.txtfrsname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString(); this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString(); this.lblhy_title.Text = dt.Rows[0]["hy_title"].ToString(); //附件 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value); if (dt_fileatt.Rows.Count > 0) { string ls_temp = ""; for (var i = 0; i < dt_fileatt.Rows.Count; i++) { ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />"; } this.lblhy_field2.Text = ls_temp; } this.lblhy_content1.Text = dt.Rows[0]["hy_body"].ToString(); } //20120210 start string sccksj = System.DateTime.Now.ToString(); string sql = ""; if (dt.Rows[0]["hy_type"].ToString() == "收件" & dt.Rows[0]["hy_sccksj"].ToString() == "") { sql = "update hyt_mail set hy_sccksj = '" + sccksj + "' where ID='" + this.txtid.Value + "' "; Hyoa_global.ExcuteSQL(sql); } //20120210 end }
private void DataPlay() { HyoaClass.Hyoa_mail_config Hyoa_mail_config = new HyoaClass.Hyoa_mail_config (); DataTable dtmailcon = Hyoa_mail_config.Getmailconfigbyuserid(Session["hyuid"].ToString()); for(int ii=0;ii<dtmailcon.Rows.Count;ii++) { this.ddlmailset.Items.Insert(ii,dtmailcon.Rows[ii]["hy_mailid"].ToString()); } //新文档 if (this.txtop.Value == "add") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); this.txtdocid.Value = Hyoa_global.GetRandom(); this.lblhy_fsrid.Text = Session["hyuid"].ToString(); this.lblhy_fsrname.Text = Session["hyuname"].ToString(); this.lblhy_datetime.Text = System.DateTime.Now.ToString(); //如果是回复 if (this.Request.QueryString["fhid"] != null) { HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.Request.QueryString["fhid"].ToString()); if (dt.Rows.Count > 0) { if (dt.Rows[0]["hy_wbjsrid"].ToString() != "") { //this.txthy_jsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.txthy_wbjsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); //this.txthy_jsrid.Text = dt.Rows[0]["txthy_wbjsrid"].ToString(); //this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString(); this.txthy_title.Text = "回复:" + dt.Rows[0]["hy_title"].ToString(); } else { this.txthy_jsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); //this.txthy_wbjsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString(); this.txthy_title.Text = "回复:" + dt.Rows[0]["hy_title"].ToString(); } } } //如果是从在线人员中过来的 if (this.Request.QueryString["recuserid"] != null) { HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dtuser = Hyoa_user.Getuserallinfo(this.Request.QueryString["recuserid"].ToString()); if (dtuser.Rows.Count > 0) { this.txthy_jsrid.Text = this.Request.QueryString["recuserid"].ToString(); this.txthy_jsrname.Value = dtuser.Rows[0]["hy_username"].ToString(); } } //如果是转发 if (this.Request.QueryString["zfid"] != null) { HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.Request.QueryString["zfid"].ToString()); if (dt.Rows.Count > 0) { this.txthy_title.Text = "转发:" + dt.Rows[0]["hy_title"].ToString(); this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString(); this.txtdocid.Value = dt.Rows[0]["docid"].ToString(); //附件 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[0]["DOCID"].ToString()); if (dt_fileatt.Rows.Count > 0) { string ls_temp = ""; for (var i = 0; i < dt_fileatt.Rows.Count; i++) { ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />"; } this.lblhy_field2.Text = ls_temp; } } this.uploadhy_field2.Visible = false; } } else { if (this.Request.QueryString["id"] != null) { this.txtid.Value = this.Request.QueryString["id"].ToString(); } HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.txtid.Value); if (dt.Rows.Count > 0) { this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString(); this.txtid.Value = dt.Rows[0]["ID"].ToString(); this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString(); this.txthy_jsrname.Value = dt.Rows[0]["hy_jsrname"].ToString(); this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString(); this.txthy_wbjsrid.Text = dt.Rows[0]["hy_wbjsrid"].ToString(); this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString(); //附件 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value); if (dt_fileatt.Rows.Count > 0) { string ls_temp = ""; for (var i = 0; i < dt_fileatt.Rows.Count; i++) { ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />"; } this.lblhy_field2.Text = ls_temp; } this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString(); this.ddlifsavetofjx.SelectedValue = dt.Rows[0]["hy_ifsavetofjx"].ToString(); } //20120210 start if (dt.Rows[0]["hy_type"].ToString() == "发件" & dt.Rows[0]["hy_foldername"].ToString() == "发件箱") { string text = "<TR height='30'><TD width='20%' align='center' class='Tdcellleft'>序号</TD><TD width='40%' align='center' class='Tdcellleft'>姓名</TD><TD width='40%' align='center' class='Tdcellleft'>回执时间</TD></TR>"; HyoaClass.DAO db = new HyoaClass.DAO(); string sql = ""; sql = "select * from hyt_mail where DOCID='" + this.txtdocid.Value + "' and hy_type ='收件' and hy_sccksj <> '' order by hy_sccksj asc"; DataTable dt2 = db.GetDataTable(sql); if (dt2.Rows.Count > 0) { for (var i = 0; i < dt2.Rows.Count; i++) { text = text + "<TR height='30'><TD width='20%' align='center' class='Tdcellright'>" + (i+1).ToString() + "</TD>"; text = text + "<TD width='40%' align='center' class='Tdcellright'>" + dt2.Rows[i]["hy_jsrname"].ToString() + "</TD>"; text = text + "<TD width='40%' align='center' class='Tdcellright'>" + dt2.Rows[i]["hy_sccksj"].ToString() + "</TD></TR>"; } } this.hzlb.Text = text; } //20120210 end } }
protected void btnsendinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { DataTable dt = Hyoa_mail.Getmail(v_uids[i]); if (dt.Rows.Count > 0) { //考虑多人情况 String[] v_jsrids = dt.Rows[0]["hy_jsrid"].ToString().Split('+'); String[] v_jsrnames = dt.Rows[0]["hy_jsrname"].ToString().Split('+'); for (var j = 0; j < v_jsrids.Length; j++) { if (v_jsrids[j] != "") { //发送 Hyoa_mail.ID = Hyoa_global.GetRandom(); Hyoa_mail.DOCID = dt.Rows[0]["ID"].ToString(); Hyoa_mail.hy_type = "收件"; Hyoa_mail.hy_foldername = "收件箱"; Hyoa_mail.hy_fsrid = Session["hyuid"].ToString(); Hyoa_mail.hy_fsrname = Session["hyuname"].ToString(); Hyoa_mail.hy_jsrid = v_jsrids[j]; Hyoa_mail.hy_wbjsrid = ""; Hyoa_mail.hy_jsrname = v_jsrnames[j]; Hyoa_mail.hy_title = dt.Rows[0]["hy_title"].ToString(); Hyoa_mail.hy_body = dt.Rows[0]["hy_body"].ToString(); Hyoa_mail.hy_datetime = System.DateTime.Now.ToString(); Hyoa_mail.hy_ifsavetofjx = ""; Hyoa_mail.hy_yxj = ""; Hyoa_mail.hy_yjbg = ""; Hyoa_mail.hy_zycd = ""; Hyoa_mail.hy_hz = ""; Hyoa_mail.Insert(); } if (dt.Rows[0]["hy_wbjsrid"].ToString() != "") { sendmail(dt.Rows[0]["hy_wbjsrid"].ToString(), dt.Rows[0]["hy_title"].ToString(), dt.Rows[0]["hy_body"].ToString(), dt.Rows[0]["ID"].ToString()); } } } } } this.txtuids.Value = ""; //DataPlay(1); Response.Write("<script>alert('发送成功!');</script>"); DataPlay(System.Int32.Parse(this.curpage.Text)); }
//加载主表单 Written by xf 20110515 private void DataPlay() { txtsavefields.Text = ""; txtsavefields_sx.Text = ""; if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //新文档 if (this.Request.QueryString["op"] == "add") { hy_fsrname.Text = Session["hyuname"].ToString(); hy_datetime.Text = System.DateTime.Now.ToString(); txtdocid.Value = Hyoa_global.GetRandom(); //如果是回复 if (this.Request.QueryString["fhid"] != null) { HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.Request.QueryString["fhid"].ToString()); if (dt.Rows.Count > 0) { this.txthy_jsrid.Value = dt.Rows[0]["hy_fsrid"].ToString(); //this.txthy_wbjsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString(); this.hy_title.Text = "回复:" + dt.Rows[0]["hy_title"].ToString(); } } //如果是转发 if (this.Request.QueryString["zfid"] != null) { HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.Request.QueryString["zfid"].ToString()); if (dt.Rows.Count > 0) { this.hy_title.Text = "转发:" + dt.Rows[0]["hy_title"].ToString(); this.hy_body.Text = dt.Rows[0]["hy_body"].ToString(); this.txtid.Value = dt.Rows[0]["docid"].ToString(); //附件 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[0]["DOCID"].ToString()); if (dt_fileatt.Rows.Count > 0) { string ls_temp = ""; for (var i = 0; i < dt_fileatt.Rows.Count; i++) { ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />"; } this.lblfileatt.Text = ls_temp; } } this.uploadfile1.Visible = false; } } } }