private ActionResult GetIndexView(ArticlesRequest request) { var hvm = new EntriesVM(); hvm.Request = request; if (!request.SearchQuery.IsNullOrEmpty()) { var isPro = PaymentService.IsPro(CurrentUser); if (!isPro) { var numberOfSearchesAlready = FeedService.GetUserSearchesForDate(CurrentUser); if (numberOfSearchesAlready >= NumberOfFreeSearches) { hvm.ExcededFreeSearchCount = true; } } FeedService.AddSearch(request.SearchQuery, CurrentUser); } if (!hvm.ExcededFreeSearchCount) { hvm.Articles = FeedService.GetArticles(request); } SaveRequestToCookie(); hvm.CurrentUser = CurrentUser; return(View("Index", hvm)); }
public static IHtmlString _GetPreviousPage(this HtmlHelper helper, EntriesVM entriesVM) { return(GetUrl(entriesVM.Page - 1)); }
public static IHtmlString _GetNextPage(this HtmlHelper helper, EntriesVM entriesVM) { return(GetUrl(entriesVM.Page + 1)); }