Ejemplo n.º 1
0
 /// <summary>
 /// Constructor.
 /// You can use a dependency injection container to initialize the services.
 /// </summary>
 public ProductFilterController()
 {
     //DocSection:ServiceInit
     shoppingService = new ShoppingService();
     pricingService  = new PricingService();
     //EndDocSection:ServiceInit
 }
 //DocSection:Controller
 /// <summary>
 /// Constructor for the ProductFilterController class.
 /// </summary>
 public ProductFilterController()
 {
     // Initializes instances of services required to facilitate product filtering
     // For real-world projects, we recommend using a dependency injection container to initialize service instances
     shoppingService   = Service.Resolve <IShoppingService>();
     calculatorFactory = Service.Resolve <ICatalogPriceCalculatorFactory>();
 }
 public ShoppingController(IHttpRequest httpRequest)
     : base(httpRequest)
 {
     this.shoppingService = new ShoppingService();
     this.userService     = new UserService();
     this.gameService     = new GameService();
 }
 //DocSection:Constructor
 /// <summary>
 /// Initializes an instance of the IShoppingService used to facilitate shopping cart interactions.
 /// </summary>
 public CheckoutController()
 {
     // Initializes an instance of a service required to manage the shopping cart
     // For real-world projects, we recommend using a dependency injection
     // container to initialize service instances
     shoppingService = Service.Resolve <IShoppingService>();
 }
