Exemplo n.º 1
0
        public async Task <IActionResult> SendVerifyEmail(string id)
        {
            if (!ModelState.IsValid)
            {
                return(NotFoundView());
            }

            Result result = await _manageUserService.SendEmilVerificationMail(new SendEmailVerificationMailRequest(id), GetUserId());

            Result <UserDetailsViewModel> userResult = _userDataService.GetDetailsViewModel(id);

            if (userResult.Failure)
            {
                return(NotFoundView());
            }

            if (result.Failure)
            {
                ModelState.AddErrors(result.Errors);

                userResult.Value.StatusAlert = StatusAlertViewExtension.Get(result);
                return(View("Details", userResult.Value));
            }

            userResult.Value.StatusAlert = StatusAlertViewExtension.Get("Verify Email mail sent");

            return(View("Details", userResult.Value));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> SendVerifyEmail(string id)
        {
            if (!ModelState.IsValid)
            {
                return(NotFoundView());
            }

            Result result = await _manageUserService.SendEmilVerificationMail(new SendEmailVerificationMailRequest(id), GetUserId());

            if (result.Failure)
            {
                SaveTempData(TEMP_DATA_STATUS_ALERT_KEY, StatusAlertViewExtension.Get(result));
            }
            else
            {
                SaveTempData(TEMP_DATA_STATUS_ALERT_KEY, StatusAlertViewExtension.Get("Verify Email mail sent"));
            }

            return(RedirectToAction(nameof(Details), new { id }));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> SendVereficationMain([FromRoute] long groupUserId)
        {
            Result result = await _manageUserService.SendEmilVerificationMail(groupUserId);

            return(result.ToApiResult());
        }