/// <summary> /// Find notification in range when someone change holiday(send one message to n peole, in range), /// and with his username, change isReady to true. /// </summary> /// <param name="currentUsername">Username of user who clicked.</param> /// <param name="minNotificationId">min range notification.</param> /// <param name="maxNotificationId">max range notification.</param> public void MarkAsReadHolidayNotifications(string currentUsername, int minNotificationId, int maxNotificationId) { NotificationService notificationService = new NotificationService(); Notification notification = (Notification)notificationService.FindCurrentUserNotificationInRange(currentUsername, minNotificationId, maxNotificationId); if (notification != null) { notification.IsRead = true; notificationService.Edit(notification); } }
/// <summary> /// Find notification by notificationId and change state isRead to true; /// </summary> /// <param name="notificationId">Current notification id</param> public void MarkAsRead(int notificationId) { NotificationService notificationService = new NotificationService(); if (notificationId == -1) { notificationId = notificationService.FindLastNotificationId(); } Notification notification = (Notification)notificationService.FindById(notificationId); if (notification != null) { notification.IsRead = true; notificationService.Edit(notification); } }