Example #1
0
        public AddToCartBusiness(DatabaseFactory df = null, UnitOfWork uow = null)
        {
            DatabaseFactory dfactory = df == null ? new DatabaseFactory() : df;

            _unitOfWork     = uow == null ? new UnitOfWork(dfactory) : uow;
            _cartRepository = new AddToCartRepository(dfactory);
        }
 public AddToCartBusiness(DatabaseFactory df = null, UnitOfWork uow = null)
 {
     DatabaseFactory dfactory = df == null ? new DatabaseFactory() : df;
     _unitOfWork = uow == null ? new UnitOfWork(dfactory) : uow;
     _cartRepository = new AddToCartRepository(dfactory);
     this._formsAuthenticationFactory = new FormsAuthenticationFactory();
 }
        public ActionResult AddBundleToCart()
        {
            AddToCartRenderingModel addToCartModel = AddToCartRepository.GetAddToCartModel();

            addToCartModel.CatalogName = StorefrontContext.CurrentStorefront.Catalog;

            return(View("~/Views/ProductBundle/AddBundleToCart.cshtml", _productBundleRepository.GetProductBundleRenderingModel(_visitorContext)));
        }
Example #4
0
        public ActionResult AddToDemoCart()
        {
            AddToCartRenderingModel addToCartModel = AddToCartRepository.GetAddToCartModel();

            // CatalogName appears to always be empty when the model is returned from the repository
            // overriding with the current storefront catalog from context
            addToCartModel.CatalogName = this.StorefrontContext.CurrentStorefront.Catalog;

            return(base.View("~/Views/Commerce/Cart/AddToCart.cshtml", addToCartModel));
        }
Example #5
0
        public ActionResult UserExist()
        {
            FindUserRepository find = new FindUserRepository();
            long id = find.FindUserId(Request.Cookies["userName"].Value);
            AddToCartRepository  add  = new AddToCartRepository();
            List <ProductsModel> list = add.ProductsInCart(id).ToList();

            foreach (var product in list)
            {
                product.price = product.price * Convert.ToDecimal(0.9);
            }
            return(View("Cart", list));
        }