示例#1
0
 public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
 {
     Cart cart = (Cart) controllerContext.HttpContext.Session["Cart"];
     if (cart != null)
     {
         cart = new Cart();
         controllerContext.HttpContext.Session["Cart"] = cart;
     }
     return cart;
 }
示例#2
0
 public void ProcessOrder(Cart cart, CheckoutViewModel vm)
 {
 }
示例#3
0
 private Cart GetCart()
 {
     Cart cart = (Cart)Session["Cart"];
     if (cart == null)
     {
         cart = new Cart();
         Session["Cart"] = cart;
     }
     return cart;
 }
示例#4
0
 public JsonResult Clear(Cart cart)
 {
     cart.Clear();
     return Json("");
 }