Beispiel #1
0
        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();
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 public EditModel(WLC.Models.WLCRacesContext context)
 {
     _context = context;
 }
Beispiel #4
0
 public IndexModel(WLC.Models.WLCRacesContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public IndexModel(WLC.Models.WLCRacesContext context)
 {
     _context = context;
     InitializeLookups();
 }
Beispiel #6
0
 public DeleteModel(WLC.Models.WLCRacesContext context)
 {
     _context = context;
 }
Beispiel #7
0
 public DetailsModel(WLC.Models.WLCRacesContext context)
 {
     _context = context;
 }
Beispiel #8
0
 public EditModel(WLC.Models.WLCRacesContext context, IEmailSender emailSender, IConfiguration config)
 {
     _config      = config;
     _context     = context;
     _emailSender = emailSender;
 }
Beispiel #9
0
 public CreateModel(WLC.Models.WLCRacesContext context)
 {
     _context = context;
 }