Ejemplo n.º 1
0
        private void advSearchSubmit_Click(object sender, EventArgs e)
        {
            List<Movie> movieReults = new List<Movie>();
            MovieFilter filter = new MovieFilter();
            Cursor = Cursors.WaitCursor;

            if( titleTextBox.Text.Trim().Length > 0 )
            {
                filter.FilterTitle(titleTextBox.Text.Trim());
            }

            if( YearOfReleaseText.Text.Trim().Length > 0)
            {
                filter.FilterExactYear(Convert.ToInt32(YearOfReleaseText.Text.Trim()));
            }

            if( DirectorTextBox.Text.Trim().Length > 0)
            {
                filter.FilterDirector(DirectorTextBox.Text.Trim());
            }

            if( MinimumRatingText.Text.Trim().Length > 0)
            {
                filter.FilterMinRating(MinimumRatingText.Text.Trim());
            }

            if( actorTextBox.Text.Trim().Length > 0 )
            {
                filter.FilterActor(actorTextBox.Text.Trim());
            }

            if( GenreTextBox.Text.Trim().Length > 0 )
            {
                filter.FilterGenre(GenreTextBox.Text.Trim());
            }

            movieReults = filter.GetResult();
            SearchForm search = new SearchForm();
            search.PopulateView(movieReults);
            search.Show();
            Cursor = Cursors.Default;
            this.Close();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List<Movie> results = new List<Movie>();
            MovieFilter filter = new MovieFilter();
            listView1.Items.Clear();

            filter.FilterTitle(searchTextBox.Text);
            results = filter.GetResult();
            PopulateView(results);
            RecMoviesLabel.Text = "Search Results";
        }