public ActionResult Index() { cartBusiness = new CartBusiness(Session.GetUserKey()); var currentCarts = cartBusiness.GetCurrentCarts(); return View(new CartViewModel { GrandTotal = CartBusiness.CalculateGrandTotal(currentCarts.AsQueryable()), CartDetailList = cartBusiness.GenerateCartDetailList(currentCarts) }); }
public ActionResult Shipping(Shipping Shipping) { var cartBusiness = new CartBusiness { UserKey = Session.GetUserKey() }; if (cartBusiness.GetCurrentCartCount() <= 0) { var ex = new HttpException(400, ""); ex.Data["ErrType"] = Globals.ERRTYPES.CART_CARTEMPTY; throw ex; } if (ModelState.IsValid) { var orderBusiness = new OrderBusiness(); orderBusiness.CreateOrder(cartBusiness.UserKey, cartBusiness.GetCurrentCarts(), Shipping); return RedirectToAction("Checkout"); } else { return View(Shipping); } }