Esempio n. 1
0
 private void UpdateUserCommonProperties(User user, BasicAccountInfoViewModel model)
 {
     user.AvatarUrl = model.AvatarUrl;
     user.Bio = model.Bio;
     user.Email = model.Email;
     user.FirstName = model.FirstName;
     user.LastName = model.LastName;
 }
Esempio n. 2
0
        public IdentityResult Update(BasicAccountInfoViewModel model, string userId)
        {
            var user = this.ById(userId);
            this.UpdateUserCommonProperties(user, model);
            var result = this.manager.Update(user);

            return result;
        }
Esempio n. 3
0
 private void UpdateUserCommonProperties(User user, BasicAccountInfoViewModel model)
 {
     user.AvatarUrl = model.AvatarUrl;
     user.Bio       = model.Bio;
     user.Email     = model.Email;
     user.FirstName = model.FirstName;
     user.LastName  = model.LastName;
 }
Esempio n. 4
0
        public IdentityResult Update(BasicAccountInfoViewModel model, string userId)
        {
            var user = this.ById(userId);

            this.UpdateUserCommonProperties(user, model);
            var result = this.manager.Update(user);

            return(result);
        }
        public ActionResult Edit(BasicAccountInfoViewModel model)
        {
            // Todo check if model.Id and current userId match or if admin
            if (!this.ModelState.IsValid)
            {
                this.TempData["error"] = "Invalid profile data, the profile wasn't updated";
            }
            else
            {
                var result = this.users.Update(model, this.UserId);
            }

            return(this.PartialView("DisplayTemplates/BasicAccountInfoViewModel", model));
        }
        public ActionResult Edit(BasicAccountInfoViewModel model)
        {
            // Todo check if model.Id and current userId match or if admin
            if (!this.ModelState.IsValid)
            {
                this.TempData["error"] = "Invalid profile data, the profile wasn't updated";
            }
            else
            {
                var result = this.users.Update(model, this.UserId);
            }

            return this.PartialView("DisplayTemplates/BasicAccountInfoViewModel", model);
        }