Ejemplo n.º 5
0
 //DocSection:Constructor
 /// <summary>
 /// Constructor for the OrderController class.
 /// </summary>
 public OrderController()
 {
     // Initializes an instance of IShoppingService used to facilitate shopping cart interactions
     // For real-world projects, we recommend using a dependency injection
     // container to initialize service instances
     shoppingService = Service.Resolve <IShoppingService>();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor for the LearningProductTypeController class.
 /// </summary>
 public LearningProductTypeController()
 {
     // Initializes instances of services required to manage product price calculation and the shopping cart
     // For real-world projects, we recommend using a dependency injection container to initialize service instances
     shoppingService   = Service.Resolve <IShoppingService>();
     calculatorFactory = Service.Resolve <ICatalogPriceCalculatorFactory>();
 }
Ejemplo n.º 7
0
 public CheckoutController(IShoppingService shoppingService, IContactRepository contactRepository, IProductRepository productRepository, ICheckoutService checkoutService)
 {
     mShoppingService   = shoppingService;
     mContactRepository = contactRepository;
     mCheckoutService   = checkoutService;
     mProductRepository = productRepository;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor.
 /// You can use a dependency injection container to initialize the services and repositories.
 /// </summary>
 public CheckoutController()
 {
     shoppingService          = new ShoppingService();
     pricingService           = new PricingService();
     paymentRepository        = new KenticoPaymentMethodRepository();
     addressRepository        = new KenticoCustomerAddressRepository();
     shippingOptionRepository = new KenticoShippingOptionRepository();
 }
Ejemplo n.º 9
0
 public AccountController(
     IAccountService accountService,
     IShoppingService shoppingService)
 {
     _accountService  = accountService;
     _shoppingService = shoppingService;
     _account         = new Account();
 }
 public ECUtilitiesController(ISiteService siteService,
                              IShoppingService shoppingService,
                              ISKUInfoProvider sKUInfoProvider)
 {
     this.siteService     = siteService;
     this.shoppingService = shoppingService;
     this.sKUInfoProvider = sKUInfoProvider;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="shoppingService">Shopping service</param>
 /// <param name="addressRepository">Address repository</param>
 /// <param name="paymentMethodRepository">Payment method repository</param>
 /// <param name="shippingOptionRepository">Shipping option repository</param>
 /// <param name="countryRepository">Country repository</param>
 public CheckoutService(IShoppingService shoppingService, ICustomerAddressRepository addressRepository, IPaymentMethodRepository paymentMethodRepository, IShippingOptionRepository shippingOptionRepository, ICountryRepository countryRepository)
 {
     mShoppingService          = shoppingService;
     mPaymentMethodRepository  = paymentMethodRepository;
     mShippingOptionRepository = shippingOptionRepository;
     mCountryRepository        = countryRepository;
     mAddressRepository        = addressRepository;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Constructor.
 /// You can use a dependency injection container to initialize the services and repositories.
 /// </summary>
 public ProductController()
 {
     //DocSection:InitializeServices
     shoppingService   = new ShoppingService();
     pricingService    = new PricingService();
     variantRepository = new KenticoVariantRepository();
     //EndDocSection:InitializeServices
 }
Ejemplo n.º 13
0
        public void TestSetup()
        {
            _shoppingService = new ShoppingService();
            CreateTestData();

            _customer = _shoppingService.GetCustomerByName("Tony Stark");
            _customer.ShoppingCart.CustomerName = _customer.Name;
        }
Ejemplo n.º 14
0
 public ProductController(ICalculationService calculationService, IProductRepository productRepository,
                          IVariantRepository variantRepository, TypedProductViewModelFactory typedProductViewModelFactory, IShoppingService shoppingService)
 {
     mCalculationService           = calculationService;
     mProductRepository            = productRepository;
     mVariantRepository            = variantRepository;
     mTypedProductViewModelFactory = typedProductViewModelFactory;
     mShoppingService = shoppingService;
 }
Ejemplo n.º 15
0
        static SessionManager()
        {
            IIoCManager iocManager =
                (IIoCManager)HttpContext.Current.Application["managerIoC"];

            userService     = iocManager.Resolve <IUserService>();
            shoppingService = iocManager.Resolve <IShoppingService>();
            productService  = iocManager.Resolve <IProductService>();
        }
Ejemplo n.º 16
0
        public static IShoppingService ShoppingService(SQLiteConnection sqliteConnection)
        {
            if (_shoppingService == null)
            {
                _shoppingService = new ShoppingService(sqliteConnection);
            }

            return _shoppingService;
        }
Ejemplo n.º 17
0
        public static IShoppingService ShoppingService(SQLiteConnection sqliteConnection)
        {
            if (_shoppingService == null)
            {
                _shoppingService = new ShoppingService(sqliteConnection);
            }

            return(_shoppingService);
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes instances of services required to manage product price calculation and the shopping cart.
 /// </summary>
 public ProductListingController(IShoppingService shoppingService,
                                 ICatalogPriceCalculatorFactory priceCalculatorFactory,
                                 IPageRetriever pageRetriever,
                                 IPageUrlRetriever pageUrlRetriever)
 {
     this.shoppingService        = shoppingService;
     this.priceCalculatorFactory = priceCalculatorFactory;
     this.pageRetriever          = pageRetriever;
     this.pageUrlRetriever       = pageUrlRetriever;
 }
Ejemplo n.º 19
0
 public CodeSnippets(IShoppingService shoppingService,
                     ICatalogPriceCalculatorFactory catalogPriceCalculatorFactory,
                     ISiteService siteService,
                     IPageDataContextRetriever pageRetriever)
 {
     this.shoppingService = shoppingService;
     this.catalogPriceCalculatorFactory = catalogPriceCalculatorFactory;
     this.siteService   = siteService;
     this.pageRetriever = pageRetriever;
 }
        public ShoppingServiceTests()
        {
            var mockLogger = new Mock <ILogger <ShoppingService> >();

            _mockShoppingRepository     = new Mock <IShoppingRepository>();
            _mockProductSorter          = new Mock <IProductSorter>();
            _mockTrolleyTotalCalculator = new Mock <ITrolleyTotalCalculator>();

            _shoppingService = new ShoppingService(mockLogger.Object, _mockShoppingRepository.Object, _mockProductSorter.Object, _mockTrolleyTotalCalculator.Object);
        }
 //DocSection:Controller
 /// <summary>
 /// Initializes instances of services required to facilitate product filtering.
 /// </summary>
 public ProductFilterController(IShoppingService shoppingService,
                                ICatalogPriceCalculatorFactory catalogPriceCalculator,
                                IPageUrlRetriever pageUrlRetriever,
                                IPageRetriever pageRetriever)
 {
     this.shoppingService        = shoppingService;
     this.catalogPriceCalculator = catalogPriceCalculator;
     this.pageUrlRetriever       = pageUrlRetriever;
     this.pageRetriever          = pageRetriever;
 }
        public static void MyClassInitialize(TestContext testContext)
        {
            kernel = TestManager.ConfigureNInjectKernel();

            shoppingService = kernel.Get <IShoppingService>();
            userProfileDao  = kernel.Get <IUserProfileDao>();
            creditCardDao   = kernel.Get <ICreditCardDao>();
            categoryDao     = kernel.Get <ICategoryDao>();
            productDao      = kernel.Get <IProductDao>();
        }
Ejemplo n.º 23
0
 //DocSection:Constructor
 /// <summary>
 /// Initializes instances of service used to facilitate shopping cart, currency and order interactions.
 /// </summary>
 public OrderController(IShoppingService shoppingService,
                        ICurrencyInfoProvider currencyInfoProvider,
                        IOrderInfoProvider orderInfoProvider,
                        ISiteService siteService)
 {
     this.shoppingService      = shoppingService;
     this.currencyInfoProvider = currencyInfoProvider;
     this.orderInfoProvider    = orderInfoProvider;
     this.siteService          = siteService;
 }
Ejemplo n.º 24
0
 public OrdersController(OrderRepository orderRepository, IShoppingService shoppingService, ICurrencyInfoProvider currencyInfoProvider, IOrderStatusInfoProvider orderStatusInfoProvider,
                         ICountryInfoProvider countryInfoProvider, IStateInfoProvider stateInfoProvider)
 {
     this.orderRepository         = orderRepository;
     this.shoppingService         = shoppingService;
     this.currencyInfoProvider    = currencyInfoProvider;
     this.orderStatusInfoProvider = orderStatusInfoProvider;
     this.countryInfoProvider     = countryInfoProvider;
     this.stateInfoProvider       = stateInfoProvider;
 }
Ejemplo n.º 25
0
        public void TestSetup()
        {
            _shoppingService = new ShoppingService();
            CreateTestData();

            Customer customer = _shoppingService.GetCustomerByName("John Smith");

            _shoppingCart = customer.ShoppingCart;
            _shoppingCart.CustomerName = customer.Name;
        }
Ejemplo n.º 26
0
 public ProductController(IPageDataContextRetriever dataRetriever, ICalculationService calculationService,
                          VariantRepository variantRepository, TypedProductViewModelFactory typedProductViewModelFactory,
                          IShoppingService shoppingService, ISKUInfoProvider skuInfoProvider)
 {
     this.dataRetriever                = dataRetriever;
     this.calculationService           = calculationService;
     this.variantRepository            = variantRepository;
     this.typedProductViewModelFactory = typedProductViewModelFactory;
     this.shoppingService              = shoppingService;
     this.skuInfoProvider              = skuInfoProvider;
 }
Ejemplo n.º 27
0
 public CheckoutController(IShoppingService shoppingService, IContactRepository contactRepository, IProductRepository productRepository,
                           ICheckoutService checkoutService, IPageUrlRetriever pageUrlRetriever, ISKUInfoProvider skuInfoProvider, ICountryInfoProvider countryInfoProvider,
                           IStateInfoProvider stateInfoProvider)
 {
     this.shoppingService     = shoppingService;
     this.contactRepository   = contactRepository;
     this.checkoutService     = checkoutService;
     this.productRepository   = productRepository;
     this.pageUrlRetriever    = pageUrlRetriever;
     this.skuInfoProvider     = skuInfoProvider;
     this.countryInfoProvider = countryInfoProvider;
     this.stateInfoProvider   = stateInfoProvider;
 }
Ejemplo n.º 28
0
        public ShoppingsTests()
        {
            _settings = new DatabaseSettings
            {
                ConnectionString       = "mongodb://*****:*****@localhost:27017/admin",
                DatabaseName           = "ShoppingListDb",
                ProductsCollectionName = "Products"
            };

            _repository = new ShoppingRepository(_settings);
            _service    = new ShoppingService(_repository);
            _controller = new ShoppingsController(_service);
        }
Ejemplo n.º 29
0
 //DocSection:Constructor
 /// <summary>
 /// Constructor for the ProductController class.
 /// </summary>
 public ProductController(IShoppingService shoppingService,
                          ICatalogPriceCalculatorFactory priceCalculatorFactory,
                          IPageDataContextRetriever pageRetriever,
                          ISiteService siteService,
                          ISKUInfoProvider skuInfoProvider)
 {
     // Initializes instances of services required to manage product price calculation and the shopping cart
     this.shoppingService        = shoppingService;
     this.priceCalculatorFactory = priceCalculatorFactory;
     this.pageRetriever          = pageRetriever;
     this.siteService            = siteService;
     this.skuInfoProvider        = skuInfoProvider;
 }
Ejemplo n.º 30
0
 public ShoppingCartController(
     IShoppingCartManager shoppingCartManager,
     ISongService songService,
     UserManager <User> userManager,
     IShoppingService shoppingService,
     IAlbumService albumsService)
 {
     this.shoppingCartManager = shoppingCartManager;
     this.songService         = songService;
     this.userManager         = userManager;
     this.shoppingService     = shoppingService;
     this.albumsService       = albumsService;
 }
Ejemplo n.º 31
0
 public OrderController(
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     IShoppingService shoppingService,
     ILoggerFactory loggerFactory)
 {
     _userManager     = userManager;
     _emailSender     = emailSender;
     _smsSender       = smsSender;
     _shoppingService = shoppingService;
     _logger          = loggerFactory.CreateLogger <OrderController>();
 }
Ejemplo n.º 32
0
 public PastPurchasesViewModel(IShoppingService shoppingService)
 {
     this._shoppingService = shoppingService;
 }
Ejemplo n.º 33
0
 public ShoppingListViewModel(IShoppingService shoppingService)
 {
     this._shoppingService = shoppingService;
 }
 public BuyController(IProductsService productsService, IShoppingService shoppingService)
     : base(productsService)
 {
     this.shoppingService = shoppingService;
 }