public ActionResult ConfigureUserAsManager(string username, ApplicationUserEdit newItem)
        {
            if (ModelState.IsValid & username == newItem.UserName)
            {
                if (m.IsUserAManager(newItem.UserName))
                {
                    // So, return to the list of non-managers
                    return RedirectToAction("nonmanagers");
                }
                else
                {
                    // Configure as a manager
                    m.ConfigureUserAsManager(newItem.UserName);

                    return RedirectToAction("nonmanagers");
                }
            }
            else
            {
                // There was a problem with model validation or identifiers that don't match
                // Simply re-display the form

                return RedirectToAction("nonmanagers", new { username = newItem.UserName });
            }
        }
Example #2
0
        public ActionResult ConfigureUserAsManager(string username, ApplicationUserEdit newItem)
        {
            if (ModelState.IsValid & username == newItem.UserName)
            {
                if (m.IsUserAManager(newItem.UserName))
                {
                    // So, return to the list of non-managers
                    return(RedirectToAction("nonmanagers"));
                }
                else
                {
                    // Configure as a manager
                    m.ConfigureUserAsManager(newItem.UserName);

                    return(RedirectToAction("nonmanagers"));
                }
            }
            else
            {
                // There was a problem with model validation or identifiers that don't match
                // Simply re-display the form

                return(RedirectToAction("nonmanagers", new { username = newItem.UserName }));
            }
        }