private void OnAddTask(string obj) { if (!string.IsNullOrEmpty(NewTask)) { if (TaskTypeId == 0) { NewTask = "Can't add a task. Update Task Type from widget settings"; return; } var task = _taskService.AddNewTask(TaskTypeId, NewTask); var wm = new TaskViewModel(task, this, _messagingService); wm.Persist(); NewTask = ""; } }
private void OnAddTask(string obj) { if (!string.IsNullOrEmpty(NewTask) || CustomFields.Any(x => !string.IsNullOrEmpty(x.Value))) { if (TaskTypeId == 0) { NewTask = "Can't add a task. Update Task Type from widget settings"; return; } var task = _taskService.AddNewTask(TaskTypeId, NewTask, CustomFields.ToDictionary(x => x.Name, x => x.Value)); foreach (var customField in CustomFields) { customField.Value = ""; } var wm = new TaskViewModel(task, TaskType, this, _messagingService); wm.Persist(); NewTask = ""; OnTaskAdded(); } }
public async Task <IActionResult> AddNewTask([FromBody] ProjectTask task) { return(new OkObjectResult(await _taskService.AddNewTask(task))); }
public bool AddNewTask(string description) { return(_taskService.AddNewTask(User.Identity.Name, description)); }
public IHttpActionResult AddTask(TaskDTO newTask) { _repository.AddNewTask(newTask); return(this.Ok()); }