예제 #1
0
        protected void Search_btn_Click(object sender, EventArgs e)
        {
            if (Genrelist.SelectedValue != "Select Genre" && !string.IsNullOrEmpty(Moviename_tb.Text))
            {
                ClearListView();

                int    genre = Genrelist.SelectedIndex;
                string title = Moviename_tb.Text;
                MovieContainer.MovieInfo().Clear();
                PopulateListView(MovieContainer.MovieByNameAndGenre(genre, title));
            }
            else if (Genrelist.SelectedValue != "Select Genre" && string.IsNullOrEmpty(Moviename_tb.Text))
            {
                ClearListView();

                int genre = Genrelist.SelectedIndex;
                MovieContainer.MovieInfo().Clear();
                PopulateListView(MovieContainer.MovieByGenre(genre));
            }
            else if (Genrelist.SelectedValue == "Select Genre" && !string.IsNullOrEmpty(Moviename_tb.Text))
            {
                ClearListView();

                string title = Moviename_tb.Text;
                MovieContainer.MovieInfo().Clear();
                PopulateListView(MovieContainer.MovieByName(title));
            }
            else
            {
                return;
            }
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Session.Clear();
     if (!Page.IsPostBack)
     {
         PopulateListView(MovieContainer.MovieInfo());
     }
 }