Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.lblusername.Text = this.Session["hyuname"].ToString();
            this.lbldept.Text = this.Session["hydeptname"].ToString();
            this.lbldate.Text = System.DateTime.Now.ToShortDateString();

            HyoaClass.Hyoa_boke_lookinfo Hyoa_boke_lookinfo = new HyoaClass.Hyoa_boke_lookinfo();
            DataTable dt = Hyoa_boke_lookinfo.Getboke_rebackbyfatheruserid(this.Session["hyuid"].ToString());
            string lsfk = "";
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    lsfk += dt.Rows[i]["hy_djrname"].ToString() + "[" + dt.Rows[i]["fwcs"].ToString() + "次]<br>";
                }
            }
            else
            {
                lsfk = "暂无访客!";
            }

            this.lblfk.Text = lsfk;

            string lsheadpicpath = "images/tx.jpg";

            HyoaClass.Hyoa_boke_headpic Hyoa_boke_headpic = new HyoaClass.Hyoa_boke_headpic();
            DataTable dtheadpic = Hyoa_boke_headpic.Getboke_headpicbyuserid(this.Session["hyuid"].ToString());
            if (dtheadpic.Rows.Count > 0)
            {
                if (dtheadpic.Rows[0]["hy_picpath"].ToString() != "")
                {
                    lsheadpicpath = "\\" + dtheadpic.Rows[0]["hy_picpath"].ToString();
                }
                else
                {
                    lsheadpicpath = "images/tx.jpg";
                }

            }

            this.lblheadpic.Text = "<img src=\"" + lsheadpicpath + "\" width=\"180\" height=\"180\" class=\"bk\" />";

        }
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() =="")
            this.Response.Redirect("../login.aspx?url="+this.Request.RawUrl);

        if (!IsPostBack)
        {

            string lsdocic = "";
            if (this.Request.QueryString["DOCID"] != null)
            {
                lsdocic = this.Request.QueryString["DOCID"].ToString();   //是否弹出窗口
                this.txtfatherid.Value = lsdocic;
            }
            else
            {
                this.Response.Write("<script>alert('文档ID不存在,请联系管理员!')</script>");
                return;
            }
            this.txturl.Value = "detail.aspx?DOCID=" + lsdocic;     //返回URL
            HyoaClass.Hyoa_boke_main Hyoa_boke_main = new HyoaClass.Hyoa_boke_main();
            DataTable dt = Hyoa_boke_main.Getboke_mainbyDOCID(lsdocic);
            HyoaClass.Hyoa_boke_reback Hyoa_boke_reback = new HyoaClass.Hyoa_boke_reback();
            DataTable dtreback = Hyoa_boke_reback.Getboke_rebackbyfatherid(lsdocic);
            string lsreback = "";
            if (dt.Rows.Count > 0)
            {
                this.lblbt.Text = dt.Rows[0]["hy_bt"].ToString() + "&nbsp;&nbsp;[发布人:" + dt.Rows[0]["hy_djrname"].ToString() + "&nbsp;&nbsp;发布时间:" + dt.Rows[0]["hy_djsj"].ToString() + "]";
                this.lblnr.Text = dt.Rows[0]["hy_content"].ToString();

                for (int j = 0; j < dtreback.Rows.Count; j++)
                {

                    lsreback += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"xx-xb2\">";
                    lsreback += "<tr>";
                    lsreback += "<td width=30px><img src=\"images/ico-rr.jpg\" width=\"27\" height=\"17\" /></td>";
                    lsreback += "<td height=\"30\" align=left>" + dtreback.Rows[j]["hy_djrname"].ToString() + "&nbsp;&nbsp;[评论时间:" + dtreback.Rows[j]["hy_djsj"].ToString() + "&nbsp;&nbsp;IP:" + dtreback.Rows[j]["hy_ip"].ToString() + "]" + "</td>";
                    lsreback += "</tr>";
                    lsreback += "<tr>";
                    lsreback += "<td>&nbsp;</td>";
                    lsreback += "<td>" + dtreback.Rows[j]["hy_content"].ToString() + "</td>";
                    lsreback += "</tr>";
                    lsreback += "</table>";
                }

                //向查看表中插入查看人员的记录
                HyoaClass.Hyoa_boke_lookinfo Hyoa_boke_lookinfo = new HyoaClass.Hyoa_boke_lookinfo();
                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                Hyoa_boke_lookinfo.DOCID = Hyoa_global.GetRandom();
                Hyoa_boke_lookinfo.hy_fatherid = this.txtfatherid.Value;
                Hyoa_boke_lookinfo.hy_fatheruserid = dt.Rows[0]["hy_djrid"].ToString();
                Hyoa_boke_lookinfo.hy_fatherusername = dt.Rows[0]["hy_djrname"].ToString();
                Hyoa_boke_lookinfo.hy_djsj = System.DateTime.Now.ToString();
                Hyoa_boke_lookinfo.hy_djrid = this.Session["hyuid"].ToString();
                Hyoa_boke_lookinfo.hy_djrname = this.Session["hyuname"].ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];  //得到客户端IP
                }
                Hyoa_boke_lookinfo.hy_ip = userip;
                Hyoa_boke_lookinfo.Insert();

            }

            this.lblreback.Text = lsreback;

        }
    }