Exemple #1
0
        public void SetReminderShown(String id)
        {
            var list = LoadAlarmHistory();

            if (!list.ContainsKey(id))
            {
                list.Add(id, new AlarmHistory());
            }
            list[id].LastReminder = ScheduleController.GetToday();

            this.alarmHistoryDatabase.Save(list);
        }
Exemple #2
0
        public bool AlarmShown(string id)
        {
            var list = LoadAlarmHistory();

            if (list.ContainsKey(id))
            {
                var val = list[id];
                if (val.LastAlarm == ScheduleController.GetToday())
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        private bool ReminderShown(string id)
        {
            var list = LoadAlarmHistory();

            if (list.ContainsKey(id))
            {
                var val = list[id];
                if (val.LastReminder == ScheduleController.GetToday())
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        public List <ScheduleSqlDefinition> GetReminderWashDays()
        {
            List <ScheduleSqlDefinition> wdId = new List <ScheduleSqlDefinition>();
            Dictionary <string, ScheduleSqlDefinition> list = LoadScheduleDatabase();

            foreach (var schedule in list.Values)
            {
                var s          = schedule.GetDefinition();
                var controller = new ScheduleController(s);
                if (controller.IsCareDay(ScheduleController.GetToday().AddDays(1)))
                {
                    if (!ReminderShown(schedule.ID))
                    {
                        wdId.Add(schedule);
                    }
                }
            }
            return(wdId);
        }
        public CommingDays NextDay()
        {
            var diff = new CommingDays();

            foreach (var d in MainSession.WashingDays)
            {
                var c = new ScheduleController(d.Scheduled);
                var t = c.Time2NextCareDay(ScheduleController.GetToday());
                if (t <= diff.Time2Wait)
                {
                    diff.Time2Wait = t;
                    diff.Days      = new List <WashingDayDefinition> {
                        d
                    };
                }
                else if (t == diff.Time2Wait)
                {
                    diff.Time2Wait = t;
                    diff.Days.Add(d);
                }
            }
            return(diff);
        }