예제 #1
0
        public ActionResult Add(ItemView model, int quantite)
        {
            PanierView panierView = new PanierView();

            panierView.ItemId = model.Id;
            int userID = OnlineUsers.CurrentUser.Id;

            if (!DB.DejaDansPanier(userID, model.Id))
            {
                panierView.UserId        = userID;//CurrentUser.
                panierView.QuantiteAchat = quantite;
                DB.CreatePanier(panierView);
                return(RedirectToAction("Index", "Items"));
            }
            return(RedirectToAction("Details", "Items", new { id = model.Id }));
        }