private void BindData() { #region 组装查询条件 string whereStr = " 1 = 1 "; string _keywords = keywords.Replace("'", ""); if (!string.IsNullOrEmpty(_keywords)) { if (Utils.IsSafeSqlString(_keywords)) { whereStr += " and (Title like '%" + _keywords + "%')"; } else { JscriptMsg("搜索关键词中包含危险字符,检索终止!", Utils.CombUrlTxt("Manage.aspx", "keywords={0}", "")); return; } } #endregion this.page = RequestHelper.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.classroom_user bll = new BLL.classroom_user(); this.rptList.DataSource = bll.GetListByPage(whereStr, "ID DESC", this.page, this.pageSize); this.rptList.DataBind(); this.totalCount = bll.GetRecordCount(whereStr); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("Manage.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void BindData() { #region 组装查询条件 string whereStr = " 1 = 1 "; if (this.class_id > 0) { this.ddlClassroom.SelectedValue = this.class_id + ""; } else { this.class_id = Convert.ToInt32(this.ddlClassroom.SelectedValue); } whereStr += " and classroom_id = " + this.class_id; string _keywords = keywords.Replace("'", ""); if (!string.IsNullOrEmpty(_keywords)) { if (Utils.IsSafeSqlString(_keywords)) { whereStr += " and (Title like '%" + _keywords + "%')"; } else { JscriptMsg("搜索关键词中包含危险字符,检索终止!", Utils.CombUrlTxt("verify_list.aspx", "keywords={0}&class_id={1}", "", this.class_id + "")); return; } } #endregion this.page = RequestHelper.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.classroom_user bll = new BLL.classroom_user(); this.rptList.DataSource = bll.GetListByPage("*", "View_ClassroomVerify", whereStr, "add_time desc", this.page, this.pageSize); this.rptList.DataBind(); this.totalCount = bll.GetRecordCount("View_ClassroomVerify", whereStr); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("verify_list.aspx", "keywords={0}&page={1}&class_id={2}", this.keywords, "__id__", this.class_id + ""); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }