Beispiel #1
0
        public async Task AddTask(TaskVm model)
        {
            var result = await Add(model.ToAddTaskCommand());

            if (result != null)
            {
                var updatedList = (await GetAllTasks()).Payload;

                if (updatedList != null)
                {
                    tasks = updatedList;
                    TasksUpdated?.Invoke(this, null);
                    return;
                }
                AddTaskFailed?.Invoke(this, "The creation was successful, but we can no longer get an updated list of members from the server.");
            }

            AddTaskFailed?.Invoke(this, "Unable to create record.");
        }
Beispiel #2
0
        public async Task AssignTask(TaskVm model)
        {
            var result = await Assign(model.ToAssignTaskCommand());

            if (result?.Succeed ?? false)
            {
                var updatedList = (await GetAllTasks()).Payload;
                if (updatedList != null)
                {
                    _tasks = updatedList;
                    TasksUpdated?.Invoke(this, null);
                    return;
                }
                AddTaskFailed?.Invoke(this, "The assignment was successful, but we can no longer get an updated list of tasks from the server.");
            }
            else
            {
                AddTaskFailed?.Invoke(this, "Unable to assign the task.");
            }
        }