Example #1
0
        public async Task <bool> CreateTask(TaskVm model)
        {
            isOperationSuccessful = false;

            var result = await Create(model.ToCreateTaskCommand());

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

                if (updatedTasks != null)
                {
                    isOperationSuccessful = true;
                    tasksToDo             = updatedTasks;
                    TasksChanged?.Invoke(this, null);
                    return(isOperationSuccessful);
                }

                UpdateTaskFailed?.Invoke(this, "The creation was successful, but we can no longer get an updated list of tasks from the server.");
                return(isOperationSuccessful);
            }

            UpdateTaskFailed?.Invoke(this, "Unable to create record.");
            return(isOperationSuccessful);
        }
        public async Task AddTask(TaskModel model)
        {
            ListTasks.Add(model);
            TasksUpdated?.Invoke(this, null);

            var newModel = new TaskVm();

            newModel.Id           = model.Id;
            newModel.AssignedToId = model.Member;
            newModel.IsComplete   = model.IsDone;
            newModel.Subject      = model.Text;

            var result = await Create(newModel.ToCreateTaskCommand());

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

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

            UpdateTaskFailed?.Invoke(this, "Unable to create record.");
        }
        public async Task AddTask(TaskVm model)
        {
            var result = await Create(model.ToCreateTaskCommand());

            if (result != null)
            {
                await RefreshTask();

                return;
            }
            TaskFailed?.Invoke(this, "Unable to create task");
        }
        public async Task CreateTask(TaskVm model)
        {
            var result = await Create(model.ToCreateTaskCommand());

            if (result != null)
            {
                LoadTasks();
            }
            else
            {
                CreateTaskFailed?.Invoke(this, "Unable to create record.");
            }
        }
        /// <summary>
        /// Creates the task.
        /// </summary>
        /// <param name="model">The model.</param>
        public async Task CreateTask(TaskVm model)
        {
            var createdTaskResult = await Create(model.ToCreateTaskCommand());

            if (createdTaskResult != null)
            {
                LoadTasks();
            }
            else
            {
                CreateTaskFailed?.Invoke(this, "Create task operation failed.");
            }
        }
        public async void AddTask(TaskVm model)
        {
            var result = await Create(model.ToCreateTaskCommand());

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

                if (updatedList != null)
                {
                    Tasks = updatedList;
                    TasksUpdated?.Invoke(this, null);
                }
            }
        }
        public async Task AddTask(TaskVm model)
        {
            var result = await Create(model.ToCreateTaskCommand());

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

                if (updatedList != null)
                {
                    _tasks = updatedList;
                    TasksUpdated?.Invoke(this, null);
                    return;
                }
                UpdateTaskFailed?.Invoke(this, "The creation was successful, but we can no longer get an updated list of tasks from the server.");
            }
            UpdateTaskFailed?.Invoke(this, "Unable to create record.");
        }
Example #8
0
        public async Task <CreateTaskCommandResult> CreateTask(TaskVm model)
        {
            var result = await Create(model.ToCreateTaskCommand());

            return(result);
        }