protected void Page_Load(object sender, EventArgs e) { if (Session["FirstName"] != null) // if user is connected { List <string> buyCart = (List <string>)Session["BuyCart"]; string queryString = ""; if (buyCart != null && buyCart.Count > 0) // hide movies already in the cart { string comaSeparatedMovies = CartUtils.ListToComaSeperatedMovieString(buyCart); queryString = String.Format(SQLQueries.AllMoviesExcludingCart, comaSeparatedMovies); } else { queryString = SQLQueries.AllMoviesQuery; } moviesref.Movies proxy = new moviesref.Movies(); Tamarflix_real.moviesref.DataSet ds = proxy.GetAllMovies(queryString); MovieRepeater.DataSource = ds; MovieRepeater.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["FirstName"] != null && (bool)Session["IsAdmin"]) // if user is connected { string queryString = SQLQueries.AllMoviesQuery; moviesref.Movies proxy = new moviesref.Movies(); Tamarflix_real.moviesref.DataSet ds = proxy.GetAllMovies(queryString); MovieRepeater.DataSource = ds; MovieRepeater.DataBind(); } }