Exemple #1
0
        public void MovieChoiceDropdown_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (MovieDBDropdown.SelectedValue == "FavoriteMovies")
            {
                MovieChoiceDropdown.DataBind();
                Title1.Text     = favs[MovieChoiceDropdown.SelectedIndex].Title;
                Year.Text       = favs[MovieChoiceDropdown.SelectedIndex].Year;
                Rated.Text      = favs[MovieChoiceDropdown.SelectedIndex].Rated;
                Released.Text   = favs[MovieChoiceDropdown.SelectedIndex].Released;
                Runtime.Text    = favs[MovieChoiceDropdown.SelectedIndex].Runtime;
                Genre.Text      = favs[MovieChoiceDropdown.SelectedIndex].Genre;
                Plot.Text       = favs[MovieChoiceDropdown.SelectedIndex].Plot;
                Director.Text   = favs[MovieChoiceDropdown.SelectedIndex].Director;
                Writer.Text     = favs[MovieChoiceDropdown.SelectedIndex].Writer;
                IMDbRating.Text = favs[MovieChoiceDropdown.SelectedIndex].IMDbRating;
                MyRating.Text   = favs[MovieChoiceDropdown.SelectedIndex].MyRating;
                MyComments.Text = favs[MovieChoiceDropdown.SelectedIndex].MyComments;
                movieposter.Attributes["src"] = favs[MovieChoiceDropdown.SelectedIndex].PosterUrl;
            }

            if (MovieDBDropdown.SelectedValue == "WantToSeeMovies")
            {
                MovieChoiceDropdown.DataBind();
                Title1.Text     = wants[MovieChoiceDropdown.SelectedIndex].Title;
                Year.Text       = wants[MovieChoiceDropdown.SelectedIndex].Year;
                Rated.Text      = wants[MovieChoiceDropdown.SelectedIndex].Rated;
                Released.Text   = wants[MovieChoiceDropdown.SelectedIndex].Released;
                Runtime.Text    = wants[MovieChoiceDropdown.SelectedIndex].Runtime;
                Genre.Text      = wants[MovieChoiceDropdown.SelectedIndex].Genre;
                Plot.Text       = wants[MovieChoiceDropdown.SelectedIndex].Plot;
                Director.Text   = wants[MovieChoiceDropdown.SelectedIndex].Director;
                Writer.Text     = wants[MovieChoiceDropdown.SelectedIndex].Writer;
                IMDbRating.Text = wants[MovieChoiceDropdown.SelectedIndex].IMDbRating;
                movieposter.Attributes["src"] = wants[MovieChoiceDropdown.SelectedIndex].PosterUrl;
            }

            if (MovieDBDropdown.SelectedValue == "NewReleaseMovies")
            {
                MovieChoiceDropdown.DataBind();
                Title1.Text     = news[MovieChoiceDropdown.SelectedIndex].Title;
                Year.Text       = news[MovieChoiceDropdown.SelectedIndex].Year;
                Rated.Text      = news[MovieChoiceDropdown.SelectedIndex].Rated;
                Released.Text   = news[MovieChoiceDropdown.SelectedIndex].Released;
                Runtime.Text    = news[MovieChoiceDropdown.SelectedIndex].Runtime;
                Genre.Text      = news[MovieChoiceDropdown.SelectedIndex].Genre;
                Plot.Text       = news[MovieChoiceDropdown.SelectedIndex].Plot;
                Director.Text   = news[MovieChoiceDropdown.SelectedIndex].Director;
                Writer.Text     = news[MovieChoiceDropdown.SelectedIndex].Writer;
                IMDbRating.Text = news[MovieChoiceDropdown.SelectedIndex].IMDbRating;
                movieposter.Attributes["src"] = news[MovieChoiceDropdown.SelectedIndex].PosterUrl;
            }
        }
Exemple #2
0
        public void MovieDBDropdown_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (MovieDBDropdown.SelectedValue == "FavoriteMovies")
            {
                MovieChoiceDropdown.Items.Clear();
                Models.MovieClassDataContext manager = new Models.MovieClassDataContext();
                favs = new List <Models.FavoriteMovy>();
                Models.FavoriteMovy empty = new Models.FavoriteMovy();
                favs.Add(empty);
                var query =
                    from c in manager.FavoriteMovies
                    select c;
                foreach (Models.FavoriteMovy c in query)
                {
                    favs.Add(c);
                }
                if (IsPostBack)
                {
                    MovieChoiceDropdown.DataSource     = favs;
                    MovieChoiceDropdown.DataTextField  = "Title";
                    MovieChoiceDropdown.DataValueField = "P_Id";
                    MovieChoiceDropdown.DataBind();
                }
            }

            if (MovieDBDropdown.SelectedValue == "WantToSeeMovies")
            {
                MovieChoiceDropdown.Items.Clear();
                Models.MovieClassDataContext manager = new Models.MovieClassDataContext();
                wants = new List <Models.WantToSeeMovy>();
                Models.WantToSeeMovy empty = new Models.WantToSeeMovy();
                wants.Add(empty);
                var query =
                    from c in manager.WantToSeeMovies
                    select c;
                foreach (Models.WantToSeeMovy c in query)
                {
                    wants.Add(c);
                }
                if (IsPostBack)
                {
                    MovieChoiceDropdown.DataSource     = wants;
                    MovieChoiceDropdown.DataTextField  = "Title";
                    MovieChoiceDropdown.DataValueField = "P_Id";
                    MovieChoiceDropdown.DataBind();
                }
            }

            if (MovieDBDropdown.SelectedValue == "NewReleaseMovies")
            {
                MovieChoiceDropdown.Items.Clear();
                Models.MovieClassDataContext manager = new Models.MovieClassDataContext();
                news = new List <Models.NewReleaseMovy>();
                Models.NewReleaseMovy empty = new Models.NewReleaseMovy();
                news.Add(empty);
                var query =
                    from c in manager.NewReleaseMovies
                    select c;
                foreach (Models.NewReleaseMovy c in query)
                {
                    news.Add(c);
                }
                if (IsPostBack)
                {
                    MovieChoiceDropdown.DataSource     = news;
                    MovieChoiceDropdown.DataTextField  = "Title";
                    MovieChoiceDropdown.DataValueField = "P_Id";
                    MovieChoiceDropdown.DataBind();
                }
            }
        }