public async Task <ActionResult> Index(int?p, string search)
        {
            var pageIndex = p ?? 1;
            var allEmails = string.IsNullOrWhiteSpace(search)
                ? await _bannedEmailService.GetAllPaged(pageIndex, ForumConfiguration.Instance.AdminListPageSize)
                : await _bannedEmailService.GetAllPaged(search, pageIndex, ForumConfiguration.Instance.AdminListPageSize);

            var vieWModel = new BannedEmailListViewModel
            {
                Emails     = allEmails,
                PageIndex  = pageIndex,
                TotalCount = allEmails.TotalCount,
                Search     = search
            };

            return(View(vieWModel));
        }
Esempio n. 2
0
        public ActionResult Index(int?p, string search)
        {
            using (UnitOfWorkManager.NewUnitOfWork())
            {
                var pageIndex = p ?? 1;
                var allEmails = string.IsNullOrEmpty(search) ? _bannedEmailService.GetAllPaged(pageIndex, SiteConstants.Instance.AdminListPageSize) :
                                _bannedEmailService.GetAllPaged(search, pageIndex, SiteConstants.Instance.AdminListPageSize);

                var vieWModel = new BannedEmailListViewModel
                {
                    Emails     = allEmails,
                    PageIndex  = pageIndex,
                    TotalCount = allEmails.TotalCount,
                    Search     = search
                };

                return(View(vieWModel));
            }
        }