Exemple #1
0
        private void AddInCart(object sender, EventArgs e)
        {
            Button         b  = (Button)sender;
            MovieListModel ml = b.CommandParameter as MovieListModel;

            if (CartService.AddOrRemoveMovieId(ml))
            {
                b.Text            = "Remove";
                b.BackgroundColor = Color.Red;
            }
            else
            {
                b.Text            = "Add";
                b.BackgroundColor = Color.Green;
            }
            btnMyCart.Text = "My cart (" + CartService.GetSize() + ")";
        }