public static ShoppingCart GetCart(HttpContextBase context) { var cart = new ShoppingCart(); cart.ShoppingCartId = cart.GetCartId(context); return(cart); }
public static ShoppingCart GetCart(HttpContext context, MusicStoreEntities _storeDB) { var cart = new ShoppingCart(_storeDB); cart.ShoppingCartId = cart.GetCartId(context); return(cart); }
public static ShoppingCart GetCart(MusicStoreEntities db, HttpContextBase context) { var cart = new ShoppingCart(db); cart.ShoppingCartId = cart.GetCartId(context); return(cart); }
/*这是一个静态方法,用来获取当前用户的购物车对象,它使用 GetCartId 方法来读取保存当前 Session 中的购物车标识, * GetCartId 方法需要 HttpContextBase 以便获取当前的 Session,找到购物车标识*/ public static ShoppingCart GetCart(HttpContextBase context)//网站上下文,找到key,获取购物车标识,找到购物车 { var cart = new ShoppingCart(); cart.ShoppingCartId = cart.GetCartId(context); return(cart); }
public static ShoppingCart GetCart(HttpContextBase context) { var ioc = new IoC(); var cartAppService = ioc.Kernel.Get<ICartAppService>(); var orderDetailAppService = ioc.Kernel.Get<IOrderDetailAppService>(); var orderAppService = ioc.Kernel.Get<IOrderAppService>(); var cart = new ShoppingCart(cartAppService, orderDetailAppService, orderAppService); cart.ShoppingCartId = cart.GetCartId(context); return cart; }
public static ShoppingCart GetCart(HttpContextBase context) { var ioc = new IoC(); var cartAppService = ioc.Kernel.Get <ICartAppService>(); var orderDetailAppService = ioc.Kernel.Get <IOrderDetailAppService>(); var orderAppService = ioc.Kernel.Get <IOrderAppService>(); var cart = new ShoppingCart(cartAppService, orderDetailAppService, orderAppService); cart.ShoppingCartId = cart.GetCartId(context); return(cart); }
public static ShoppingCart GetCart(HttpContextBase context) { var cart = new ShoppingCart(); cart.ShoppingCartId = cart.GetCartId(context); return cart; }
public static ShoppingCart GetCart(MusicStoreEntities db, HttpContext context) { var cart = new ShoppingCart(db); cart.ShoppingCartId = cart.GetCartId(context); return cart; }
public static ShoppingCart GetCart(HttpContextBase httpContext, IMusicStoreContext storeContext) { var cart = new ShoppingCart(storeContext); cart.shoppingCartId = cart.GetCartId(httpContext); return cart; }