public ActionResult UpdateAccountProfile(AccountProfileModel model) { if (model.SetPassword && !ModelState.IsValid) return this.CurrentUmbracoPage(); if (!(ModelState.IsValidField("firstName") && ModelState.IsValidField("lastName"))) return this.CurrentUmbracoPage(); var customer = (ICustomer)CurrentCustomer; customer.FirstName = model.FirstName; customer.LastName = model.LastName; MerchelloServices.CustomerService.Save(customer); if (model.SetPassword) { var member = Membership.GetUser(); if (member == null) { var nullReference = new NullReferenceException("Current member was null in change password operation"); LogHelper.Error<BazaarAccountController>("Attempt to change password failed", nullReference); throw nullReference; } member.ChangePassword(model.OldPassword, model.Password); } return this.SuccessfulRedirect(model.AccountPageId); }
public ActionResult RenderAccountProfileForm(AccountProfileModel model) { return this.PartialView(PathHelper.GetThemePartialViewPath(model.Theme, "ProfileForm"), model); }