コード例 #1
0
        public void advanceTask(string email, int columnOrdinal, int taskId, BoardModel board, BoardModel backupBoard)
        {
            Response response = Service.AdvanceTask(email, columnOrdinal, taskId);

            if (response.ErrorOccured)
            {
                throw new Exception(response.ErrorMessage);
            }
            else
            {
                //Updating the board of the presentation
                ColumnModel currentColumn = board.getColumn(columnOrdinal);
                ColumnModel nextColumn    = board.getColumn(columnOrdinal + 1);
                TaskModel   toRemove      = currentColumn.getTask(taskId); //Will never be null
                currentColumn.Tasks.Remove(toRemove);                      //Updating the coulmn in model of Presentation
                nextColumn.Tasks.Add(toRemove);
                if (backupBoard != null)                                   //Updating the backup board if it exists
                {
                    ColumnModel currentColumnB = backupBoard.getColumn(columnOrdinal);
                    ColumnModel nextColumnB    = backupBoard.getColumn(columnOrdinal + 1);
                    TaskModel   toRemoveB      = currentColumnB.getTask(taskId); //Will never be null
                    currentColumnB.Tasks.Remove(toRemoveB);                      //Updating the coulmn in model of Presentation
                    nextColumnB.Tasks.Add(toRemoveB);
                }
            }
        }
コード例 #2
0
        public void deleteTask(string email, int ordinal, int taskId, BoardModel board, BoardModel backupBoard)
        {
            Response response = Service.DeleteTask(email, ordinal, taskId);

            if (response.ErrorOccured)
            {
                throw new Exception(response.ErrorMessage);
            }
            else
            {
                //Updating the board of the presentation
                ColumnModel columnFromToRemove = board.getColumn(ordinal);
                columnFromToRemove.Tasks.Remove(columnFromToRemove.getTask(taskId));
                if (backupBoard != null)//Delete the task from the backup board as well if it exists (if tasks are currently filtered)
                {
                    ColumnModel columnFromToRemoveB = backupBoard.getColumn(ordinal);
                    columnFromToRemoveB.Tasks.Remove(columnFromToRemoveB.getTask(taskId));
                }
            }
        }