예제 #1
0
        public Task AddNewTask(int taskTypeId, string taskContent, Dictionary <string, string> customFields, bool saveTask)
        {
            if (taskTypeId == 0)
            {
                return(null);
            }
            var task = new Task {
                Content = taskContent, TaskTypeId = taskTypeId
            };
            var tokens = _taskParser.Parse(task);

            if (tokens != null)
            {
                foreach (var taskToken in tokens)
                {
                    task.TaskTokens.Add(taskToken);
                }
            }
            foreach (var customField in customFields)
            {
                task.UpdateCustomDataValue(customField.Key, customField.Value);
            }
            if (saveTask)
            {
                SaveTask(task);
            }
            return(task);
        }
예제 #2
0
        public Task AddNewTask(int taskTypeId, string taskContent)
        {
            if (taskTypeId == 0)
            {
                return(null);
            }
            var task = new Task {
                Content = taskContent, TaskTypeId = taskTypeId
            };
            var tokens = _taskParser.Parse(task);

            foreach (var taskToken in tokens)
            {
                task.TaskTokens.Add(taskToken);
            }
            SaveTask(task);
            return(task);
        }