예제 #1
0
        public ActionResult RemoveFromShoppingCart(Guid id)
        {
            Guid userId = GetUserId();

            var shoppingModel = ShoppingCartProcessor.GetShoppingModel(id);

            ShoppingCartProcessor.RemoveFromShoppingCart(userId, shoppingModel);

            return(RedirectToAction("ShoppingCart", "Acount"));
        }
예제 #2
0
        public ActionResult EditShoppingCart(Guid id)
        {
            Guid userId    = GetUserId();
            var  model     = ShoppingCartProcessor.GetShoppingModel(id);
            var  userModel = UserProcessor.GetUserToModel(userId);

            var checkUserOwnesItem = userModel.ShoppingCart.Where(x => x.Id == id).SingleOrDefault();

            if (model == null || checkUserOwnesItem == null)
            {
                return(RedirectToAction("ShoppingCart", "Acount"));
            }

            return(View(model));
        }