private void LoadFilmDetails() { this.DataContext = SelectedFilm; //if (!String.IsNullOrWhiteSpace(SelectedFilm.YoutubeTrailer)) // this.btnPlay.Visibility = System.Windows.Visibility.Visible; //else // this.btnPlay.Visibility = System.Windows.Visibility.Collapsed; var films = App.FilmCinemas[SelectedFilm.EDI]; this.lstMain.IsGroupingEnabled = Config.GroupData; if (Config.GroupData) { CinemaData cd = new CinemaData(films); var dataLetter = cd.GetGroupsByLetter(); lstMain.ItemsSource = dataLetter.ToList(); } else { lstMain.ItemsSource = films; } if (SelectedFilm.FilmCast == null || SelectedFilm.FilmCast.Count == 0) { this.pMain.Items.Remove(this.piCast); } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (bLoaded) { return; } if (!Config.ShowCleanBackground) { this.LayoutRoot.Background = new ImageBrush() { ImageSource = new BitmapImage(new Uri("SplashScreenImage.jpg", UriKind.Relative)), Opacity = 0.2, Stretch = Stretch.UniformToFill }; } LoadPushpins(); CinemaData cd = new CinemaData(App.Cinemas); var dataLetter = cd.GetGroupsByLetter(); this.lstMain.ItemsSource = dataLetter.ToList(); bLoaded = true; }
public static List <CinemaInfo> Map(CinemaData cinemas) { var response = new List <CinemaInfo>(); foreach (var cinema in cinemas.Cinemas) { response.Add(new CinemaInfo { Identifier = cinema.Id, Name = cinema.Name, DistanceDescription = $"{cinema.Distance} miles away" }); } return(response); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, CinemaContext cinemaContext) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); var applicationBuilder = env.IsDevelopment() ? app.UseDeveloperExceptionPage() : app.UseExceptionHandler(); //clear database and add new cinema information var cinemaData = new CinemaData(cinemaContext); cinemaData.Seed(); app.UseMvc(); }
private void LoadFilmDetails() { this.DataContext = SelectedFilm; if (!String.IsNullOrWhiteSpace(SelectedFilm.YoutubeTrailer)) { this.btnPlay.Visibility = System.Windows.Visibility.Visible; } else { this.btnPlay.Visibility = System.Windows.Visibility.Collapsed; } CinemaData cd = new CinemaData(App.FilmCinemas[SelectedFilm.EDI]); var dataLetter = cd.GetGroupsByLetter(); lstMain.ItemsSource = dataLetter; }
static void Main(string[] args) { CinemaData db = new CinemaData(); using (db) { //Create Cinema Objects Cinema c1 = new Cinema() { CinemaID = 1, Name = "Sligo Omniplex", Location = "Sligo", Website = "https://www.omniplex.ie/cinema/sligo" }; Cinema c2 = new Cinema() { CinemaID = 2, Name = "IMC Ballina", Location = "Ballina", Website = "https://www.imccinemas.ie/Whats-On/Ballina" }; Cinema c3 = new Cinema() { CinemaID = 3, Name = "Mayo Movie World", Location = "Castlebar", Website = "http://www.mayomovieworld.ie/" }; Cinema c4 = new Cinema() { CinemaID = 4, Name = "IMC Galway", Location = "Galway", Website = "https://www.imccinemas.ie/Film-Times/Galway/" }; //Create Movie Objects AddMovie m1 = new AddMovie() { MovieID = 1, Name = "Onward", Cost = 8m, Actors = "Tom Holland, Chris Pratt, Julia Louis-Dreyfus", Director = "Dan Scanlon", Times = "14:00, 17:30", Rating = "PG", TypeOfGenre = Genre.Comedy, ImageName = "Onward.jpg", CinemaID = 1, Cinema = c1 }; AddMovie m2 = new AddMovie() { MovieID = 2, Name = "A Quiet Place Part II", Cost = 8m, Actors = "Emily Blunt, Millicent Simmonds, Cillian Murphy", Director = "John Krasinski", Times = "18:00, 20:30", Rating = "PG-13", TypeOfGenre = Genre.Horror, ImageName = "AQuietPlace.jpg", CinemaID = 2, Cinema = c2 }; AddMovie m3 = new AddMovie() { MovieID = 3, Name = "The Way Back", Cost = 8m, Actors = "Ben Affleck, Al Madrigal, Janina Gavankar", Director = "Gavin O'Connor", Times = "15:30, 18:30", Rating = "R", TypeOfGenre = Genre.Drama, ImageName = "TheWayBack.jpg", CinemaID = 3, Cinema = c3 }; AddMovie m4 = new AddMovie() { MovieID = 4, Name = "Bloodshot", Cost = 8m, Actors = "Vin Diesel, Eiza Ginzalez, Sam Heughan", Director = "Dave Wilson", Times = "16:00, 20:00", Rating = "PG-13", TypeOfGenre = Genre.Action, ImageName = "Bloodshot.jpg", CinemaID = 4, Cinema = c4 }; AddMovie m5 = new AddMovie() { MovieID = 5, Name = "Bird of Prey", Cost = 8m, Actors = "Margot Robbie, Rosie Perez, Mary Elizabeth Winstead", Director = "Cathy Yan", Times = "14:30, 19:00", Rating = "R", TypeOfGenre = Genre.Action, ImageName = "BirdsOfPrey.jpg", CinemaID = 1, Cinema = c1 }; AddMovie m6 = new AddMovie() { MovieID = 6, Name = "Downhill", Cost = 8m, Actors = "Julia Louis-Dreyfus, Will Ferrell, Miranda Otto", Director = "Nat Faxon, Jim Rash", Times = "14:00, 19:30", Rating = "R", TypeOfGenre = Genre.Comedy, ImageName = "Downhill.jpg", CinemaID = 2, Cinema = c2 }; //Add Cinemas to the database db.Cinemas.Add(c1); db.Cinemas.Add(c2); db.Cinemas.Add(c3); db.Cinemas.Add(c4); Console.WriteLine("Added Cinemas to the Database"); //Add movies to the database db.AddMovies.Add(m1); db.AddMovies.Add(m2); db.AddMovies.Add(m3); db.AddMovies.Add(m4); db.AddMovies.Add(m5); db.AddMovies.Add(m6); Console.WriteLine("Added Movies to Database"); //Save changes to the database db.SaveChanges(); Console.WriteLine("Saved to Database"); } }