// GET: Admin/Season public ActionResult Index(int _seriesId) { var seasons = _seasonRepository.GetSeasonsBySeriesId(_seriesId); var vm = new vmEntityList <Season>(seasons.Cast <Season>()); vm.SearchEntity = _seriesRepository.GetById(_seriesId); vm.PageHeading = string.Format("{0} Seasons", vm.SearchEntity.Title); return(PartialView("_seasonTableAlternating", vm)); }
// GET: Admin/Series/Save public ActionResult Save(int?_seriesId) { var vm = new vmEntity(_genreRepository.GetAll().OrderBy(x => x.Title)); vm.Series = _seriesId != 0 ? _seriesRepository.GetById(_seriesId.GetValueOrDefault()) : new Series(); vm.PageHeading = _seriesId != null?string.Format("Edit Series: {0}", vm.Series.Title) : string.Format("Add New Series"); return(PartialView("_savePanel", vm)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } // Get the series. var series = _seriesRepository.GetById((int)id); if (series == null) { return(HttpNotFound()); } return(View(series)); }
public ActionResult Detail(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var series = _seriesRepository.GetById((int)id); if (series == null) { return(HttpNotFound()); } // Sort the comic books. series.ComicBooks = series.ComicBooks .OrderByDescending(cb => cb.IssueNumber) .ToList(); return(View(series)); }
public Series Get(int id) { var series = _seriesRepository.GetById(id); if (series == null) { var response = new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent($"No Series with ID {id}"), ReasonPhrase = "Series ID not found" }; throw new HttpResponseException(response); } return(series); }
public IActionResult Details(int id) { return(View(SeriesRepository.GetById(id))); }