Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <string> buyCart = (List <string>)Session["BuyCart"];

            if (buyCart != null && buyCart.Count > 0)
            {
                string comaSeperatedMovies = CartUtils.ListToComaSeperatedMovieString(buyCart);

                moviesref.Movies proxy = new moviesref.Movies();

                MovieRepeater.DataSource = proxy.GetAllCartMovies(comaSeperatedMovies);
                MovieRepeater.DataBind();

                sumNumberLabel.Text = "0";
                sumNumberLabel.Text = proxy.GetAllCartMoviesSum(comaSeperatedMovies);


                noMovieLabel.Visible = false;
            }
            else
            {
                movieTablePanel.Visible = false;
                noMovieLabel.Visible    = true;
            }
        }
Esempio n. 2
0
        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();
            }
        }