Exemplo n.º 1
0
        public async Task <TaskHistory> CompleteTask(Core.Task_Management_System.Entities.Task task)
        {
            var taskHistory = new TaskHistory
            {
                UserId      = task.UserId,
                Title       = task.Title,
                Description = task.Description,
                DueDate     = task.DueDate,
                Completed   = DateTime.Now,
                Remarks     = task.Remarks
            };
            var createdTaskHistory = await _taskHistoryRepository.AddAsync(taskHistory);

            await _taskRepository.DeleteAsync(task);

            return(createdTaskHistory);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CompleteTask(Core.Task_Management_System.Entities.Task task)
        {
            var taskHistory = await _userService.CompleteTask(task);

            return(Ok(taskHistory));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> CreateTask(Core.Task_Management_System.Entities.Task task)
        {
            var createdTask = await _userService.CreateTask(task);

            return(Ok(createdTask));
        }
Exemplo n.º 4
0
 public async Task <Core.Task_Management_System.Entities.Task> CreateTask(Core.Task_Management_System.Entities.Task task)
 {
     return(await _taskRepository.AddAsync(task));
 }