public IActionResult Details(string id) { if (!ModelState.IsValid) { return(NotFoundView()); } Result <UserDetailsViewModel> result = _userDataService.GetDetailsViewModel(id); if (result.Failure) { return(NotFoundView()); } UserDetailsViewModel userDetails = result.Value; StatusAlertViewModel statusAlertView = GetTempData <StatusAlertViewModel>(TEMP_DATA_STATUS_ALERT_KEY); if (statusAlertView != null) { userDetails.StatusAlert = statusAlertView; ModelState.AddErrors(statusAlertView.ValidationErrors); } return(View(userDetails)); }
public async Task <IActionResult> Index() { CredentailsViewModel credentailsViewModel = await _credentialsDataService.GetViewModel(); StatusAlertViewModel statusAlert = GetTempData <StatusAlertViewModel>(STATUS_ALERT_TEMP_DATA_KEY); if (statusAlert != null) { ModelState.AddErrors(statusAlert.ValidationErrors); credentailsViewModel.StatusAlert = statusAlert; } return(View(credentailsViewModel)); }
public NewRoleViewModel GetNewRoleViewModel(Result result = null) { StatusAlertViewModel statusAlert = null; if (result != null) { statusAlert = StatusAlertViewExtension.Get(result); } NewRoleViewModel newRoleViewModel = new NewRoleViewModel( statusAlert: statusAlert, roleTypes: GetRoleTypesList()); return(newRoleViewModel); }
public IActionResult Index() { Result <TwoFactorAuthenticatorViewModel> result = _twoFactorAuthorizationDataService.GetTwoFactorAuthenticatorViewModel(); if (result.Failure) { return(View(new TwoFactorAuthenticatorViewModel(StatusAlertViewExtension.Get(result)))); } TwoFactorAuthenticatorViewModel twoFactorAuthenticatorViewModel = result.Value; StatusAlertViewModel statusAlert = GetTempData <StatusAlertViewModel>(INDEX_STATUS_ALERT_TEMP_DATA_KEY); if (statusAlert != null) { ModelState.AddErrors(statusAlert.ValidationErrors); twoFactorAuthenticatorViewModel.StatusAlert = statusAlert; } return(View(twoFactorAuthenticatorViewModel)); }
public async Task <IActionResult> AddTwoFactorAuthenticator() { Result <AddTwoFactorAuthenticatorViewModel> result = await _twoFactorAuthorizationDataService.GetAuthenticatorViewModel(); if (result.Failure) { SaveTempData(INDEX_STATUS_ALERT_TEMP_DATA_KEY, StatusAlertViewExtension.Get(result)); return(RedirectToAction(nameof(Index))); } AddTwoFactorAuthenticatorViewModel addTwoFactorAuthenticator = result.Value; StatusAlertViewModel statusAlert = GetTempData <StatusAlertViewModel>(AUTHENTICATOR_STATUS_ALERT_TEMP_DATA_KEY); if (statusAlert != null) { ModelState.AddErrors(statusAlert.ValidationErrors); addTwoFactorAuthenticator.StatusAlert = statusAlert; } return(View(addTwoFactorAuthenticator)); }
public async Task <IActionResult> AddTwoFactorEmailAuthentication() { Result <AddEmailTwoFactorAuthenticationViewModel> result = await _twoFactorAuthorizationDataService.GetEmailViewModel(); if (result.Failure) { SaveTempData(INDEX_STATUS_ALERT_TEMP_DATA_KEY, StatusAlertViewExtension.Get(result)); return(RedirectToAction(nameof(Index))); } AddEmailTwoFactorAuthenticationViewModel addEmailTwoFactorAuthenticationViewModel = new AddEmailTwoFactorAuthenticationViewModel(); StatusAlertViewModel statusAlert = GetTempData <StatusAlertViewModel>(EMAIL_STATUS_ALERT_TEMP_DATA_KEY); if (statusAlert != null) { ModelState.AddErrors(statusAlert.ValidationErrors); addEmailTwoFactorAuthenticationViewModel.StatusAlert = statusAlert; } Result sendMailResult = await _twoFactorAuthService.GenerateAndSendEmailCode(GetUserId()); return(View(addEmailTwoFactorAuthenticationViewModel)); }
public TwoFactorAuthenticatorViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public CredentailsViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public NewRoleViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public UserDetailsViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public RoleDetailViewModel(StatusAlertViewModel statusAlert, IEnumerable <SelectListItem> roleTypes) { StatusAlert = statusAlert; RoleTypes = roleTypes; }
public ChangePasswordViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public IViewComponentResult Invoke(StatusAlertViewModel statusAlert) { return(View(statusAlert)); }
public ProfileViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public RoleDetailViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }
public PermissionViewModel(StatusAlertViewModel statusAlert) { StatusAlert = statusAlert; }