public ActionResult ChangeStatus(InterviewRound vm) { if (ModelState.IsValid) { var selectedInterviewRound = _interviewRoundRepository.Get(vm.Id); if (selectedInterviewRound != null) { selectedInterviewRound.Status = vm.Status; var newActivity = new InterviewRoundActivity { InterviewRoundId = selectedInterviewRound.Id, Title = "Status Changed", Comment = vm.Comments, CreatedByUserId = WebUser.Id }; _interviewRoundActivityRepository.Create(newActivity); _unitOfWork.Commit(); } _interviewRoundRepository.Update(selectedInterviewRound); _unitOfWork.Commit(); return(RedirectToAction("Details", "InterviewRounds", new { id = vm.Id })); } return(View(vm)); }
public JsonResult AddNote(InterviewRoundActivityViewModel vm) { var selectedInterviewRound = _interviewRoundRepository.Get(vm.InterviewRoundId); if (selectedInterviewRound != null) { // Add it as an Activity var newActivity = new InterviewRoundActivity { Title = vm.Title, Comment = vm.Comment, InterviewRoundId = selectedInterviewRound.Id, CreatedByUserId = WebUser.Id }; _interviewRoundActivityRepository.Create(newActivity); _unitOfWork.Commit(); return(Json(true)); } return(Json(false)); }