예제 #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);
        }
예제 #2
0
        public async Task <IActionResult> CompleteTask(Core.Task_Management_System.Entities.Task task)
        {
            var taskHistory = await _userService.CompleteTask(task);

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

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