public virtual ActionResult ChangePreferences(AccountPreferencesModel model)
 {
     if (ModelState.IsValid)
     {
         
             if(MembershipService.ChangeUserPreferences(User.Identity.Name, model.DisplayName, model.EmailAddress, model.OpenEditorWithPreview, Settings))
             {
                 return RedirectToAction(MVC.Account.ChangePreferencesSuccess());
             }
            
         
     }
         ModelState.AddModelError("", "Unable to save preferences, unknown error.");
             return View(model);
         
 }
 public virtual ActionResult ChangePreferences()
 {
     var model = new AccountPreferencesModel();
     model.DisplayName = ViewData["UserDisplayName"] as string;
     model.EmailAddress = Security.GetUserEmailAddress(Security.CurrentUserName);
     model.OpenEditorWithPreview = Settings.UserSettings.OpenEditorWithPreview;
     return View(model);
 }