public void PushNotification(WF_CaseNotifications notification, string receiver, NotificationSources source, Action <WF_CaseNotificationReceivers> handler = null) { EmailService.SendWorkFlowEmail( _entities.GlobalUserView.FirstOrDefault(p => p.EmployeeID == _currentUser)?.EmployeeName, new[] { receiver }, notification.WF_FlowCases.Subject, (NotificationTypes)notification.NotificationType); WF_CaseNotificationReceivers not = new WF_CaseNotificationReceivers { WF_CaseNotifications = notification, SourceType = (int)source, Created = DateTime.UtcNow, LastUpdated = DateTime.UtcNow, IsRead = 0, IsDissmissed = 0, Receiver = receiver, StatusId = 1 }; handler?.Invoke(not); _entities.WF_CaseNotificationReceivers.Add(not); if (not.IsDissmissed == 0) { NotificationSender.PushNotificationMessages(new[] { receiver }, () => not.CaseNotificationReceiverId); } }
public void PushNotification(WF_FlowCases flowCase, int?flowstepId, string comments, string receiver, NotificationTypes type, NotificationSources source) { WF_CaseNotificationReceivers not = new WF_CaseNotificationReceivers { WF_CaseNotifications = CreateNotification(flowCase, flowstepId, comments, type), SourceType = (int)source, Created = DateTime.UtcNow, LastUpdated = DateTime.UtcNow, IsRead = 0, IsDissmissed = 0, Receiver = receiver, StatusId = 1 }; _entities.WF_CaseNotificationReceivers.Add(not); NotificationSender.PushNotificationMessages(new[] { receiver }, () => not.CaseNotificationReceiverId); }