Пример #1
0
 static void InitShows()
 {
     Show show = new Show{ Name = "Breaking Bad"
                         , Description = "Informed he has terminal cancer, an underachieving chemistry genius "  +
                                           "turned high school chemistry teacher turns to using his expertise in " +
                                           "chemistry to provide a legacy for his family..."                       +
                                           " by producing the world's highest quality crystal meth."
                         };
     Season season = new Season
                         {
                            Number = 1
                          , Name = "1"
                          , Debut = new DateTime(2008, 1, 28)
                          , Finale = new DateTime(2008, 3, 10)
                         };
     Episode episode = new Episode
                           {
                                 Title = "Pilot"
                               , Duration = 40
                               , Synopsis =
                                    "Walter White, a 50-year old chemistry teacher, secretly begins making crystal methamphetamine"
                               +    " to support his family when he finds out that he has terminal lung cancer. He teams up with a former student,"
                               +    " Jesse Pinkman, who is a meth dealer. Jesse is trying to sell the meth but the dealers snatch him and make him"
                               +    " show them the lab. Walter knows they intend to kill him so he poisons them while showing them his recipe."
                               , Score = 4
                           };
     ShowService.AddShow(show);
     ShowService.AddSeasonToShow(show.Name, season);
     ShowService.AddEpisodeToSeason(show.Name, 1, episode);
 }
Пример #2
0
 public EpisodeView(string show, Season season, Episode episode)
     : base("Episode",
       A(ResolveUri.ForHome(), "Home")
     , H1(Text("TV Shows"))
     , H2(Text(show))
     , Ul(
       Li(Text("Season: "), Text(season.Name))
     , Li(Text("Title: "), Text(episode.Title))
     , Li(Text("Duration: "), Text("" + episode.Duration))
     , Li(Text("Synopsis: "), Text(episode.Synopsis))
     , Li(Text("Score: "), Text("" + episode.Score))))
 {
 }
Пример #3
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()
          ))
 {
 }
Пример #4
0
 public static string ForSeason(Show show, Season season)
 {
     return string.Format("/shows/{0}/{1}", show.Name, season.Number);
 }
Пример #5
0
 public static string ForEpisode(Show show, Season season, Episode episode)
 {
     return string.Format("/shows/{0}/{1}/{2}", show, season.Number, episode.Number);
 }
Пример #6
0
 public static void AddSeasonToShow( string showName, Season season )
 {
     Show show = GetShowByName(showName);
     show.Seasons.Add(season);
 }