public void OnPost(string search, List <string> rating, float?minIMDB, float?maxIMDB) { Movies = MovieDatabase.All; if (search != null && rating.Count != 0) { Movies = MovieDatabase.SearchAndFilter(search, rating); } else if (rating.Count != 0) { Movies = MovieDatabase.Filter(rating); } else if (search != null) { Movies = MovieDatabase.Search(Movies, search); } else { Movies = MovieDatabase.All; } if (rating.Count != 0) { Movies = MovieDatabase.FilterByMPAA(Movies, rating); } if (minIMDB != null) { Movies = MovieDatabase.FilterByMinIMDB(Movies, (float)minIMDB); } }
public static List <MOVIE> getmovieS() { MovieDatabase db = new MovieDatabase(); var rows = db.MOVIEs.ToList(); return(rows); }
/// <summary> /// The merge with database. /// </summary> /// <param name="importDatabase"> /// The import database. /// </param> public static void MergeWithDatabase( BindingList <MovieModel> importDatabase, MovieDBTypes type = MovieDBTypes.Movies) { foreach (MovieModel movie in importDatabase) { if (movie.SmallPoster != null) { movie.SmallPoster = ImageHandler.ResizeImage(movie.SmallPoster, 100, 150); } switch (type) { case MovieDBTypes.Movies: MovieDatabase.Add(movie); break; case MovieDBTypes.Duplicates: DuplicatedMoviesDatabase.Add(movie); break; default: break; } } if (type == MovieDBTypes.Movies) { MediaPathDBFactory.GetMediaPathMoviesUnsorted().Clear(); GeneratePictureGallery(); } }
public ActionResult _Fav(string ID) { List <string> errors = new List <string>(); // You might want to return an error if something wrong happened FavouriteMovie favMovieData = new FavouriteMovie(); favMovieData.MovieId = ID; favMovieData.UserId = User.Identity.GetUserId(); try { int movieID = int.Parse(ID); TMDbClient client = new TMDbClient("a331c3f9e48b75412c7c99a04a4aba78"); client = MovieDatabase.FetchConfig(client); Movie movie = client.GetMovieAsync(movieID, MovieMethods.Videos).Result; string xmlMovieInfo = MovieDatabase.GetXMLFromObject(movie); var xmlData = XElement.Parse(xmlMovieInfo); favMovieData.MovieInfo = xmlData; } catch (Exception ex) { errors.Add(ex.ToString()); } db.FavouriteMovies.Add(favMovieData); db.SaveChanges(); return(Json(errors, JsonRequestBehavior.AllowGet)); }
public static List <MOVIE> browsemovie(string movie) { MovieDatabase db = new MovieDatabase(); var rows = db.MOVIEs.Where(row => row.movie_title.ToLower().Contains(movie.ToLower())).ToList(); return(rows); }
public void OnPost() { Movies = MovieDatabase.All; if (search != null && mpaa.Count != 0) { Movies = MovieDatabase.SearchAndFilter(search, mpaa); } else if (mpaa.Count != 0) { Movies = MovieDatabase.Filter(mpaa); } else if (search != null) { Movies = MovieDatabase.Search(Movies, search); } else { Movies = MovieDatabase.All; } if (mpaa.Count != 0) { Movies = MovieDatabase.FilterByMPAA(Movies, mpaa); } if (minIMDB != null) { Movies = MovieDatabase.FilterByMinIMDB(Movies, (float)minIMDB); } }
public void OnPost() { Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByGenre(Movies, Genres); Movies = MovieDatabase.FilterByIMDBRating(Movies, IMDBMin, IMDBMax); }
public void OnPost(string search, List <string> mpaa, float?minIMDB, float?maxIMDB) { Movies = MovieDatabase.All; if (search != null) { this.search = search; Movies = MovieDatabase.Search(Movies, search); } if (mpaa.Count > 0) { this.mpaa = mpaa; Movies = MovieDatabase.FilterByMPAA(Movies, mpaa); } if (minIMDB is float min) { this.minIMDB = minIMDB; Movies = MovieDatabase.FilterByMinIMDB(Movies, min); } if (maxIMDB is float max) { this.maxIMDB = maxIMDB; Movies = MovieDatabase.FilterByMaxIMDB(Movies, max); } }
public void Onpost() { Movies = MovieDatabase.All; if (search != null && mapp.Count != 0) { Movies = MovieDatabase.SearchAndFilter(search, mapp); } else if (mapp.Count != 0) { Movies = MovieDatabase.Filter(mapp); } else if (search != null) { Movies = MovieDatabase.Search(Movies, search); } if (mapp.Count != 0) { Movies = MovieDatabase.FilterByMPAA(Movies, mapp); } if (minIMDB != null) { Movies = MovieDatabase.FilterByBinIMDB(Movies, (float)minIMDB); } if (maxIMDB != null) { Movies = MovieDatabase.FilterByMaxIMDB(Movies, (float)maxIMDB); } }
public static List <GENRE> browsegenre(string genre) { MovieDatabase db = new MovieDatabase(); var rows = db.GENREs.Where(row => row.name.ToLower().Contains(genre.ToLower())).ToList(); return(rows); }
public static bool UpdateGenre(int id, GENRE genre) { bool successfullyUpdatedMember = false; using (MovieDatabase context = new MovieDatabase()) { var genreToUpdate = context.GENREs.SingleOrDefault(row => row.id == id); try { context.Database.Connection.Open(); context.GENREs.Attach(genreToUpdate); genreToUpdate = genre; context.SaveChanges(); successfullyUpdatedMember = true; } catch (Exception ex) { } finally { context.Database.Connection.Close(); } } return(successfullyUpdatedMember); }
private void AddTabMovies() { //add video section Log.Info("add video section"); if (splashScreen != null) { splashScreen.SetInformation("Adding video section..."); } SectionSettings movie = new Movies(); AddSection(new ConfigPage(null, movie, false)); Log.Info(" add video shares section"); AddSection(new ConfigPage(movie, new MovieShares(), false)); Log.Info(" add video database section"); MovieDatabase movieDbConfig = new MovieDatabase(); AddSection(new ConfigPage(movie, movieDbConfig, false)); Log.Info(" add video player section"); AddSection(new ConfigPage(movie, new MoviePlayer(), false)); Log.Info(" add video zoom section"); AddSection(new ConfigPage(movie, new MovieZoom(), false)); Log.Info(" add video extensions section"); AddSection(new ConfigPage(movie, new MovieExtensions(), true)); Log.Info(" add video views section"); AddSection(new ConfigPage(movie, new MovieViews(), true)); Log.Info(" add video postprocessing section"); AddSection(new ConfigPage(movie, new MoviePostProcessing(), true)); }
public static List <GENRE> getGenres() { MovieDatabase db = new MovieDatabase(); var rows = db.GENREs.ToList(); return(rows); }
public void OnPost() { if (search != null && mpaa.Count > 0) { Movies = MovieDatabase.Search(search); Movies = MovieDatabase.FilterByMPAA(Movies, mpaa); } else if (search != null) { Movies = MovieDatabase.Search(search); } else if (mpaa.Count > 0) { Movies = MovieDatabase.FilterByMPAA(MovieDatabase.All, mpaa); } else { Movies = MovieDatabase.All; } if (minIMDB is float min) { Movies = MovieDatabase.FilterByMinIMDB(Movies, min); } if (maxIMDB is float max) { Movies = MovieDatabase.FilterByMaxIMDB(Movies, max); } }
public void OnPost() { Movies = MovieDatabase.All; /* if (search != null && mpaa.Count > 0) * { * Movies = MovieDatabase.Search(search); * Movies = MovieDatabase.FilterByMPAA(Movies, mpaa); * } * else*/if (search != null) { Movies = MovieDatabase.Search(Movies, search); } else if (mpaa.Count > 0) { Movies = MovieDatabase.FilterByMPAA(Movies, mpaa); } else { Movies = MovieDatabase.All; } if (minIMDB is float min) { Movies = MovieDatabase.FilterByMinIMDB(Movies, min); } }
public void OnPost() { Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByIMDBRating(Movies, IMDBin, IMDBMax); Movies = MovieDatabase.FilterByRottenTomatoesRating(Movies, TomatoesMin, TomatoesMax); }
public override global::System.Data.DataSet Clone() { MovieDatabase cln = ((MovieDatabase)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static void RestoreHiddenMovie(MovieModel movieModel) { HiddenMovieDatabase.Remove(movieModel); movieModel.Hidden = false; MovieDatabase.Add(movieModel); DatabaseIOFactory.DatabaseDirty = true; }
public void OnGet() { MPAARatings = Request.Query["MPAARatings"]; SearchTerms = Request.Query["SearchTerms"]; Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByIMDBRating(Movies, IMDBMin, IMDBMax); Movies = MovieDatabase.FilterByRottenTomatoesRating(Movies, RTMin, RTMax); }
public MovieManagerWindow(MovieDatabase movieDatabase) { this.movieDatabase = movieDatabase; moviesViewModel = new MoviesViewModel(movieDatabase); DataContext = moviesViewModel; InitializeComponent(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); var connString = ConfigurationManager.ConnectionStrings["MovieDatabase"]; _database = new SqlMovieDatabase(connString.ConnectionString); RefreshUI(); }
public MovieDatabase() { if (MovieDatabase == null) { using (StreamReader file = System.IO.File.OpenText("movies.json")) { string json = file.ReadToEnd(); MovieDatabase = JsonConvert.DeserializeObject <List <Movie> >(json); } } }
public RentManagerWindow(TenantDatabase tenantDatabase) { DatabaseManager <MovieDatabase> databaseManager = new DatabaseManager <MovieDatabase>(StringConsts.MovieDatabaseLocation); movieDatabase = databaseManager.Locate(); tenantsViewModel = new TenantsViewModel(tenantDatabase); DataContext = tenantsViewModel; InitializeComponent(); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { MovieDatabase ds = new MovieDatabase(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
/// <summary> /// Gets the search results for display on the page /// </summary> public void OnGet(double?IMDBMin, double?IMDBMax, double?RottenMin, double?RottenMax) { this.IMDBMin = IMDBMin; this.IMDBMax = IMDBMax; this.RottenMin = RottenMin; this.RottenMax = RottenMax; Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByGenre(Movies, Genres); Movies = MovieDatabase.FilterByIMDBRating(Movies, this.IMDBMin, this.IMDBMax); Movies = MovieDatabase.FilterByRottenRating(Movies, this.RottenMin, this.RottenMax); }
public App() { InitializeComponent(); if (database == null) { database = new MovieDatabase(); } MainPage = new Views.MainPage(); //MainPage = new NavigationPage(new Views.MainPage()); }
/// <summary> /// Gets the search results for display on the page /// </summary> public void OnGet(double?IMDBMin, double?IMDBMax) { this.IMDBMin = IMDBMin; this.IMDBMax = IMDBMax; //SearchTerms = Request.Query["SearchTerms"]; //MPAARatings = Request.Query["MPAARatings"]; //Genres = Request.Query["Genres"]; //IMDBMin = float.Parse(Request.Query["IMDBMin"]); Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByGenre(Movies, Genres); Movies = MovieDatabase.FilterByIMDBRating(Movies, IMDBMin, IMDBMax); }
/// <summary> /// Gets the search results for display on the page /// </summary> public void OnGet(double?IMDBMin, double?IMDBMax) { SearchTerms = Request.Query["SearchTerms"]; MPAARatings = Request.Query["MPAARating"]; Genres = Request.Query["Genres"]; // Nullable conversion workaround this.IMDBMin = IMDBMin; this.IMDBMax = IMDBMax; Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByGenre(Movies, Genres); Movies = MovieDatabase.FilterByIMDBRating(Movies, IMDBMin, IMDBMax); }
/// <summary> /// Does the response initialization for incoming GET requests /// </summary> public void OnGet(double?IMDBMin, double?IMDBMax, double?RottenTomatoeMin, double?RottenTomatoeMax) { // Nullable conversion workaround this.IMDBMin = IMDBMin; this.IMDBMax = IMDBMax; this.RottenTomatoeMin = RottenTomatoeMin; this.RottenTomatoeMax = RottenTomatoeMax; Movies = MovieDatabase.Search(SearchTerms); Movies = MovieDatabase.FilterByMPAARating(Movies, MPAARatings); Movies = MovieDatabase.FilterByGenre(Movies, Genres); Movies = MovieDatabase.FilterByIMDBRating(Movies, IMDBMin, IMDBMax); Movies = MovieDatabase.FilterByRottenTomatoeRating(Movies, RottenTomatoeMin, RottenTomatoeMax); }
public void OnPost() { Movies = MovieDatabase.FilterIMBD(minIMBD, maxIMBD); if (rating.Count != 0) { Movies = MovieDatabase.Filter(rating, Movies); } if (search != null) { Movies = MovieDatabase.Search(search, Movies); } }
public StorageService(SQLite.Net.SQLiteConnection conn) { db = new MovieDatabase(conn); }
private void btnContinue_Click(object sender, EventArgs e) { Form f = new MovieDatabase(); f.Show(); this.Hide(); }