예제 #1
0
        public async System.Threading.Tasks.Task <bool> CompleteTask(int id)
        {
            var task = await _taskRepository.GetById(id);

            if (task == null)
            {
                return(false);
            }

            var taskHistory = new TaskHistory()
            {
                UserId      = task.UserId,
                Title       = task.Title,
                Description = task.Description,
                DueDate     = task.DueDate,
                Remarks     = task.Remarks,
                Completed   = DateTime.Now,
            };
            await _taskHistoryRepository.Create(taskHistory);

            return(await DeleteTask(id));
        }
        public async Task <TaskHistory> AddTask(TaskHistoryRequestModel taskRequestModel)
        {
            var task = _requestMapper.Map <TaskHistory>(taskRequestModel);

            return(await _taskHistoryRepository.Create(task));
        }