Exemple #1
0
        public async Task<ActionResult> Save(ManageViewModel m)
        {
            if (ModelState.IsValid)
            {
                var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());

                //user.UserName = editUser.Email;
                user.Email = m.Email;
                user.Name = m.Name;

                //user.Address = editUser.Address;
                //user.City = editUser.City;
                //user.State = editUser.State;
                //user.PostalCode = editUser.PostalCode;
                var result = await UserManager.UpdateAsync(user);

                if (result.Succeeded)
                {

                }


            }
            return RedirectToAction("Index", "Home");
        }
Exemple #2
0
        public ActionResult Manage()
        {
            var model = new ManageViewModel();

            if (ModelState.IsValid)
            {
                var user = UserManager.FindById(User.Identity.GetUserId());

                model.Email = user.Email;
                model.Name = user.Name;

            }
            return View(model);
        }