public override void DataBind() { CustomPageQuery query = new CustomPageQuery { Name = this.Page.Request.QueryString["Name"], Status = new int?(this.status), PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize }; DbQueryResult pages = CustomPageHelp.GetPages(query); this.Repeater1.DataSource = pages.Data; this.Repeater1.DataBind(); this.pager.TotalRecords = pages.TotalRecords; }
public DbQueryResult GetPages(CustomPageQuery query) { StringBuilder builder = new StringBuilder(); builder.AppendFormat(" Status={0} ", query.Status); if (!string.IsNullOrEmpty(query.Name)) { builder.AppendFormat(" And Name LIKE '%{0}%'", DataHelper.CleanSearchString(query.Name)); } if (query.Status.HasValue) { builder.AppendFormat(" And Status = {0}", query.Status.Value); } return(DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "Hishop_CustomPage", "Id", builder.ToString(), "*")); }
public static DbQueryResult GetPages(CustomPageQuery query) { return((new CustomPageDao()).GetPages(query)); }