Ejemplo n.º 1
0
        /// <summary>
        /// We get here via the admin default layout (_AdminLayout). The returned view is displayed by
        /// the @RenderBody in that layout
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(int?p, string search)
        {
            var pageIndex = p ?? 1;

            using (UnitOfWorkManager.NewUnitOfWork())
            {
                var allBadges = string.IsNullOrEmpty(search) ? _badgeService.GetPagedGroupedBadges(pageIndex, AppConstants.AdminListPageSize) :
                                _badgeService.SearchPagedGroupedTags(search, pageIndex, AppConstants.AdminListPageSize);

                var badgesListModel = new ListBadgesViewModel
                {
                    Badges     = allBadges,
                    PageIndex  = pageIndex,
                    TotalCount = allBadges.TotalCount,
                    Search     = search
                };

                return(View(badgesListModel));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     We get here via the admin default layout (_AdminLayout). The returned view is displayed by
        ///     the @RenderBody in that layout
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> Index(int?p, string search)
        {
            var pageIndex = p ?? 1;


            var allBadges = string.IsNullOrWhiteSpace(search)
                ? await _badgeService.GetPagedGroupedBadges(pageIndex, ForumConfiguration.Instance.AdminListPageSize)
                : await _badgeService.SearchPagedGroupedTags(search, pageIndex,
                                                             ForumConfiguration.Instance.AdminListPageSize);

            var badgesListModel = new ListBadgesViewModel
            {
                Badges     = allBadges,
                PageIndex  = pageIndex,
                TotalCount = allBadges.TotalCount,
                Search     = search
            };

            return(View(badgesListModel));
        }