Exemple #1
0
        public void AddToSprint(Task task)
        {
            BacklogTasks.Remove(task);
            task.SprintRelevant = true;
            if (task.SprintPosition == null)
            {
                // Add it at the bottom of the ToDo tasks
                task.SprintPosition = Positioning.Calculate(SprintTasks.Where(t => t.Status == Status.ToDo).LastOrDefault()?.Position, null);
                DataAccess.UpdateTask(task);
            }
            else
            {
                DataAccess.UpdateTaskSprintRelevance(task);
            }

            for (int i = 0; i < SprintTasks.Count(); i++)
            {
                if (String.Compare(SprintTasks[i].SprintPosition, task.SprintPosition) >= 0)
                {
                    SprintTasks.Insert(i, task);
                    ApplyFilters();
                    return;
                }
            }

            SprintTasks.Add(task);
            ApplyFilters();
            Selected = task;
        }
Exemple #2
0
 public void DeleteSelected()
 {
     DataAccess.DeleteTask(Selected);
     if (Selected.SprintRelevant)
     {
         SprintTasks.Remove(Selected);
     }
     else
     {
         BacklogTasks.Remove(Selected);
         ApplyFilters();
     }
     Selected = null;
 }