Example #1
0
 private async Task AddAuditData(Guid id, NotificationAuditType type, NotificationAuditScreenType screen)
 {
     await this.auditService.AddAuditEntry(this.mediator,
                                           id,
                                           User.GetUserId(),
                                           type,
                                           screen);
 }
Example #2
0
        public async Task AddAuditEntry(IMediator mediator,
                                        Guid notificationId,
                                        string userId,
                                        NotificationAuditType auditType,
                                        NotificationAuditScreenType screenType)
        {
            var audit = CreateAudit(notificationId,
                                    userId,
                                    screenType,
                                    auditType);

            await mediator.SendAsync(audit);
        }
Example #3
0
 private static CreateNotificationAudit CreateAudit(Guid notificationId,
                                                    string userId,
                                                    NotificationAuditScreenType screen,
                                                    NotificationAuditType type)
 {
     return(new CreateNotificationAudit()
     {
         DateAdded = SystemTime.Now,
         NotificationId = notificationId,
         UserId = userId,
         Screen = screen,
         Type = type
     });
 }
Example #4
0
        protected async Task AddAuditEntries(WasteCodeDataAndNotificationData existingData, BaseWasteCodeViewModel viewModel, Guid id, NotificationAuditScreenType screenType)
        {
            if (!existingData.NotificationWasteCodeData[codeType].Any())
            {
                await AuditService.AddAuditEntry(Mediator,
                                                 id,
                                                 User.GetUserId(),
                                                 NotificationAuditType.Added,
                                                 screenType);
            }
            else
            {
                if (CodeBeenRemoved(viewModel, existingData))
                {
                    await AuditService.AddAuditEntry(Mediator,
                                                     id,
                                                     User.GetUserId(),
                                                     NotificationAuditType.Deleted,
                                                     screenType);
                }

                if (CodeBeenAdded(viewModel, existingData))
                {
                    await AuditService.AddAuditEntry(Mediator,
                                                     id,
                                                     User.GetUserId(),
                                                     NotificationAuditType.Updated,
                                                     screenType);
                }
            }
        }