示例#1
0
        //GET: /Shows/Details/5

        public ActionResult Details(string show, int?season, int?episode)
        {
            Show showObj = Service.GetShowByName(show);

            if (showObj == null)
            {
                return(HttpNotFound());
            }
            return(View(showObj));
        }
示例#2
0
        public HttpResponse XmlGetShow(string name)
        {
            Show show = ShowService.GetShowByName(name);

            if (show == null)
            {
                return(new HttpResponse(HttpStatusCode.NotFound));
            }
            return(new HttpResponse(HttpStatusCode.OK, new XmlDoc(PI_NAMESPACE, show)));
        }
示例#3
0
        //
        // GET: /Proposals/Create

        // Creates Proposal Form based on an existing Show
        public ActionResult Create(string show)
        {
            if (show == null)
            {
                return(View());
            }

            Show showObj = ShowService.GetShowByName(show);

            if (showObj == null)
            {
                return(HttpNotFound());
            }
            User     user     = UserRepo.GetByUsername(User.Identity.Name);
            Proposal proposal = new Proposal {
                Show = showObj, User = user
            };

            return(View(proposal));
        }
示例#4
0
        //
        // GET: /Episodes/Details/5

        public ActionResult Details(string show, int?season, int?episode)
        {
            Show showObj = Service.GetShowByName(show);

            if (showObj == null)
            {
                return(HttpNotFound());
            }

            Episode episodeObj = Service.GetEpisodeByNumberShowAndSeason(show, season.GetValueOrDefault(), episode.GetValueOrDefault());

            if (episodeObj == null)
            {
                return(HttpNotFound());
            }

            return(View(episodeObj.ToEpisodeModel(show, season.Value)));
        }
示例#5
0
 public SeasonView(string show, Season season) :
     base("Season",
          A(ResolveUri.ForHome(), "Home")
          , H1(Text("TV Shows"))
          , H2(Text(show))
          , H3(Text(string.Format("Starts: {0}", season.Debut.ToString("d"))))
          , H3(Text(string.Format("Ends: {0}", season.Finale.ToString("d"))))
          , Ul(season.Episodes.Select(episode => Li(A(
                                                        ResolveUri.ForEpisode(ShowService.GetShowByName(show)
                                                                              , ShowService.GetSeason(show, season.Number)
                                                                              , ShowService.GetEpisodeByNumberShowAndSeason(show, season.Number, episode.Number)
                                                                              )
                                                        , episode.Title)
                                                    )
                                      ).ToArray()
               )
          )
 {
 }
示例#6
0
        public HttpResponse GetNewProposalFormFromExistingShow(string showname)
        {
            Show show = ShowService.GetShowByName(showname);

            return(new HttpResponse(HttpStatusCode.OK, new ProposalForm(show)));
        }