Example #1
0
        public ActionResult EditRole(UserModel model)
        {
            //check model state
            if (ModelState.IsValid)
            {
                //alter the sql database using the user input
                UserProcessor.ChangeUserRole(model.UserId, model.RoleId, model.UserName, model.Email);

                //Go to the view users page
                return(RedirectToAction("ViewUsers"));
            }

            //reload page if any errors occur
            return(View(model));
        }