Exemple #1
0
 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 = "";
     }
 }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 public async Task <IActionResult> AddNewTask([FromBody] ProjectTask task)
 {
     return(new OkObjectResult(await _taskService.AddNewTask(task)));
 }
Exemple #4
0
 public bool AddNewTask(string description)
 {
     return(_taskService.AddNewTask(User.Identity.Name, description));
 }
Exemple #5
0
 public IHttpActionResult AddTask(TaskDTO newTask)
 {
     _repository.AddNewTask(newTask);
     return(this.Ok());
 }