public async Task <IActionResult> ForReview(string id) { ForReviewModel forReviewModel = new ForReviewModel { TaskId = id }; return(View(forReviewModel)); }
public async Task <IActionResult> ForReview(string id, ForReviewModel forReviewModel) { string userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier); TaskServiceModel taskServiceModel = await this._taskService.GetByIdAsync(forReviewModel.TaskId); if (taskServiceModel.Assignee.Id == userId) { taskServiceModel.CompleationDate = DateTime.Now; taskServiceModel.PictureUrl = forReviewModel.PictureURL; taskServiceModel.LocationId = taskServiceModel.Location.Id; taskServiceModel.TaskStatusId = taskServiceModel.TaskStatus.Id; taskServiceModel.TaskCategoryId = taskServiceModel.TaskCategory.Id; await this._taskService.PutForReview(taskServiceModel); return(RedirectToAction(nameof(Index))); } TempData["ExceptionMessage"] = "You can not mark Tasks that are not assigned to you as \"ForReview\""; return(RedirectToAction("InvalidTaskStatusChange", "Error")); }