Пример #1
0
        private void btnSearchMovie_Click(object sender, EventArgs e)
        {
            //Variable Declarations.
            LimelightBusiness business = new LimelightBusiness(repository);
            List <Movie>      results  = new List <Movie>();

            //Validate the title if it is being used as a search criteria.
            if (chkSearchTitle.Checked == true)
            {
                try
                {
                    business.ValidateSearchTitle(txtSearchTitle.Text);
                }
                catch (Exception ex)
                {
                    //Handle an exceptions thrown.
                    ApplicationUtilities.CatchExceptions(ex);
                    return;
                }
            }

            //Validate the release date range if it is being used as a search criteria.
            if (chkSearchReleaseDate.Checked == true)
            {
                try
                {
                    business.ValidateSearchDates(dtpSearchDateFrom.Value, dtpSearchDateTo.Value);
                }
                catch (Exception ex)
                {
                    //Handle an exceptions thrown.
                    ApplicationUtilities.CatchExceptions(ex);
                    return;
                }
            }

            //Validate the release date range if it is being used as a search criteria.
            if (chkSearchGenre.Checked == true)
            {
                try
                {
                    business.ValidateSearchGenre(cmbGenre.Text);
                }
                catch (Exception ex)
                {
                    //Handle an exceptions thrown.
                    ApplicationUtilities.CatchExceptions(ex);
                    return;
                }
            }

            //Search for the movies.
            //xxx();

            //Search for the movies with that match the entered criteria.
            results = SortMovies(SearchForMovies());

            //Add the movie titles from the search result to the movie list box.
            lstMovieList.Items.Clear();
            foreach (Movie movie in results)
            {
                lstMovieList.Items.Add(movie.Title);
            }
        }
 private void btnChoosePoster_Click(object sender, EventArgs e)
 {
     pbMoviePoster.ImageLocation = ApplicationUtilities.ChooseImageFile();
 }