Esempio n. 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 = "";
     }
 }
Esempio n. 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();
     }
 }
 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);
         wm.Persist();
         NewTask = "";
     }
 }
Esempio n. 4
0
 private void OnAddTask(string obj)
 {
     if (!string.IsNullOrWhiteSpace(NewTask) || CustomFields.Any(x => !string.IsNullOrWhiteSpace(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), !Settings.DontCreateTaskHistory);
         foreach (var customField in CustomFields)
         {
             customField.Value = "";
         }
         if (!Settings.DontCreateTaskHistory)
         {
             var wm = new TaskViewModel(task, TaskType, this, _messagingService);
             wm.Persist();
         }
         ExecuteTaskCreateCommands(task);
         NewTask = "";
         OnTaskAdded();
     }
 }