Exemplo n.º 1
0
        public ActionResult AddToCart(int movieID)
        {
            ShoppingCart cart = Session["ShoppingCart"] as ShoppingCart;
            if (cart == null)
            {
                cart = new ShoppingCart();
            }
            //OrderLine not added to DB
            Movie movie = facade.GetMovieRepository().Find(movieID);
            OrderLine line = new OrderLine() { Movie = movie, Amount = 1 };
            cart.Add(line);

            Session["ShoppingCart"] = cart;
            return Redirect("Index");
        }
Exemplo n.º 2
0
        public void Setup()
        {
            //ResetDB();

            line = new OrderLine();

            Genre g1 = new Genre() { Name = "Action" };
            Genre g2 = new Genre() { Name = "Drama" };

            movie = new Movie()
            {
                Title = "The Shawshank Redemption",
                Year = 1994,
                Price = 9.99,
                Genres = new List<Genre> { g1, g2 },
                ImageURL = "http://ia.media-imdb.com/images/M/MV5BODU4MjU4NjIwNl5BMl5BanBnXkFtZTgwMDU2MjEyMDE@._V1_SX214_AL_.jpg",
                TrailerURL = "https://www.youtube.com/embed/NmzuHjWmXOc"
            };
        }
Exemplo n.º 3
0
 public void Remove(OrderLine line)
 {
     OrderLines.Remove(line);
 }
Exemplo n.º 4
0
 public void Add(OrderLine line)
 {
     OrderLines.Add(line);
 }