public RedirectToRouteResult RemoveFromCart(Entities.ComplexTypes.Cart cart, int productId) { Product product = _productService.Get(productId); cart.RemoveFromCart(product); return(RedirectToAction("Index", cart)); }
public ActionResult Checkout(Entities.ComplexTypes.Cart cart) { CartViewModel cartViewModel = new CartViewModel { ShippingDetail = new ShippingDetail(), Cart = cart }; return(View(cartViewModel)); }
public ActionResult Checkout(CartViewModel cartViewModel, Entities.ComplexTypes.Cart cart) { var cartList = cart; string cartListToJSON = Newtonsoft.Json.JsonConvert.SerializeObject(cartList); string userName = User.Identity.Name; int userId = GetUserIdByUserName(userName); int shippingDetailId = GetShippingDetailId(cartViewModel); int cartId = GetCartId(cartListToJSON); int OrderDetailId = GetOrderDetailId(userId, shippingDetailId, cartId); cart.Clear(); CompletedViewModel completedViewModel = new CompletedViewModel { UserName = User.Identity.Name, OrderdetailId = OrderDetailId }; return(RedirectToAction("Completed", "Cart", completedViewModel)); }
public ViewResult Index(Entities.ComplexTypes.Cart cart) { return(View(cart)); }
public PartialViewResult CartSummary(Entities.ComplexTypes.Cart cart) { return(PartialView(cart)); }