Пример #1
0
        ///   <summary>
        ///      removes selected task
        ///      <example>
        ///        <code>
        ///             Board.RemoveSelectedTask();
        ///        </code>
        ///      </example>
        ///    </summary>
        public static void RemoveSelectedTask()
        {
            BoardDB.GetTasks().Remove(Board.CurrentlySelectedTask.task);

            if (BoardDB.SaveChanges() == 1)
            {
                Board.GetListBasedOnSelectedColumn().RemoveAt(Board.CurrentlySelectedIndex);
            }
        }
Пример #2
0
        ///   <summary>
        ///      returns tasks with employees from BD
        ///      <example>
        ///        <code>
        ///             long openColumnId = GetKeyForValue("Open", Columns).columnId;<para/>
        ///             IQueryable<TaskAndEmploy> t = BoardDB.GetTasksAndEmployeesFromColumn(openColumnId);
        ///        </code>
        ///      </example>
        ///    </summary>
        public static IQueryable <TaskAndEmploy> GetTasksAndEmployeesFromColumn(long columnId)
        {
            var tasks     = BoardDB.GetTasks();
            var employees = BoardDB.GetEmployees();

            return(tasks
                   .Where(t => t.columnId == columnId)
                   .Join(employees, task => task.employId, employ => employ.employId,
                         (t, e) => new TaskAndEmploy(t, e)));
        }
Пример #3
0
        ///<summary>
        ///      Adding new task to open column
        ///      <example>
        ///        <code>
        ///          Task task = new Task(); <para/>
        ///          Board.AddNewTaskToBoard(task);
        ///        </code>
        ///      </example>
        ///    </summary>
        public static void AddNewTaskToBoard(Task task)
        {
            BoardDB.GetTasks().Add(task);

            if (BoardDB.SaveChanges() == 1)
            {
                var employ = BoardDB.GetEmploy(task.employId);

                OpenTasksList.Add(new TaskAndEmploy(task, employ));
            }
        }