Exemple #1
0
 protected void FilterOutWatched_CheckedChanged(object sender, EventArgs e)
 {
     if (Session["SearchTitle"] != null)
     {
         TmdbSavedMoviesBLL tmdbSavedMoviesBLL = new TmdbSavedMoviesBLL();
         IList <TmdbMovie>  savedMovies        = tmdbSavedMoviesBLL.GetMovies();
         SearchMovieRepeater.DataSource = SearchMovies((string)Session["SearchTitle"]).Where(m => !savedMovies.Any(s => s.MovieId == m.MovieId));
         SearchMovieRepeater.DataBind();
     }
 }
Exemple #2
0
        protected void FadeWatched_CheckedChanged(object sender, EventArgs e)
        {
            SearchMovieRepeater.DataSource = SearchMovies((string)Session["SearchTitle"]);
            SearchMovieRepeater.DataBind();

            TmdbSavedMoviesBLL tmdbSavedMoviesBLL = new TmdbSavedMoviesBLL();
            IList <TmdbMovie>  savedMovies        = tmdbSavedMoviesBLL.GetMovies();

            foreach (var item in SearchMovieRepeater.Items)
            {
                DataListItem dataListItem = (DataListItem)item;
                int          gameId       = int.Parse(((Label)dataListItem.FindControl("MovieIdLabel")).Text);

                if (savedMovies.Any(s => s.MovieId == gameId))
                {
                    ((Panel)dataListItem.FindControl("MoviePanel")).Style.Add("opacity", "0.5");
                }
            }
        }