Beispiel #1
0
 private void BindSearch()
 {
     ArticleQuery articleQuery = new ArticleQuery();
     articleQuery.StartArticleTime = this.startArticleTime;
     articleQuery.EndArticleTime = this.endArticleTime;
     articleQuery.Keywords = Globals.HtmlEncode(this.keywords);
     articleQuery.CategoryId = this.categoryId;
     articleQuery.PageIndex = this.pager.PageIndex;
     articleQuery.PageSize = this.pager.PageSize;
     articleQuery.SortBy = this.grdArticleList.SortOrderBy;
     articleQuery.SortOrder = SortAction.Desc;
     DbQueryResult articleList = SubsiteCommentsHelper.GetArticleList(articleQuery);
     this.grdArticleList.DataSource = articleList.Data;
     this.grdArticleList.DataBind();
     this.pager.TotalRecords = articleList.TotalRecords;
     this.pager1.TotalRecords = articleList.TotalRecords;
 }
Beispiel #2
0
 private void BindSearch()
 {
     ArticleQuery articleQuery = new ArticleQuery();
     articleQuery.StartArticleTime = startArticleTime;
     articleQuery.EndArticleTime = endArticleTime;
     articleQuery.Keywords = Globals.HtmlEncode(keywords);
     articleQuery.CategoryId = categoryId;
     articleQuery.PageIndex = pager.PageIndex;
     articleQuery.PageSize = pager.PageSize;
     articleQuery.SortBy = grdArticleList.SortOrderBy;
     articleQuery.SortOrder = SortAction.Desc;
     DbQueryResult articleList = ArticleHelper.GetArticleList(articleQuery);
     grdArticleList.DataSource = articleList.Data;
     grdArticleList.DataBind();
     pager.TotalRecords = articleList.TotalRecords;
     pager1.TotalRecords = articleList.TotalRecords;
 }
Beispiel #3
0
 void BindList()
 {
     ArticleQuery articleQuery = new ArticleQuery();
     if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"]))
     {
         int result = 0;
         if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out result))
         {
             articleQuery.CategoryId = new int?(result);
         }
     }
     articleQuery.PageIndex = this.pager.PageIndex;
     articleQuery.SortBy = "AddedDate";
     articleQuery.SortOrder = SortAction.Desc;
     DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery);
     this.rptArticles.DataSource = articleList.Data;
     this.rptArticles.DataBind();
     this.pager.TotalRecords = articleList.TotalRecords;
 }
Beispiel #4
0
 public static DbQueryResult GetArticleList(ArticleQuery articleQuery)
 {
     return CommentProvider.Instance().GetArticleList(articleQuery);
 }
Beispiel #5
0
 public override DbQueryResult GetArticleList(ArticleQuery articleQuery)
 {
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat("Title LIKE '%{0}%'", DataHelper.CleanSearchString(articleQuery.Keywords));
     if (articleQuery.CategoryId.HasValue)
     {
         builder.AppendFormat(" AND CategoryId = {0}", articleQuery.CategoryId.Value);
     }
     if (articleQuery.StartArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate >= '{0}'", articleQuery.StartArticleTime.Value);
     }
     if (articleQuery.EndArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate <= '{0}'", articleQuery.EndArticleTime.Value);
     }
     return DataHelper.PagingByRownumber(articleQuery.PageIndex, articleQuery.PageSize, articleQuery.SortBy, articleQuery.SortOrder, articleQuery.IsCount, "vw_Hishop_Articles", "ArticleId", builder.ToString(), "*");
 }
Beispiel #6
0
 public abstract DbQueryResult GetArticleList(ArticleQuery articleQuery);
Beispiel #7
0
 public override DbQueryResult GetArticleList(ArticleQuery articleQuery)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(" IsRelease=1 ");
     if (!string.IsNullOrEmpty(articleQuery.Keywords))
     {
         builder.AppendFormat(" AND Title LIKE '%{0}%'", articleQuery.Keywords);
     }
     if (articleQuery.CategoryId.HasValue)
     {
         builder.AppendFormat(" AND CategoryId = {0}", articleQuery.CategoryId.Value);
     }
     if (articleQuery.StartArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate >= '{0}'", articleQuery.StartArticleTime.Value);
     }
     if (articleQuery.EndArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate <= '{0}'", articleQuery.EndArticleTime.Value);
     }
     builder.AppendFormat(" AND DistributorUserId = {0} ", HiContext.Current.SiteSettings.UserId.Value);
     return DataHelper.PagingByRownumber(articleQuery.PageIndex, articleQuery.PageSize, articleQuery.SortBy, articleQuery.SortOrder, articleQuery.IsCount, "vw_distro_Articles", "ArticleId", builder.ToString(), "*");
 }