public ActionResult ManageTags([DefaultValue(1)] int page) { var allTags = _tagRepository.GetAllTags(); var tagModel = new AdminTagsViewModel { Tags = allTags.Skip((page - 1) * _itemsPerPage).Take(_itemsPerPage).ToList(), PagingInfo = new PagingInformation { CurrentPage = page, ItemsPerPage = _itemsPerPage, TotalItems = allTags.Count }, OneTimeCode = GetToken(), Title = SettingsRepository.BlogName }; return View(tagModel); }
public ActionResult ManageTags([DefaultValue(1)] int page) { if (!User.IsInRole("SuperAdmin") && !User.IsInRole("Admin")) { return RedirectToAction("Index", "Home", new { Area = "" }); } var allTags = _tagRepository.GetAllTags(); var tagModel = new AdminTagsViewModel { Tags = allTags.Skip((page - 1) * _itemsPerPage).Take(_itemsPerPage).ToList(), PagingInfo = new PagingInformation { CurrentPage = page, ItemsPerPage = _itemsPerPage, TotalItems = allTags.Count }, OneTimeCode = GetToken(), Title = SettingsRepository.BlogName }; return View(tagModel); }