private void ViewRecords_Load(object sender, EventArgs e) { //Variable Declarations. LimelightBusiness business = new LimelightBusiness(repository); //Fill the list of movies and reviews. try { movies = business.GetAllMovies(); } catch (Exception ex) { ApplicationUtilities.CatchExceptions(ex); return; } //Fill the movie titles listbox. FillMovieList(); lstMovieList.SelectedIndex = -1; //Fill the ratings combobox. FillRatingsList(); //Clear the controls on the form. ResetForm(); }
/// <summary> /// Adds a new rating and comment to the database for the selected movie. /// </summary> private void AddRating() { //Variable Declarations. LimelightBusiness business = new LimelightBusiness(repository); try { //Insert the new movie review. business.AddRating((int)cmbRating.SelectedValue, (int)lstMovieList.SelectedValue, txtComment.Text); //Refresh the list of movies. movies = business.GetAllMovies(); } catch (Exception ex) { //Handle the exception. ApplicationUtilities.CatchExceptions(ex); return; } //Re-display the movie information on the form. DisplayMovieInfo(); cmbRating.SelectedIndex = 0; txtComment.Text = ""; }
private void Search_Load(object sender, EventArgs e) { //Variable Declarations. LimelightBusiness business = new LimelightBusiness(repository); //Fill the list of movies and reviews. try { movies = business.GetAllMovies(); } catch (Exception ex) { ApplicationUtilities.CatchExceptions(ex); return; } //Fill the genres combobox. FillGenreList(); //Clear the controls on the form. ResetForm(); }