GetCartId() public method

public GetCartId ( System.Web.HttpContextBase context ) : string
context System.Web.HttpContextBase
return string
コード例 #1
0
ファイル: ShoppingCart.cs プロジェクト: keenkit/MvcMusicStore
        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);
        }
コード例 #3
0
ファイル: ShoppingCart.cs プロジェクト: karthikvarsh/chinnu
        public static ShoppingCart GetCart(MusicStoreEntities db, HttpContextBase context)
        {
            var cart = new ShoppingCart(db);

            cart.ShoppingCartId = cart.GetCartId(context);
            return(cart);
        }
コード例 #4
0
        /*这是一个静态方法,用来获取当前用户的购物车对象,它使用 GetCartId 方法来读取保存当前 Session 中的购物车标识,
         * GetCartId 方法需要 HttpContextBase 以便获取当前的 Session,找到购物车标识*/
        public static ShoppingCart GetCart(HttpContextBase context)//网站上下文,找到key,获取购物车标识,找到购物车
        {
            var cart = new ShoppingCart();

            cart.ShoppingCartId = cart.GetCartId(context);
            return(cart);
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public static ShoppingCart GetCart(HttpContextBase context)
 {
     var cart = new ShoppingCart();
     cart.ShoppingCartId = cart.GetCartId(context);
     return cart;
 }
コード例 #8
0
ファイル: ShoppingCart.cs プロジェクト: TimSOS/kendoStore
 public static ShoppingCart GetCart(MusicStoreEntities db, HttpContext context)
 {
     var cart = new ShoppingCart(db);
     cart.ShoppingCartId = cart.GetCartId(context);
     return cart;
 }
コード例 #9
0
 public static ShoppingCart GetCart(HttpContextBase httpContext, IMusicStoreContext storeContext)
 {
     var cart = new ShoppingCart(storeContext);
     cart.shoppingCartId = cart.GetCartId(httpContext);
     return cart;
 }