Beispiel #1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            this.ddlProperty.SelectedValue = this.property;
            this.txtKeywords.Text          = this.keywords;
            BLL.comment bll = new BLL.comment();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&keywords={1}&property={2}&page={3}",
                                              this.channel_id.ToString(), this.keywords, this.property, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
        private void comment_list(HttpContext context)
        {
            int           _channel_id = DTRequest.GetQueryInt("channel_id");
            int           _content_id = DTRequest.GetQueryInt("content_id");
            int           _page_index = DTRequest.GetQueryInt("page_index");
            int           _page_size  = DTRequest.GetQueryInt("page_size");
            int           totalcount;
            StringBuilder strTxt = new StringBuilder();

            if (_channel_id == 0 || _content_id == 0 || _page_size == 0)
            {
                context.Response.Write("获取失败,传输参数有误!");
                return;
            }

            BLL.comment bll = new BLL.comment();
            DataSet     ds  = bll.GetList(_page_size, _page_index, string.Format("is_lock=0 and channel_id={0} and content_id={1}", _channel_id.ToString(), _content_id.ToString()), "add_time desc", out totalcount);

            //如果记录存在
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];
                    strTxt.Append("<li>\n");
                    strTxt.Append("<div class=\"title\"><span>" + dr["add_time"] + "</span>" + dr["user_name"] + "</div>");
                    strTxt.Append("<div class=\"box\">" + dr["content"] + "</div>");
                    if (Convert.ToInt32(dr["is_reply"]) == 1)
                    {
                        strTxt.Append("<div class=\"reply\">");
                        strTxt.Append("<strong>管理员回复:</strong>" + dr["reply_content"].ToString());
                        strTxt.Append("<span class=\"time\">" + dr["reply_time"].ToString() + "</span>");
                        strTxt.Append("</div>");
                    }
                    strTxt.Append("</li>\n");
                }
            }
            else
            {
                strTxt.Append("<p>暂无评论,快来抢沙发吧!</p>");
            }
            context.Response.Write(strTxt.ToString());
        }
        private void comment_list(HttpContext context)
        {
            int _channel_id = DTRequest.GetQueryInt("channel_id");
            int _content_id = DTRequest.GetQueryInt("content_id");
            int _page_index = DTRequest.GetQueryInt("page_index");
            int _page_size = DTRequest.GetQueryInt("page_size");
            int totalcount;
            StringBuilder strTxt = new StringBuilder();

            if (_channel_id == 0 || _content_id == 0 || _page_size == 0)
            {
                context.Response.Write("获取失败,传输参数有误!");
                return;
            }

            BLL.comment bll = new BLL.comment();
            DataSet ds = bll.GetList(_page_size, _page_index, string.Format("is_lock=0 and channel_id={0} and content_id={1}", _channel_id.ToString(), _content_id.ToString()), "add_time desc", out totalcount);
            //如果记录存在
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];
                    strTxt.Append("<li>\n");
                    strTxt.Append("<div class=\"title\"><span>" + dr["add_time"] + "</span>" + dr["user_name"] + "</div>");
                    strTxt.Append("<div class=\"box\">" + dr["content"] + "</div>");
                    if (Convert.ToInt32(dr["is_reply"]) == 1)
                    {
                        strTxt.Append("<div class=\"reply\">");
                        strTxt.Append("<strong>管理员回复:</strong>" + dr["reply_content"].ToString());
                        strTxt.Append("<span class=\"time\">" + dr["reply_time"].ToString() + "</span>");
                        strTxt.Append("</div>");
                    }
                    strTxt.Append("</li>\n");
                }
            }
            else
            {
                strTxt.Append("<p>暂无评论,快来抢沙发吧!</p>");
            }
            context.Response.Write(strTxt.ToString());
        }
Beispiel #4
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            this.ddlProperty.SelectedValue = this.property;
            this.txtKeywords.Text = this.keywords;
            BLL.comment bll = new BLL.comment();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&keywords={1}&property={2}&page={3}",
                this.channel_id.ToString(), this.keywords, this.property, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }