public ActionResult Oversight() { AllMatchReportsViewModel ViewModel = new AllMatchReportsViewModel(); ViewModel.ListOfMatchReports = MatchReportCollection.GetAllMatchReports(); return(View(ViewModel)); }
public ActionResult UpdateFullReport(int id) { MatchReport list = MatchReportCollection.GetMatchReportByID(id); if (list == null) { return(RedirectToAction("Reports", "Oversight")); } ViewBag.Matchreport = list; return(View()); }
public IActionResult NewMatchReportAdded(MatchReportViewModel matchreport) { if (!ModelState.IsValid) { return(RedirectToAction("NewReport", "Reports")); } try { MatchReport newreport = new MatchReport(0, DateTime.Now, matchreport.Title, matchreport.Report, null); MatchReportCollection.AddMatchReport(newreport); return(RedirectToAction("Oversight", "Reports")); } catch (AddMatchReportFailedException exception) { ModelState.AddModelError("", exception.Message); return(RedirectToAction("NewReport", "Reports")); } }
public ActionResult DeleteReport(int id) { MatchReportCollection.DeleteMatchReport(id); return(RedirectToAction("Oversight", "Reports")); }