/* Returns all NOT completed tasks */ public void RetrieveNotCompletedTasks() { foreach (Kompitu.Data.Model.TaskList taskList in _TaskLists) { foreach (Kompitu.Data.Model.Task task in taskList.Tasks. Where(t => IsNotHiddenOrDeleted(t) && t.Status != "completed")) { NotCompletedTasks.Add(task); } } }
private TasksViewModel FilterTasks(IEnumerable <TaskItem> tasks) { tasks.ToList().ForEach(t => { if (t.DateDeadline.AddDays(1) < DateTime.Now) { t.NotCompleted = true; NotCompletedTasks.Add(t); } }); tasks = tasks.Except(NotCompletedTasks).ToList(); UnassignedTasks = tasks.Where(t => t.Progress == TaskProgress.Unassigned).ToList(); AssignedTasks = tasks.Where(t => t.Progress == TaskProgress.Assigned).ToList(); InProgressTasks = tasks.Where(t => t.Progress == TaskProgress.InProgress).ToList(); CompletedTasks = tasks.Where(t => t.Progress == TaskProgress.Completed).ToList(); return(this); }
public void RefreshLists() { //fill lists with visible tasks (not hidden and not deleted) VisibleTaskLists.Clear(); RetrieveVisibleLists(); //fill lists with todays tasks TodaysTasks.Clear(); RetrieveTodaysTasks(); //fill list with overdue tasks OverdueTasks.Clear(); RetrieveOverdueTasks(); //fill list with not completed tasks NotCompletedTasks.Clear(); RetrieveNotCompletedTasks(); //fill list with completed tasks CompletedTasks.Clear(); RetrieveCompletedTasks(); }