public ActionResult Advice(int id, AdviceViewModel model, User user, string btnGive) { Suggestion suggestion = _suggestionRepository.FindBy(id); var bpCoordinator = (BPCoordinator)user; if (btnGive != null) { bpCoordinator.GiveAdvice(suggestion, model.Suggestion.Advice); TempData["Success"] = "Het advies is verzonden"; _suggestionRepository.SaveChanges(); } return RedirectToAction("Index", "Suggestion"); }
public ActionResult Advice(int id) { Suggestion suggestion = _suggestionRepository.FindBy(id); AdviceViewModel suggestionViewModel = new AdviceViewModel() { Suggestion = new SuggestionViewModel() { Id = suggestion.Id, Context = suggestion.Context, Goal = suggestion.Goal, Keywords = suggestion.Keywords, Motivation = suggestion.Motivation, References = suggestion.References, Subject = suggestion.Subject, ResearchQuestion = suggestion.ResearchQuestion, Title = suggestion.Title } }; return View(suggestionViewModel); }