コード例 #1
0
        public ActionResult Oversight()
        {
            AllMatchReportsViewModel ViewModel = new AllMatchReportsViewModel();

            ViewModel.ListOfMatchReports = MatchReportCollection.GetAllMatchReports();
            return(View(ViewModel));
        }
コード例 #2
0
        public ActionResult UpdateFullReport(int id)
        {
            MatchReport list = MatchReportCollection.GetMatchReportByID(id);

            if (list == null)
            {
                return(RedirectToAction("Reports", "Oversight"));
            }
            ViewBag.Matchreport = list;
            return(View());
        }
コード例 #3
0
        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"));
            }
        }
コード例 #4
0
 public ActionResult DeleteReport(int id)
 {
     MatchReportCollection.DeleteMatchReport(id);
     return(RedirectToAction("Oversight", "Reports"));
 }