// POST: BrandUserMng/Update public async System.Threading.Tasks.Task <ActionResult> UpdateMyAccount(Models.BrandAccountInformationVMs model) { var currUser = Helper.GetCurrentUser(); if (ModelState.IsValid) { /*Update custom fields*/ var user = aspNetUserService .Get(a => a.Id == model.Id) .FirstOrDefault(); if (user != null) { user.BrandID = currUser.BrandID; user.FullName = model.FullName; user.PhoneNumber = model.PhoneNumber; user.AspNetRoles = currUser.AspNetRoles; } ; await this.aspNetUserService.UpdateAsync(user); return(new ContentResult { Content = string.Format("<script type='text/javascript'>window.parent.location.href = '{0}';</script>", Url.Action("Index", "Home")), ContentType = "text/html" }); } return(View("GetAccountInformation", model)); }
public ActionResult GetAccountInformation() { var user = Helper.GetCurrentUser(); Models.BrandAccountInformationVMs model = null; var myuser = aspNetUserService.GetAccountsByUserName(user.UserName); if (myuser != null) { model = new Models.BrandAccountInformationVMs { UserName = myuser.UserName, Id = myuser.Id, Email = myuser.Email, FullName = myuser.FullName, PhoneNumber = myuser.PhoneNumber, }; } return(View(model)); }