示例#1
0
        public async Task <ActionResult> EditEmail()
        {
            var svcProfileDetailData = await UserMicroService.GetUserAsync(GetUserId());

            var model = new ProfileEditEmailModel()
            {
                Email = svcProfileDetailData.Email
            };

            return(View(model));
        }
示例#2
0
        public async Task <ActionResult> EditEmail(ProfileEditEmailModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                await UserManagementMicroService.ChangeEmailAsync(GetUserId(), model.Email);

                AddFeedbackMessage(Feedback.FeedbackMessageTypes.Informational, "Email changed.");

                return(RedirectToAction("Index"));
            }
            catch (ServiceException ex)
            {
                AddModelErrors(ex);
                return(View());
            }
        }