public IActionResult AssignToPerson(AssignPersonelToTaskDto model) { var task = _taskService.GetById(model.TaskId); task.AppUserId = model.AppUserId; _taskService.Update(task); _notificationService.Save(new Notification { AppUserId = model.AppUserId, Description = $"{task.Name} isimli iş için görevlendirildiniz." }); return(RedirectToAction("Index")); }
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)); }