Exemplo n.º 1
0
        protected void BindComment()
        {
            int total = 0;

            this.rptComment.DataSource = SYS_Famous_CommentBll.GetInstance().GetListByFamousSysNo(this.pageindex, this.pagesize, this.sysno, ref total);
            this.rptComment.DataBind();
            this.Pager1.url         = AppCmn.AppConfig.HomeUrl() + "Celebrity/Detail/" + Server.UrlEncode(CommonTools.Encode(this.sysno.ToString())) + "/";
            this.Pager1.totalrecord = total;
            if (total % AppConst.PageSize == 0)
            {
                this.Pager1.total = total / this.pagesize;
            }
            else
            {
                this.Pager1.total = (total / this.pagesize) + 1;
            }
            this.Pager1.index    = this.pageindex;
            this.Pager1.numlenth = 3;
        }
Exemplo n.º 2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         SYS_Famous_CommentMod m_comment = new SYS_Famous_CommentMod
         {
             Context       = base.Server.HtmlEncode(this.TextBox1.Text.Trim()),
             CustomerSysNo = base.GetSession().CustomerEntity.SysNo,
             DR            = 0,
             FamousSysNo   = this.sysno,
             TS            = DateTime.Now
         };
         SYS_Famous_CommentBll.GetInstance().Add(m_comment);
         this.BindComment();
         this.TextBox1.Text = "";
         ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "addcomment", "alert('评论发布成功!');", true);
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "addcomment", "alert('系统错误,请联系管理员!');", true);
         LogManagement.getInstance().WriteException(ex, "FamousComment-Add", base.Request.UserHostAddress, "发布评论失败");
     }
 }