public ActionResult Index(string ChapterList) { GetExampleList(); var args = GetParams(ChapterList); Chapter c = new Chapter() { ChapterName = args[0], ExampleName = args[1] }; if (c.IsValidChapterExample && (c.IsPdfResult || c.IsZipResult)) { ViewBag.HasResults = true; } ViewBag.ShowResultLink = args; return View(model: GetSourceText(ChapterList)); }
public ActionResult SendResults(string chapter, string example) { Chapter c = new Chapter() { ChapterName = chapter, ExampleName = example }; if (c.IsValidChapterExample && c.HasResult) { c.SendOutput(); if (c.IsPdfResult) { return new PdfResult(c.GetResultName); } else { return new ZipResult(c.GetResultName); } } return RedirectToAction("Index"); }