Ejemplo n.º 1
0
        protected void Page_init(object sender, EventArgs e)
        {
            Models.MovieClassDataContext manager = new Models.MovieClassDataContext();
            newmovies = new List <Models.NewReleaseMovy>();
            Models.NewReleaseMovy empty = new Models.NewReleaseMovy();
            newmovies.Add(empty);
            var q =
                from c in manager.NewReleaseMovies
                select c;

            foreach (Models.NewReleaseMovy c in q)
            {
                newmovies.Add(c);
            }
            if (!IsPostBack)
            {
                NewMovieDropdown.DataSource     = newmovies;
                NewMovieDropdown.DataTextField  = "Title";
                NewMovieDropdown.DataValueField = "P_Id";
                NewMovieDropdown.DataBind();
            }
        }
Ejemplo n.º 2
0
        protected void Page_init(object sender, EventArgs e)
        {
            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)
            {
                FavMovieDropdown.DataSource     = favs;
                FavMovieDropdown.DataTextField  = "Title";
                FavMovieDropdown.DataValueField = "P_Id";
                FavMovieDropdown.DataBind();
            }
        }
Ejemplo n.º 3
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();
                }
            }
        }