protected void Page_Load(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() =="") this.Response.Redirect("../login.aspx?url="+this.Request.RawUrl); if (this.Request.QueryString["recuserid"] != null) { recuserid = this.Request.QueryString["recuserid"].ToString(); //得到接收人ID this.txtrecuserid.Text = recuserid; } //if (this.Request.QueryString["recusername"] != null) //{ // recusername = this.Request.QueryString["recusername"].ToString(); //得到接收人姓名 // this.txtrecusername.Text = recusername; //} //得到中文名start string[] lv_recuserid; lv_recuserid = recuserid.Split(','); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); for (int j = 0; j < lv_recuserid.Length; j++) { DataTable dtuser = Hyoa_user.Getuserbyloginid(lv_recuserid[j]); for (int m = 0; m < dtuser.Rows.Count; m++) { if (recusername == "") { recusername = dtuser.Rows[m]["hy_username"].ToString(); } else { recusername += "," + dtuser.Rows[m]["hy_username"].ToString(); } } } this.txtrecusername.Text = recusername; //得到中文名end if (!IsPostBack) { this.lbljsrname.Text = recusername; //显示接收人性名 //显示上面部分start HyoaClass.Hyoa_jstx_info Hyoa_jstx_info = new HyoaClass.Hyoa_jstx_info(); DataTable dt_getinfo = Hyoa_jstx_info.GetDocBySenduserid_Receiveuserid_top6(this.Session["hyuid"].ToString(),recuserid); string lsinfo = ""; string lscontent = ""; if (dt_getinfo.Rows.Count > 0) { for (int i = dt_getinfo.Rows.Count-1; i >=0; i--) { lsinfo += "<br>" + dt_getinfo.Rows[i]["hy_sendinfo_username"].ToString() + " " + dt_getinfo.Rows[i]["hy_sendinfo_date"].ToString(); lscontent = dt_getinfo.Rows[i]["hy_content"].ToString(); //lscontent = lscontent.Replace("|#", "<img src='images_main/qq/"); //lscontent = lscontent.Replace("gif#", "gif' />"); if (dt_getinfo.Rows[i]["hy_fileattpath"].ToString() != "") lscontent = "<a href='/" + dt_getinfo.Rows[i]["hy_fileattpath"].ToString() + "' target='_blank'><font color=red>" + lscontent + "</font></a>"; lsinfo += "<br>" + lscontent; } } this.hy_content_display.Text = lsinfo; //显示上面部分end Hyoa_jstx_info.Update_readlist(this.Session["hyuid"].ToString(), recuserid);//置当前用户为已读用户 } }
private void DataPlay() { this.ddlisenabled.Items.Insert(0, "是"); this.ddlisenabled.Items.Insert(1, "否"); if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 this.btn_submit.Visible = true; //保存 if (this.Request.QueryString["op"] == "add") { HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt2 = Hyoa_user.Getuserbyloginid(this.Session["hyuid"].ToString()); this.txthy_sqrid.Value = this.Session["hyuid"].ToString(); this.txthy_sqrname.Text = dt2.Rows[0]["hy_username"].ToString(); this.txtcurdate.Value = System.DateTime.Now.ToString("yyyy-MM-dd"); dt2.Clear(); } //旧文档 if (this.Request.QueryString["op"] == "modify") { if (this.Request.QueryString["id"] != null) { //根据id得到信息 this.txtdocid.Value = this.Request.QueryString["id"].ToString(); HyoaClass.Hyoa_license Hyoa_license = new HyoaClass.Hyoa_license(); DataTable dt = Hyoa_license.Getlicense(this.txtdocid.Value); if (dt.Rows.Count > 0) { this.txthy_sqrid.Value = dt.Rows[0]["hy_sqrid"].ToString(); this.txthy_sqrname.Text = dt.Rows[0]["hy_sqrname"].ToString(); this.txthy_bsqrid.Value = dt.Rows[0]["hy_bsqrid"].ToString(); this.txthy_bsqrname.Value = dt.Rows[0]["hy_bsqrname"].ToString(); this.txthy_starttime.Value = Convert.ToDateTime(dt.Rows[0]["hy_starttime"].ToString()).ToString("yyyy-MM-dd"); this.txthy_endtime.Value = Convert.ToDateTime(dt.Rows[0]["hy_endtime"].ToString()).ToString("yyyy-MM-dd"); if (dt.Rows[0]["hy_isenabled"].ToString() == "是") this.ddlisenabled.SelectedIndex = 0; else this.ddlisenabled.SelectedIndex = 1; } //this.txthy_bsqrname.Enabled = false; //this.txthy_starttime.Enabled = false; //this.txthy_endtime.Enabled = false; this.btnstartdate.Visible = false; this.btnenddate.Visible = false; //this.bt this.btnseluser.Visible = false; dt.Clear(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); if (this.Request.QueryString["recuserid"] != null) { recuserid = this.Request.QueryString["recuserid"].ToString(); //得到接收人ID } //if (this.Request.QueryString["recusername"] != null) //{ // recusername = this.Request.QueryString["recusername"].ToString(); //得到接收人姓名 //} //得到中文名start string[] lv_recuserid; lv_recuserid = recuserid.Split(','); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); for (int j = 0; j < lv_recuserid.Length; j++) { DataTable dtuser = Hyoa_user.Getuserbyloginid(lv_recuserid[j]); for (int m = 0; m < dtuser.Rows.Count; m++) { if (recusername == "") { recusername = dtuser.Rows[m]["hy_username"].ToString(); } else { recusername += "," + dtuser.Rows[m]["hy_username"].ToString(); } } } //得到中文名end if (!this.IsPostBack) { if (this.Request.QueryString["pop"] != null) { this.txtifpop.Value = this.Request.QueryString["pop"].ToString(); //是否弹出窗口 } if (this.Request.QueryString["fatherid"] != null) { this.txtfatherid.Value = this.Request.QueryString["fatherid"].ToString(); //是否弹出窗口 } if (this.Request.QueryString["url"] != null) { //this.txturl.Value = this.Request.QueryString["url"].ToString(); //返回URL string ls_url = this.Request.Url.ToString(); this.txturl.Value = ls_url.Substring(ls_url.LastIndexOf("url=") + 4, ls_url.Length - ls_url.LastIndexOf("url=") - 4); //返回URL } DataPlay(); } }