public ActionResult ChangeEmail(UpdateEmailsModel model) { ProfileCommon profile = HttpContext.Profile as ProfileCommon; if (profile == null) RedirectToAction("LogOn", "Account"); if (ModelState.IsValid) { Login login = _dataService.GetLoginById(profile.LoginId); login.Email = model.PrimaryEmail; login.Email2 = model.SecondaryEmail; _dataService.UpdateLogin(login); return RedirectToAction("Details", new { id = login.Id }); } return View("UpdateEmail", model); }
//[HandleError] public ActionResult ChangeEmail() { ProfileCommon profile = HttpContext.Profile as ProfileCommon; if (profile == null) RedirectToAction("LogOn", "Account"); Login login = _dataService.GetLoginById(profile.LoginId); UpdateEmailsModel model = new UpdateEmailsModel(); model.Id = login.Id; model.PrimaryEmail = login.Email; model.SecondaryEmail = login.Email2; return View("UpdateEmail", model); }