private void ClearEventArrays()
 {
     Monday.Clear();
     Tuesday.Clear();
     Wednesday.Clear();
     Thursday.Clear();
     Friday.Clear();
     Saturday.Clear();
     Sunday.Clear();
 }
Beispiel #2
0
 private void ClearLists()
 {
     Monday.Clear();
     Tuesday.Clear();
     Wednesday.Clear();
     Thursday.Clear();
     Friday.Clear();
     Saturday.Clear();
     Sunday.Clear();
 }
        private void FetchTasks()
        {
            Monday.Clear();
            Tuesday.Clear();
            Wednesday.Clear();
            Thursday.Clear();
            Friday.Clear();
            Saturday.Clear();
            Sunday.Clear();
            List <DailyTask> Models = db.DailyTasks
                                      .Where(p => p.UserId == User.Id)
                                      .ToList <DailyTask>();

            foreach (var m in Models)
            {
                if (m.Date.HasValue)
                {
                    Debug.WriteLine("Has value!");
                    if (m.Date.Value.Date == (WeekDates[0].Date))
                    {
                        Monday.Add(m);
                    }
                    else if (m.Date.Value.Date == (WeekDates[1].Date))
                    {
                        Tuesday.Add(m);
                    }
                    else if (m.Date.Value.Date == (WeekDates[2].Date))
                    {
                        Wednesday.Add(m);
                    }
                    else if (m.Date.Value.Date == (WeekDates[3].Date))
                    {
                        Thursday.Add(m);
                    }
                    else if (m.Date.Value.Date == (WeekDates[4].Date))
                    {
                        Friday.Add(m);
                    }
                    else if (m.Date.Value.Date == (WeekDates[5].Date))
                    {
                        Saturday.Add(m);
                    }
                    else if (m.Date.Value.Date == (WeekDates[6].Date))
                    {
                        Sunday.Add(m);
                    }
                }
            }
        }