public IActionResult AssignTaskOnUser(TaskAssignUserDto model) { var item = _taskService.Get(model.TaskId); item.AppUserId = model.AppUserId; _taskService.Update(item); return(RedirectToAction("Index")); }
public IActionResult AssignTaskOnUser(TaskAssignUserDto model) { var taskEntity = _taskService.Get(model.TaskId); taskEntity.AppUserId = model.AppUserId; _taskService.Update(taskEntity); _notificationService.Add(new NotificationEntity { AppUserId = model.AppUserId, Description = $"{taskEntity.Name} adlı iş için görevlendirildiniz." }); return(RedirectToAction("Index")); }
public IActionResult AssignTaskToUser(TaskAssignUserDto model) { TempData["active"] = TempDataInfo.TaskOrder; var user = _userManager.Users.FirstOrDefault(a => a.Id == model.AppUserId); var task = _taskService.GetTaskWithUrgencyProperty(model.TaskId); AppUserListDto userModel = _mapper.Map <AppUserListDto>(user); TaskListDto taskListDto = _mapper.Map <TaskListDto>(task); TaskAssignUserListDto taskUserViewModel = new TaskAssignUserListDto(); taskUserViewModel.AppUser = userModel; taskUserViewModel.Task = taskListDto; return(View(taskUserViewModel)); }