Пример #1
0
        public async Task <ActionResult> Index(string filterText, int index = 0,
                                               FilterEventOptions filterBy  = FilterEventOptions.None, bool isFirstLoad = true)
        {
            var data = await _eventService.GetPublishedEventsAsync(filterBy, filterText, Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName);

            ViewBag.Count        = data.Count();
            ViewBag.PageSize     = _eventPageSize;
            ViewBag.CurrentIndex = index;
            ViewBag.FilterOption = filterBy;
            ViewBag.FilterText   = filterText;

            if (isFirstLoad)
            {
                return(View(data.Skip(index).Take(_eventPageSize)));
            }
            else
            {
                return(PartialView("~/Views/Home/Partial/_EventList.cshtml", data.Skip(index).Take(_eventPageSize)));
            }
        }