Esempio 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>();
 }
 //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>();
 }
Esempio 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>();
 }
Esempio n. 7
0
 public CheckoutController(IShoppingService shoppingService, IContactRepository contactRepository, IProductRepository productRepository, ICheckoutService checkoutService)
 {
     mShoppingService   = shoppingService;
     mContactRepository = contactRepository;
     mCheckoutService   = checkoutService;
     mProductRepository = productRepository;
 }
 /// <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();
 }
 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;
 }
Esempio 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;
 }
Esempio 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
 }
Esempio n. 13
0
        public void TestSetup()
        {
            _shoppingService = new ShoppingService();
            CreateTestData();

            _customer = _shoppingService.GetCustomerByName("Tony Stark");
            _customer.ShoppingCart.CustomerName = _customer.Name;
        }
Esempio 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;
 }
Esempio n. 15
0
        static SessionManager()
        {
            IIoCManager iocManager =
                (IIoCManager)HttpContext.Current.Application["managerIoC"];

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

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

            return(_shoppingService);
        }
Esempio 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;
 }
Esempio 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>();
        }
Esempio 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;
 }
Esempio 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;
 }
Esempio n. 25
0
        public void TestSetup()
        {
            _shoppingService = new ShoppingService();
            CreateTestData();

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

            _shoppingCart = customer.ShoppingCart;
            _shoppingCart.CustomerName = customer.Name;
        }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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);
        }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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>();
 }
Esempio n. 32
0
 public PastPurchasesViewModel(IShoppingService shoppingService)
 {
     this._shoppingService = shoppingService;
 }
Esempio n. 33
0
 public ShoppingListViewModel(IShoppingService shoppingService)
 {
     this._shoppingService = shoppingService;
 }
 public BuyController(IProductsService productsService, IShoppingService shoppingService)
     : base(productsService)
 {
     this.shoppingService = shoppingService;
 }