示例#1
0
        public async Task <ActionResult> ChangeLastName(AccountKeeper model)
        {
            ApplicationUser Model = UserManager.FindById(User.Identity.GetUserId());

            Model.UserLastName = model.NewValue;
            IdentityResult result = await UserManager.UpdateAsync(Model);

            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult PostingNews(AccountKeeper model)
        {
            using (_cont = new ApplicationDbContext())
            {
                var res = _cont.Informations.Find(1);
                res.Message = model.NewValue;
                if (TryUpdateModel(res))
                {
                    _cont.SaveChanges();
                }
            }

            return(View("Index"));
        }