public ActionResult AddToCart(int id) { GetShoppingCart(); BL.Models.ProgDec progDec = ProgDecManager.LoadById(id); ShoppingCartManager.Add(cart, progDec); Session["cart"] = cart; return(RedirectToAction("Index", "ProgDec")); }
public ActionResult AddToCart(int id) { GetShoppingCart(); Movie movie = MovieManager.LoadById(id); ShoppingCartManager.Add(cart, movie); Session["cart"] = cart; return(RedirectToAction("Index", "Movie")); }
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)); }
public void Setup() { Product car = new Product("Samochód", 70000); manager = new ShoppingCartManager(); manager.Add("father", new ShoppingCart(new List <Product> { car })); }
public ActionResult AddToCart(int id) { RetrieveCart(); using (manager = new ShoppingCartManager()) { manager.Cart = cart; manager.Add(id); PersistCart(manager.Cart); } return(RedirectToAction("Index", "Movies")); }
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"); }
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 })); } }