public ActionResult RemoveFromShoppingCart(Guid id) { Guid userId = GetUserId(); var shoppingModel = ShoppingCartProcessor.GetShoppingModel(id); ShoppingCartProcessor.RemoveFromShoppingCart(userId, shoppingModel); return(RedirectToAction("ShoppingCart", "Acount")); }
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)); }