Пример #1
0
        public ActionResult Search(string searchText)
        {
            var users        = accountService.GetUsersBySubsrting(searchPageSize, 1, searchText).MapToMvc();
            var countUsers   = accountService.CountBySubstring(searchText);
            var userPageInfo = new PageInfo {
                PageNumber = 1, PageSize = searchPageSize, TotalItems = countUsers
            };

            var usersList = new UsersPaging
            {
                Users      = users,
                PageInfo   = userPageInfo,
                SearchText = searchText
            };

            return(View("SearchAuxillary", usersList));
        }
Пример #2
0
        public ActionResult PagingUsers(string searchText, int page = 1)
        {
            var users        = accountService.GetUsersBySubsrting(searchPageSize, page, searchText).MapToMvc();
            var countUsers   = accountService.CountBySubstring(searchText);
            var userPageInfo = new PageInfo {
                PageNumber = page, PageSize = searchPageSize, TotalItems = countUsers
            };

            var usersList = new UsersPaging
            {
                Users      = users,
                PageInfo   = userPageInfo,
                SearchText = searchText
            };

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_Search", usersList));
            }

            return(View("SearchAuxillary", usersList));
        }