Beispiel #1
0
        private void FillCollection()
        {
            var allItems = _itemService.Get(i => i.CompleteDay == DateTime.MinValue.AddYears(1753)).ToList();

            // Fill next 7 days by TO-DO items.
            for (var i = 1; i <= 7; i++)
            {
                _upcomingItemsCollection.Add(new UpcomingToDoItems(ref i, allItems, true));
            }

            var iterationsCount = DateTime.Now.AddDays(8).Month != DateTime.Now.Month ? 6 : 5;

            for (var i = 0; i < iterationsCount; i++)
            {
                _upcomingItemsCollection.Add(new UpcomingToDoItems(ref i, allItems, false));
            }

            var yearsItems = allItems
                             .Where(i => i.Date > DateTime.Today.AddMonths(5))
                             .ToDictionary(item => item.Date.Year, item => allItems.Where(i => i.Date.Year == item.Date.Year));

            foreach (var i in yearsItems)
            {
                _upcomingItemsCollection.Add(new UpcomingToDoItems(i.Key, i.Value.ToList()));
            }
        }
Beispiel #2
0
        private void FillCollection()
        {
            var minDate = DateTime.MinValue.AddYears(1753);

            var collection = _service.Get(item => (item.Date <= DateTime.Today && item.Date != minDate ||
                                                   item.Deadline <= DateTime.Today && item.Deadline != minDate) &&
                                          item.CompleteDay == minDate).ToList();

            foreach (var i in collection)
            {
                _toDoItemsCollection.Add(_toDoItemOperations.ConvertToItemView(i));
            }
        }
Beispiel #3
0
        private void FillCollection()
        {
            var minDate = DateTime.MinValue.AddYears(1753);

            var collection = _itemService.Get(item =>
                                              item.Date == minDate &&
                                              item.CompleteDay == minDate &&
                                              item.ProjectName == "").ToList();

            foreach (var i in collection)
            {
                var item = _operations.ConvertToItemView(i);

                if (item == null)
                {
                    continue;
                }

                _toDoItemsCollection.Add(item);
            }
        }
Beispiel #4
0
        private void FillCollection()
        {
            var items = _itemService.Get(i => i.CompleteDay != _minDate).ToList();

            items.Sort((a, b) => - a.CompleteDay.CompareTo(b.CompleteDay));

            foreach (var i in items)
            {
                _toDoItemsCollection.Add(new LogbookToDoItem
                {
                    Id              = i.Id,
                    Header          = i.Header,
                    Notes           = i.Notes,
                    Date            = i.Date,
                    Deadline        = i.Deadline,
                    CompleteDay     = i.CompleteDay,
                    CompleteDateStr = i.CompleteDay.ToShortDateString(),
                    ProjectName     = i.ProjectName,
                    ProjectId       = i.ProjectId
                });
            }
        }