Exemplo 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();
            }
        }
Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 3
0
 partial void UpdateNewReleaseMovy(NewReleaseMovy instance);
Exemplo n.º 4
0
 partial void DeleteNewReleaseMovy(NewReleaseMovy instance);
Exemplo n.º 5
0
 partial void InsertNewReleaseMovy(NewReleaseMovy instance);