Exemplo n.º 1
0
        public void EditCustomerProfile(CustomerEditProfileBm bindingModel, string userId)
        {
            ApplicationUser currentUser =
                this.Context.Users.FirstOrDefault(u => u.Id == userId);

            currentUser.Name     = bindingModel.Name;
            currentUser.UserName = bindingModel.UserName;
            this.Context.SaveChanges();
        }
Exemplo n.º 2
0
        public ActionResult EditProfile(CustomerEditProfileBm bindingModel)
        {
            string userId = this.User.Identity.GetUserId();

            if (this.ModelState.IsValid)
            {
                this.service.EditCustomerProfile(bindingModel, userId);
                return(RedirectToAction("Profile"));
            }

            CustomerEditProfileVm cepvm = this.service.GetCustomerEditProfileVm(userId);

            return(this.View(cepvm));
        }