示例#1
0
        public ActionResult Tags()
        {
            var allTags = _utilityManager.GetAllTags().Include(n => n.SessionTags).ToList();

            var viewmodel = new AdminTagsViewModel()
            {
                Tags = allTags
            };

            return(View(viewmodel));
        }
示例#2
0
        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));
        }