Exemplo n.º 1
0
 HelpQuery GetHelpQuery()
 {
     HelpQuery query = new HelpQuery();
     if (!string.IsNullOrEmpty(this.Page.Request.QueryString["categoryId"]))
     {
         int result = 0;
         if (int.TryParse(this.Page.Request.QueryString["categoryId"], out result))
         {
             query.CategoryId = new int?(result);
         }
     }
     query.PageIndex = this.pager.PageIndex;
     query.PageSize = this.pager.PageSize;
     query.SortBy = "AddedDate";
     query.SortOrder = SortAction.Desc;
     return query;
 }
Exemplo n.º 2
0
 private void BindSearch()
 {
     HelpQuery helpQuery = new HelpQuery();
     helpQuery.StartArticleTime = this.startTime;
     helpQuery.EndArticleTime = this.endTime;
     helpQuery.Keywords = Globals.HtmlEncode(this.keywords);
     helpQuery.CategoryId = this.categoryId;
     helpQuery.PageIndex = this.pager.PageIndex;
     helpQuery.PageSize = this.pager.PageSize;
     helpQuery.SortBy = this.grdHelpList.SortOrderBy;
     helpQuery.SortOrder = SortAction.Desc;
     DbQueryResult helpList = SubsiteCommentsHelper.GetHelpList(helpQuery);
     this.grdHelpList.DataSource = helpList.Data;
     this.grdHelpList.DataBind();
     this.pager.TotalRecords = helpList.TotalRecords;
     this.pager1.TotalRecords = helpList.TotalRecords;
 }
Exemplo n.º 3
0
 private void BindSearch()
 {
     HelpQuery helpQuery = new HelpQuery();
     helpQuery.StartArticleTime = startTime;
     helpQuery.EndArticleTime = endTime;
     helpQuery.Keywords = Globals.HtmlEncode(keywords);
     helpQuery.CategoryId = categoryId;
     helpQuery.PageIndex = pager.PageIndex;
     helpQuery.PageSize = pager.PageSize;
     helpQuery.SortBy = grdHelpList.SortOrderBy;
     helpQuery.SortOrder = SortAction.Desc;
     DbQueryResult helpList = ArticleHelper.GetHelpList(helpQuery);
     grdHelpList.DataSource = helpList.Data;
     grdHelpList.DataBind();
     pager.TotalRecords = helpList.TotalRecords;
     pager1.TotalRecords = helpList.TotalRecords;
 }
Exemplo n.º 4
0
 public static DbQueryResult GetHelpList(HelpQuery helpQuery)
 {
     return CommentProvider.Instance().GetHelpList(helpQuery);
 }
Exemplo n.º 5
0
 public override DbQueryResult GetHelpList(HelpQuery helpQuery)
 {
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat("Title LIKE '%{0}%'", DataHelper.CleanSearchString(helpQuery.Keywords));
     if (helpQuery.CategoryId.HasValue)
     {
         builder.AppendFormat(" AND CategoryId = {0}", helpQuery.CategoryId.Value);
     }
     if (helpQuery.StartArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate >= '{0}'", helpQuery.StartArticleTime.Value);
     }
     if (helpQuery.EndArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate <= '{0}'", helpQuery.EndArticleTime.Value);
     }
     return DataHelper.PagingByTopnotin(helpQuery.PageIndex, helpQuery.PageSize, helpQuery.SortBy, helpQuery.SortOrder, helpQuery.IsCount, "vw_Hishop_Helps", "HelpId", builder.ToString(), "*");
 }
Exemplo n.º 6
0
 public abstract DbQueryResult GetHelpList(HelpQuery helpQuery);
Exemplo n.º 7
0
 public override DbQueryResult GetHelpList(HelpQuery helpQuery)
 {
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat("Title LIKE '%{0}%'", helpQuery.Keywords);
     if (helpQuery.CategoryId.HasValue)
     {
         builder.AppendFormat(" AND CategoryId = {0}", helpQuery.CategoryId.Value);
     }
     if (helpQuery.StartArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate >= '{0}'", helpQuery.StartArticleTime.Value);
     }
     if (helpQuery.EndArticleTime.HasValue)
     {
         builder.AppendFormat(" AND AddedDate <= '{0}'", helpQuery.EndArticleTime.Value);
     }
     builder.AppendFormat(" AND DistributorUserId = {0}", HiContext.Current.SiteSettings.UserId.Value);
     return DataHelper.PagingByTopnotin(helpQuery.PageIndex, helpQuery.PageSize, helpQuery.SortBy, helpQuery.SortOrder, helpQuery.IsCount, "vw_distro_Helps", "HelpId", builder.ToString(), "*");
 }