Ejemplo n.º 1
0
        public ActionResult ChangeName(ResetNameViewModel model)
        {
            var user = UserManager.FindById(User.Identity.GetUserId());

            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            if (user != null)
            {
                user.FirstName = model.FirstName;
                user.LastName  = model.LastName;

                UserManager.Update(user);
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        //GET: /Manage/ChangeName
        public ActionResult ChangeName()
        {
            var user = UserManager.FindById(User.Identity.GetUserId());
            ResetNameViewModel model = new ResetNameViewModel();

            if (user != null)
            {
                model.FirstName = user.FirstName;
                model.LastName  = user.LastName;

                return(View(model));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }