예제 #1
0
        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));
        }