protected void SearchButton_Click(object sender, EventArgs e) { Session["VisibleItem"] = null; Session["SearchTitle"] = SearchTextBox.Text; SearchMovieRepeater.DataSource = SearchMovies(SearchTextBox.Text); SearchMovieRepeater.DataBind(); ResetRadioButtons(); }
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(); } }
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(); } }
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"); } } }
private void RebindData() { SearchMovieRepeater.DataSource = SearchMovies((string)Session["SearchTitle"]); SearchMovieRepeater.DataBind(); }
protected void ShowAll_CheckedChanged(object sender, EventArgs e) { SearchMovieRepeater.DataSource = SearchMovies((string)Session["SearchTitle"]); SearchMovieRepeater.DataBind(); }