public IActionResult Delete(int id) { Task task = _taskService.GetById(id); if (task == null) { return(NotFound()); } _taskService.Delete(task); return(Json(null)); }
public IActionResult AssignPersonelToTask(AssignPersonelToTaskDto model) { TempData["menu"] = "work"; AppUser user = _userManager.Users.FirstOrDefault(x => x.Id == model.AppUserId); YSKProje.ToDo.Entities.Concrete.Task task = _taskService.GetTaskWithUrgent(model.TaskId); var userModel = _mapper.Map <ListAppUserDto>(user); var taskModel = _mapper.Map <ListTaskDto>(task); AssignPersonelToTaskListDto assignPersonelToTaskListModel = new AssignPersonelToTaskListDto(); assignPersonelToTaskListModel.AppUser = userModel; assignPersonelToTaskListModel.Task = taskModel; return(View(assignPersonelToTaskListModel)); }