示例#1
0
        public async Task DismissAlertAsync(int alertId, string userId)
        {
            var alert = await _alertRepository.GetOpenAlertByIdAsync(alertId);

            if (alert != null)
            {
                SetClosedAndAddClosureDate(alert, userId);

                await _alertRepository.SaveAlertChangesAsync();
            }
        }
示例#2
0
        public async Task DismissAlertAsync(int alertId, string userId)
        {
            var alert = await _alertRepository.GetOpenAlertByIdAsync(alertId);

            if (alert != null)
            {
                alert.ClosingUserId = userId;
                alert.ClosureDate   = DateTime.Now;
                alert.AlertStatus   = AlertStatus.Closed;

                await _alertRepository.SaveAlertChangesAsync();
            }
        }
示例#3
0
        public async Task <IActionResult> OnPostAsync()
        {
            var alertToDismiss = await alertRepository.GetOpenAlertByIdAsync(AlertId);

            if (await authorizationService.IsUserAuthorizedToManageAlert(User, alertToDismiss))
            {
                await alertService.DismissAlertAsync(AlertId, User.FindFirstValue(ClaimTypes.Upn));
            }

            if (Request.Query["page"] == "Overview")
            {
                return(RedirectToPage("/Notifications/Overview", new { alertToDismiss.NotificationId }));
            }

            return(RedirectToPage("/Index"));
        }