Esempio n. 1
0
        public ActionResult LogOff()
        {
            AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
            // Reset session:
            _shoppingCartBusinessModel = new ShoppingCartBusinessModel();
            _shoppingCartBusinessModel.ResetSession(this.HttpContext);

            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 2
0
        /// <summary>
        /// The MigrateShoppingCart
        /// </summary>
        /// <param name="UserName">The UserName<see cref="string"/></param>
        private void MigrateShoppingCart(string UserName)
        {
            // Associate shopping cart items with logged-in user
            _shoppingCartBusinessModel = new ShoppingCartBusinessModel();

            _shoppingCartBusinessModel.MigrateCart(UserName, this.HttpContext);

            Session[ShoppingCartBusinessModel.CartSessionKey] = UserName;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShoppingCartController"/> class.
 /// </summary>
 /// <param name="productBusinessService">The productBusinessService<see cref="IProductBusinessService"/></param>
 public ShoppingCartController(IProductBusinessService productBusinessService,
                               IShoppingCartBusinessService shoppingCartBusinessService)
 {
     _shoppingCartBusinessModel = new ShoppingCartBusinessModel(productBusinessService,
                                                                shoppingCartBusinessService);
 }