Esempio n. 1
0
        void Bind()
        {
            string    memberId = Convert.ToString(Request["memberId"]);
            DataTable dt;

            if (memberId != null)
            {
                dt = MemberManagement.SelectSixTable(memberId);
                if (dt.Rows.Count == 0)
                {
                    SomeMethod.PrintMsgToClient(this.ClientScript, "未查找到相关会员的信息");
                    return;
                }
                string pic = SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]);        //获取图片路径
                divPic.Attributes.Add("style", "background-image:url(" + pic + ");"); //添加背景图片

                hlkSendMsg.NavigateUrl = "~/MyMessage.aspx?recipient=" + Convert.ToString(dt.Rows[0]["member_id"]);
                lblConcernNum.Text     = Convert.ToString(dt.Rows[0]["concern_num"]);
                lblFans.Text           = Convert.ToString(dt.Rows[0]["fans"]);
                lblMotto.Text          = Convert.ToString(dt.Rows[0]["motto"]);
                lblName.Text           = Convert.ToString(dt.Rows[0]["name"]);
                lblPubCriticism.Text   = "发表评论:" + Convert.ToString(dt.Rows[0]["criticism_num"]) + "  ";
                lblPubTheme.Text       = "发表主题:" + Convert.ToString(dt.Rows[0]["theme_num"]);
            }
        }
Esempio n. 2
0
        void Bind()
        {
            DataTable dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"]));

            if (dt.Rows.Count != 0)
            {
                pic.Attributes.Add("style", "background-image:url(../" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");");
            }
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //【1】绑定头像
     if (Session["memberId"] != null)
     {
         DataTable dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"]));
         if (dt.Rows.Count == 1)
         {
             imgHeadPic.ImageUrl = SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]);
         }
     }
 }
Esempio n. 4
0
        void Bind()
        {
            DataTable dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"]));

            if (dt.Rows.Count > 0)
            {
                pic.Attributes.Add("style", "background-image:url(" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");");
            }
            int           col = 3;//定义一行中显示的版块数
            StringBuilder sb  = new StringBuilder();

            #region 动态生成版块列表
            dt = DivisionManagement.ShowAll();
            sb.Append("<table>");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (i % col == 0)
                {
                    sb.Append("<tr>");
                }
                //<td>
                //        <a href="ThemeList.aspx?divisionName=游戏">
                //            <img src="Image/Login/bg.jpg" />
                //        </a>
                //</td>
                sb.Append("<td><a href=\"ThemeList.aspx?divisionName=");
                sb.Append(dt.Rows[i]["division_name"]);                           //板块
                sb.Append("\"><img src=\"");
                sb.Append("Image/DivisionPic/" + dt.Rows[i]["division_picture"]); //图片
                sb.Append("\" title=\"");
                sb.Append(dt.Rows[i]["division_name"]);
                sb.Append("\" /></a></td>");
                if ((i + 1) % col == 0)
                {
                    sb.Append("</tr>");
                }
            }
            sb.Append("</table>");
            #endregion
            List.InnerHtml = Convert.ToString(sb);
        }
Esempio n. 5
0
        void Bind()
        {
            DataTable dt = UserInfoManagement.SelectInfo(Convert.ToString(Session["memberId"]));

            if (dt.Rows.Count == 1)
            {
                adress.Value          = Convert.ToString(dt.Rows[0]["Addr"]);
                age.Value             = Convert.ToString(dt.Rows[0]["Age"]);
                email.Value           = Convert.ToString(dt.Rows[0]["Email"]);
                job.Value             = Convert.ToString(dt.Rows[0]["Job"]);
                motto.Value           = Convert.ToString(dt.Rows[0]["Motto"]);
                realname.Value        = Convert.ToString(dt.Rows[0]["Name"]);
                phone.Value           = Convert.ToString(dt.Rows[0]["Tel"]);
                radlSex.SelectedValue = Convert.ToString(dt.Rows[0]["Sex"]);
            }
            username.Value = Convert.ToString(Session["UserName"]);                 //绑定用户名

            dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"])); //绑定头像
            if (dt.Rows.Count == 1)
            {
                pic.Attributes.Add("style", "background-image:url(" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");");
            }
        }
