コード例 #1
0
 public ActionResult AddToCart(int id)
 {
     GetShoppingCart();
     BL.Models.ProgDec progDec = ProgDecManager.LoadById(id);
     ShoppingCartManager.Add(cart, progDec);
     Session["cart"] = cart;
     return(RedirectToAction("Index", "ProgDec"));
 }
コード例 #2
0
        public ActionResult AddToCart(int id)
        {
            GetShoppingCart();
            Movie movie = MovieManager.LoadById(id);

            ShoppingCartManager.Add(cart, movie);
            Session["cart"] = cart;
            return(RedirectToAction("Index", "Movie"));
        }
コード例 #3
0
 public ActionResult AddToCart(int ID, string returnURL, int quantity)
 {
     GetShoppingCart();
     BL.Models.MenuItemModel menuItemModel = MenuItemManager.GetMenuItem(ID);
     cart.VendorID = (MenuManager.GetMenu(menuItemModel.MenuItem)).VendorID;
     ShoppingCartManager.Add(cart, menuItemModel, quantity);
     Session["Cart"] = cart;
     return(Redirect(returnURL));
 }
コード例 #4
0
ファイル: Zad1.cs プロジェクト: ronek22/DesignPatterns
        public void Setup()
        {
            Product car = new Product("Samochód", 70000);

            manager = new ShoppingCartManager();
            manager.Add("father", new ShoppingCart(new List <Product> {
                car
            }));
        }
コード例 #5
0
 public ActionResult AddToCart(int id)
 {
     RetrieveCart();
     using (manager = new ShoppingCartManager())
     {
         manager.Cart = cart;
         manager.Add(id);
         PersistCart(manager.Cart);
     }
     return(RedirectToAction("Index", "Movies"));
 }
コード例 #6
0
        private void AddToCart_Clicked(object sender, EventArgs e)
        {
            //    OrderItem orderItem = new OrderItem()
            //    {
            //        Id = Guid.NewGuid(),
            //        OrderId = App.userCart.Id,
            //        MenuItemId = item.Id
            //};

            ShoppingCartManager.Add(App.userCart, viewModel.MenuItem);
            //App.userCart.Add(viewModel.MenuItem);
            DisplayAlert("Alert", "Added to Cart. There are " + App.userCart.Items.Count + " item(s) in your cart", "Ok");
        }
コード例 #7
0
 public ActionResult Add(int id)
 {
     if (Authenticate.IsAuthenticated())
     {
         GetShoppingCart();
         Movie movie = MovieManager.LoadByID(id);
         ShoppingCartManager.Add(cart, movie);
         Session["cart"] = cart;
         return(RedirectToAction("Index", "Movie"));
     }
     else
     {
         return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url }));
     }
 }