// 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));
        }
예제 #2
0
        // 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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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);
        }
예제 #6
0
 public IActionResult Details(int id)
 {
     return(View(SeriesRepository.GetById(id)));
 }