Esempio n. 6
0
        void Bind()//绑定数据
        {
            if (Request.QueryString["themeId"] != null)
            {
                if (Request["path"] != null)
                {
                    lbtnPath.Text = Convert.ToString(Request["path"]).Trim();//设置上一级的路径
                }
                Theme theme = new Theme()
                {
                    ThemeId = Convert.ToString(Request.QueryString["themeId"])
                };
                if (theme.IsError)
                {
                    Msg = "参数格式错误";
                    printMsgToClient();
                    return;
                }
                #region 动态生成主题
                dt = ThemeManagement.SelectByThemeId(theme.ThemeId);
                if (dt.Rows.Count == 1)
                {
                    ThemeId.Text                = "【" + Convert.ToString(dt.Rows[0]["theme_id"]) + "】" + Convert.ToString(dt.Rows[0]["title"]);//标题
                    MemberId.InnerHtml          = Convert.ToString(dt.Rows[0]["creator"]);
                    MemberId.HRef               = "~/Others.aspx?memberId=" + Convert.ToString(dt.Rows[0]["creator"]);
                    xp.Attributes["style"]      = "background-image:url(" + SomeMethod.GetLevelPicPath(dt.Rows[0]["xp"]) + ");";     //等级图标
                    text.InnerHtml              = Server.UrlDecode(Convert.ToString(dt.Rows[0]["theme_text"]));                      //主题内容
                    lblPublishiTime.Text        = "发表于:" + Convert.ToString(dt.Rows[0]["publish_time"]);                             //发布时间
                    picture.Attributes["style"] = "background-image:url(" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");"; //头像

                    UserName.InnerHtml = Convert.ToString(dt.Rows[0]["name"]);                                                       //查找用户名
                }
                else
                {
                    Msg = "主题不存在";
                    printMsgToClient();
                    return;
                }
                #endregion
                #region 动态生成评论
                dt = CriticismManagement.SelectByThemeId(theme.ThemeId);
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    #region 生成一条评论并显示
                    //生成如下html代码
                    //<div class="tr">
                    //<div class="left">
                    //    <img class="pic" src="头像路径">
                    //    <div class="person">
                    //        <a href="#">账号</a>
                    //        <a href="javascript:__doPostBack('addConcern','');" onclick="concernClick()" runat="server" onserverclick="Unnamed_ServerClick"><img src="Image/ThemeDisplay/关注.png" style="width: 40px; height: 20px;" /></a>
                    //    </div>
                    //    <div>
                    //        <div class="name" style="text-align: left;">用户名</div>
                    //        <img class="lv" src="等级图片路径"/>
                    //    </div>
                    //</div>
                    //<div class="right">
                    //    <div class="text"></div>
                    //    <div class="operate">
                    //        <input type="hidden" value="评论的编号" />
                    //        <div class="lblPublishiTime">发布时间</div>
                    //        <a class="pic1" href="javascript:void(0)" onclick="reportClick()"><img src="Image/ThemeDisplay/举报.png"/></a>
                    //        <a class="pic2" href="javascript:void(0)" onclick="criticismClick()"><img src="Image/ThemeDisplay/评论.png"/></a>
                    //    </div>
                    //</div>
                    //</div>

                    sb.Append("<div class=\"tr\">");
                    sb.Append("<div class=\"left\"><img class=\"pic\" src=\"");
                    sb.Append(SomeMethod.GetUserPicPath(dt.Rows[i]["picture"]));                    //头像路径
                    sb.Append("\"/><div class=\"person\"><a href=\"");
                    sb.Append("Others.aspx?memberId=" + Convert.ToString(dt.Rows[0]["member_id"])); //账号链接路径
                    sb.Append("\">");
                    sb.Append(dt.Rows[i]["member_id"]);                                             //账号
                    sb.Append("</a><a href=\"javascript:__doPostBack('addConcern','');\" onclick=\"concernClick()\" runat=\"server\" onserverclick=\"Unnamed_ServerClick\"><img src=\"Image/ThemeDisplay/关注.png\" style=\"width: 40px; height: 20px;\" /></a></div><div><div class=\"name\" style=\"text-align: left;\">");
                    sb.Append(Convert.ToString(dt.Rows[0]["name"]));                                //用户名
                    sb.Append("</div><img class=\"lv\" src=\"");
                    sb.Append(SomeMethod.GetLevelPicPath(dt.Rows[i]["xp"]));                        //等级图片路径
                    sb.Append("\"/></div></div><div class=\"right\"><div class=\"text\"><p>");
                    sb.Append(Server.UrlDecode(Convert.ToString(dt.Rows[i]["criticism_text"])));    //评论
                    sb.Append("</p></div><div class=\"operate\"><input type=\"hidden\" value=\"");
                    sb.Append(dt.Rows[i]["criticism_id"]);                                          //评论编号
                    sb.Append("\" /><div class=\"lblPublishiTime\">发表于:");
                    sb.Append(dt.Rows[i]["publish_time"]);                                          //发布时间
                    sb.Append("</div><a class=\"pic1\" href=\"javascript:void(0)\" onclick=\"reportClick()\"><img src=\"Image/ThemeDisplay/举报.png\" style=\"width: 30px; height: 30px\"/></a><a href=\"javascript:void(0)\" onclick=\"criticismClick()\"><img class=\"pic2\" src=\"Image/ThemeDisplay/评论.png\" style=\"width: 30px; height: 30px\" /></a></div></div></div>");
                    #endregion
                }
                criticisms.InnerHtml = sb.ToString();
                #endregion
            }
        }