Exemple #1
0
        public ActionResult EditUser(UserModel userModel)
        {
            _usersManager.EditUser(userModel.ID, userModel.FirstName, userModel.LastName, userModel.Email);

            userModel.AllUsers = _usersManager.GetAllUsers();

            return PartialView("FoundUsers", userModel);
        }
Exemple #2
0
        public ActionResult AddUser(UserModel userModel)
        {
            _usersManager.AddUser(userModel.FirstName, userModel.LastName, userModel.Email);

            var model = new UserModel();

            model.AllUsers = _usersManager.GetAllUsers();

            return PartialView("FoundUsers", model);
        }
        public ActionResult UsersManagement(int currentPage=1)
        {
            var userModel = new UserModel();
          
            int countPages;

            userModel.ListUsers.AllUsers = _usersManager.GetUsers(userModel.PageInfo.Find, currentPage, out countPages);

            userModel.PageInfo = PageInfoHelper.SetPageInfo(countPages, currentPage);

            return View("UsersManagement", userModel);
        }
        public ActionResult FindUser(PageInfo pageInfo)
        {           
            int countPages;
            var userModel = new UserModel();

            if (pageInfo.CurrentPage == 0)
            {
                pageInfo.CurrentPage = 1;
            }
             
            userModel.ListUsers.AllUsers = _usersManager.GetUsers(
                pageInfo.Find, pageInfo.CurrentPage, out countPages);

            userModel.PageInfo = PageInfoHelper.SetPageInfo(countPages, pageInfo.CurrentPage);

            return PartialView("FoundUsers", userModel);
        }
        public ActionResult AddUser(SelectUserModel selectUserModel)
        {
            if (!ModelState.IsValid) return PartialView();

            _usersManager.AddUser(
                selectUserModel.FirstName,
                selectUserModel.LastName,
                selectUserModel.Email);

            int countPages;
            var userModel = new UserModel {PageInfo = {CurrentPage = 1}};

            userModel.ListUsers.AllUsers = _usersManager.GetUsers(userModel.PageInfo.Find, userModel.PageInfo.CurrentPage, out countPages);

            userModel.PageInfo = PageInfoHelper.SetPageInfo(countPages);

            return PartialView("FoundUsers", userModel);
        }
        public ActionResult EditUser(SelectUserModel selectUserModel, string find, int currentPage = 1)
        {
            if (!ModelState.IsValid) return PartialView();

            selectUserModel.FirstName = selectUserModel.FirstName.ToLower();

            _usersManager.EditUser(
                selectUserModel.ID, selectUserModel.FirstName,
                selectUserModel.LastName, selectUserModel.Email);

            int countPages;
            var userModel = new UserModel
            {
                ListUsers =
                {
                    AllUsers = _usersManager.GetUsers(find, currentPage, out countPages)
                },
                PageInfo = PageInfoHelper.SetPageInfo(countPages, currentPage)
            };

            return PartialView("FoundUsers", userModel);
        }
Exemple #7
0
        public ActionResult FindUser(UserModel user)
        {
            user.AllUsers = _usersManager.GetUser(user.Find);

            return PartialView("FoundUsers", user);
        }
Exemple #8
0
        public ActionResult UserManagement()
        {
            var userModel = new UserModel();

            userModel.AllUsers = _usersManager.GetAllUsers();

            return View(userModel);
        }
Exemple #9
0
        public ActionResult PrintAllUsers()
        {
            var model = new UserModel();

            model.AllUsers = _usersManager.GetAllUsers();

            return View(model);
        }