Example #1
0
        public ObservableCollection <NotificationSchedule> GetNextNotifications()
        {
            ObservableCollection <NotificationSchedule> Schedules;
            var CurrentHour = DateTime.Now.Hour;

            lock (Locker)
            {
                Schedules = new ObservableCollection <NotificationSchedule>(Database.Query <NotificationSchedule>("SELECT * FROM NotificationSchedule WHERE Time = ?", CurrentHour));
            }

            var DeckDB = new DeckDB();

            foreach (NotificationSchedule ScheduledNotification in Schedules)
            {
                ScheduledNotification.Deck = DeckDB.GetDeck(ScheduledNotification.DeckID);
            }
            return(Schedules);
        }
Example #2
0
        public ObservableCollection <NotificationSchedule> GetFutureNotifications()
        {
            ObservableCollection <NotificationSchedule> Schedules;
            var FutureHour = (DateTime.Now.Hour + 1) % 24;

            lock (Locker)
            {
                do
                {
                    Schedules  = new ObservableCollection <NotificationSchedule>(Database.Query <NotificationSchedule>("SELECT * FROM NotificationSchedule WHERE Time = ?", FutureHour));
                    FutureHour = (FutureHour + 1) % 24;
                }while (Schedules.Count < 1);
            }

            var DeckDB = new DeckDB();

            foreach (NotificationSchedule ScheduledNotification in Schedules)
            {
                ScheduledNotification.Deck = DeckDB.GetDeck(ScheduledNotification.DeckID);
            }
            return(Schedules);
        }