Exemple #1
0
        public ActionResult SearchUsers(string searchCriteria, Int32 page = 1)
        {
            if (TempData.ContainsKey("SearchUser"))
            {
                searchCriteria = this.TempData["SearchUser"].ToString();
            }

            var environmentViewModel = this.SetEnvironmentSession();

            PagedResult <ApplicationUser> users = (String.IsNullOrEmpty(searchCriteria) || searchCriteria.Length < 1) ?
                                                  this.userService.GetUsers(page, PageSize, environmentViewModel.SelectedEnvironment) :
                                                  this.userService.GetUsers(page, PageSize, searchCriteria, environmentViewModel.SelectedEnvironment);

            var usersViewModel = new UsersViewModel();

            usersViewModel.UserSearchValue = searchCriteria;
            usersViewModel.CurrentPage     = page.ToString();
            usersViewModel.UserSearchValue = searchCriteria;

            var currentuser = this.userService.GetApplicationUser(HttpContext.User.Identity.Name);

            this.SetDstAdminRole(currentuser, usersViewModel);

            usersViewModel.AddUsers(users);

            return(this.PartialView("_PagedUserResults", usersViewModel));
        }
Exemple #2
0
        public ActionResult Index(Int32 page = 1, Boolean isAjaxCall = false)
        {
            var environmentViewModel = this.SetEnvironmentSession();
            var users = this.userService.GetUsers(page, PageSize, environmentViewModel.SelectedEnvironment);

            var usersViewModel = new UsersViewModel();

            usersViewModel.AddUsers(users);

            if (isAjaxCall)
            {
                return(this.PartialView("_PagedUserResults", usersViewModel));
            }

            return(this.View(usersViewModel));
        }
Exemple #3
0
        public ActionResult Index(int page = 1, bool isAjaxCall = false)
        {
            var domiciles = this._userService.GetApplicationUser().Domiciles;

            var listDomicileIds = new List <int>();

            domiciles.ToList().ForEach(x => listDomicileIds.Add(x.DomicileId));

            var users = this._userService.GetUsersByDomicile(listDomicileIds, page, PageSize);

            var usersViewModel = new UsersViewModel();

            usersViewModel.AddUsers(users);

            if (isAjaxCall)
            {
                return(PartialView("_PagedUserResults", usersViewModel));
            }

            return(View(usersViewModel));
        }