예제 #1
0
 public Board Update(Board update)
 {
     var entity = _context.Set<Board>().Single(x => x.Id == update.Id);
     entity.Title = update.Title;
     _context.Save();
     return update;
 }
예제 #2
0
 public Board Create(Board board)
 {
     _context.Set<Board>()
         .Add(board);
     _context.Save();
     return board;
 }
예제 #3
0
 public void BoardAdded(Board board)
 {
     Clients.Others.BoardAdded(board);
 }
예제 #4
0
        private static int RenderCells(Board board, Worksheet sheet, int rowNum)
        {
            for (int i = 0; i < board.Columns.Count; i++)
            {
                var column = board.Columns[i];

                if (column.Tasks == null || column.Tasks.Count == 0)
                {
                    sheet.Cells[rowNum, 1] = column.Id;
                    sheet.Cells[rowNum, 2] = column.Title;
                }

                for (var j = 0; j < column.Tasks.Count; j++)
                {
                    var task = column.Tasks[j];
                    sheet.Cells[rowNum, 1] = column.Id;
                    sheet.Cells[rowNum, 2] = column.Title;
                    sheet.Cells[rowNum, 3] = task.Id;
                    sheet.Cells[rowNum, 4] = task.Title;
                    sheet.Cells[rowNum, 5] = task.Description;
                    if (j < column.Tasks.Count - 1)
                        rowNum++;
                }
                rowNum++;
            }
            return rowNum;
        }