示例#1
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();
            }
        }
示例#2
0
文件: Edit.aspx.cs 项目: hetzelk/imdb
        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();
                }
            }
        }
示例#3
0
 partial void UpdateFavoriteMovy(FavoriteMovy instance);
示例#4
0
 partial void DeleteFavoriteMovy(FavoriteMovy instance);
示例#5
0
 partial void InsertFavoriteMovy(FavoriteMovy instance);