public static void ProcessNotificationQueue(IEmailSender emailSender, WLC.Models.WLCRacesContext context) { foreach (var notificationQueueItem in context.NoticeQueueItems .Where(x => x.NoticeStatusId == (int)NoticeStatusEnum.New) .Include(x => x.Notice) .ThenInclude(x => x.NoticeType)) { var message = $"From Wauna Lake; {notificationQueueItem.Notice.NoticeType.Description} Notification ---- {notificationQueueItem.Notice.Message}"; try { //TextMessage(notificationQueueItem.NotificationLocation, message); if (notificationQueueItem.NotificationLocation.Contains("@")) { SendMessage(emailSender, notificationQueueItem.NotificationLocation, message); } else { TextMessageViaCommunicationService(null, notificationQueueItem.NotificationLocation, message); } notificationQueueItem.NoticeStatusId = (int)NoticeStatusEnum.Completed; } catch (Exception ex) { notificationQueueItem.NoticeStatusId = (int)NoticeStatusEnum.Error; } } context.SaveChanges(); }
public static void QueueNotification(WLC.Models.WLCRacesContext context, WLC.Models.Notices Notice) { if (Notice.NoticeTypeId == (int)NoticeTypeEnum.Social) { NotifyForSocial(context, Notice); } if (Notice.NoticeTypeId == (int)NoticeTypeEnum.Informational) { NotifyForInformation(context, Notice); } if (Notice.NoticeTypeId == (int)NoticeTypeEnum.Emergency) { NotifyForEmergency(context, Notice); } }
public EditModel(WLC.Models.WLCRacesContext context) { _context = context; }
public IndexModel(WLC.Models.WLCRacesContext context) { _context = context; }
public IndexModel(WLC.Models.WLCRacesContext context) { _context = context; InitializeLookups(); }
public DeleteModel(WLC.Models.WLCRacesContext context) { _context = context; }
public DetailsModel(WLC.Models.WLCRacesContext context) { _context = context; }
public EditModel(WLC.Models.WLCRacesContext context, IEmailSender emailSender, IConfiguration config) { _config = config; _context = context; _emailSender = emailSender; }
public CreateModel(WLC.Models.WLCRacesContext context) { _context = context; }