public DbQueryResult GetAfficheList(AfficheQuery afficheQuery) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("Title LIKE '%{0}%'", DataHelper.CleanSearchString(afficheQuery.Keywords)); if (afficheQuery.StartArticleTime.HasValue) { stringBuilder.AppendFormat(" AND AddedDate >= '{0}'", afficheQuery.StartArticleTime.Value); } if (afficheQuery.EndArticleTime.HasValue) { stringBuilder.AppendFormat(" AND AddedDate <= '{0}'", afficheQuery.EndArticleTime.Value); } return(DataHelper.PagingByRownumber(afficheQuery.PageIndex, afficheQuery.PageSize, afficheQuery.SortBy, afficheQuery.SortOrder, afficheQuery.IsCount, "Ecshop_Affiche", "AfficheId", stringBuilder.ToString(), "*")); }
private void BindList() { AfficheQuery articleQuery = new AfficheQuery(); /*if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"])) * { * int value = 0; * if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out value)) * { * articleQuery.CategoryId = new int?(value); * } * }//CommentBrowser.GetArticleList(articleQuery);*/ articleQuery.PageIndex = this.pager.PageIndex; articleQuery.PageSize = this.pager.PageSize; articleQuery.SortBy = "AddedDate"; articleQuery.SortOrder = SortAction.Desc; DbQueryResult articleList = CommentBrowser.GetAfficheList(articleQuery); this.rptArticles.DataSource = articleList.Data; this.rptArticles.DataBind(); this.pager.TotalRecords = articleList.TotalRecords; }
public static DbQueryResult GetAfficheList(AfficheQuery afficheQuery) { return(new AfficheDao().GetAfficheList(afficheQuery)); }