Exemplo n.º 1
0
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            Session["VisibleItem"]         = null;
            Session["SearchTitle"]         = SearchTextBox.Text;
            SearchMovieRepeater.DataSource = SearchMovies(SearchTextBox.Text);
            SearchMovieRepeater.DataBind();

            ResetRadioButtons();
        }
Exemplo n.º 2
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();
     }
 }
Exemplo n.º 3
0
 protected void SearchMovieRepeater_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "ShowDetails")
     {
         Session["VisibleItem"] = (string)e.CommandArgument;
         SearchMovieRepeater.DataBind();
     }
     else if (e.CommandName == "Delete")
     {
         ObjectDataSource1.DeleteParameters["movieId"].DefaultValue = e.CommandArgument.ToString();
         ObjectDataSource1.Delete();
         SearchMovieRepeater.DataBind();
     }
 }
Exemplo n.º 4
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");
                }
            }
        }
Exemplo n.º 5
0
 private void RebindData()
 {
     SearchMovieRepeater.DataSource = SearchMovies((string)Session["SearchTitle"]);
     SearchMovieRepeater.DataBind();
 }
Exemplo n.º 6
0
 protected void ShowAll_CheckedChanged(object sender, EventArgs e)
 {
     SearchMovieRepeater.DataSource = SearchMovies((string)Session["SearchTitle"]);
     SearchMovieRepeater.DataBind();
 }