public ActionResult Add(int prodId) { SessionHelper sessonHlp = new SessionHelper(); int qty = sessonHlp.GetProductQtyFromCart(prodId); A00964856_ShoppingCartEntities db = new A00964856_ShoppingCartEntities(); ProductRepo prodRepo = new ProductRepo(db); CartItemRepo cartItemRepo = new CartItemRepo(prodRepo); CartItemModel item = cartItemRepo.GetCartItem(prodId, qty); return View(item); }
public ActionResult ViewCart() { SessionHelper sessionHlp = new SessionHelper(); Dictionary<int, int> sessionCart = sessionHlp.GetCart(); A00964856_ShoppingCartEntities db = new A00964856_ShoppingCartEntities(); ProductRepo prodRepo = new ProductRepo(db); CartItemRepo cartItemRepo = new CartItemRepo(prodRepo); List<CartItemModel> cartItems = cartItemRepo.GetAllCartItems(sessionCart); CheckoutCartModel checkoutCart = new CheckoutCartModel(); checkoutCart.CartItems = cartItems; return View(checkoutCart); }