public OrderController(IOrderService orderService, 
            IShipmentService shipmentService, IWorkContext workContext,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService, IDateTimeHelper dateTimeHelper,
            IPaymentService paymentService, ILocalizationService localizationService,
            IPdfService pdfService, IShippingService shippingService,
            ICountryService countryService, IProductAttributeParser productAttributeParser,
            IWebHelper webHelper,
            CatalogSettings catalogSettings, OrderSettings orderSettings,
            TaxSettings taxSettings, PdfSettings pdfSettings,
            ShippingSettings shippingSettings, AddressSettings addressSettings)
        {
            this._orderService = orderService;
            this._shipmentService = shipmentService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._paymentService = paymentService;
            this._localizationService = localizationService;
            this._pdfService = pdfService;
            this._shippingService = shippingService;
            this._countryService = countryService;
            this._productAttributeParser = productAttributeParser;
            this._webHelper = webHelper;

            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._taxSettings = taxSettings;
            this._pdfSettings = pdfSettings;
            this._shippingSettings = shippingSettings;
            this._addressSettings = addressSettings;
        }
        protected override void Given()
        {
            CustomerServiceMock = Substitute.For<ICustomerService>();
            ShipmentServiceMock = Substitute.For<IShipmentService>();

            Loader = new ShipmentLoader(CustomerServiceMock, ShipmentServiceMock);
        }
 public OrderControllerService(IOrderRepository orderRepository, ICatalogService catalogService, IOrderRequestService requestService, IShipmentService shipmentService )
 {
     _orderRepository = orderRepository;
     _catalogService = catalogService;
     _requestService = requestService;
     _shipmentService = shipmentService;
 }
 private void ShipmentServiceOnStatusChanged(IShipmentService sender, StatusChangeEventArgs<IShipment> statusChangeEventArgs)
 {
     foreach (var shipment in statusChangeEventArgs.StatusChangedEntities)
     {
         Notification.Trigger("OrderShipped", shipment, new[] { "*****@*****.**" });
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 /// <param name="order">
 /// The order.
 /// </param>
 /// <param name="keysToShip">
 /// The keys to ship.
 /// </param>
 public RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask(IMerchelloContext merchelloContext, IOrder order, IEnumerable<Guid> keysToShip) 
     : base(merchelloContext, order, keysToShip)
 {
     _productVariantService = MerchelloContext.Services.ProductVariantService;
     _shipmentService = MerchelloContext.Services.ShipmentService;
     _orderService = MerchelloContext.Services.OrderService;
 }
 /// <summary>
 /// This is a helper contructor for unit testing
 /// </summary>
 internal ShipmentApiController(IMerchelloContext merchelloContext, UmbracoContext umbracoContext)
     : base((MerchelloContext) merchelloContext, umbracoContext)
 {
     _shipmentService = merchelloContext.Services.ShipmentService;
     _invoiceService = merchelloContext.Services.InvoiceService;
     _orderService = merchelloContext.Services.OrderService;
     _shipMethodService = ((ServiceContext)merchelloContext.Services).ShipMethodService;
 }
 public OrderFlowService(ISettingsService settingsService, IContactService contactService, IShipmentService shipmentService, [Named("DataTransfer")] IRepositoryFactory dtRepoFactory, [Named("Ecom")] IRepositoryFactory ecomRepoFactory, [Named("Erp")] IRepositoryFactory erpRepoFactory)
 {
     _settingsService = settingsService;
     _contactService = contactService;
     _shipmentService = shipmentService;
     _dtRepoFactory = dtRepoFactory;
     _ecomRepoFactory = ecomRepoFactory;
     _erpRepoFactory = erpRepoFactory;
 }
        private IContainer GetContainerWithMocks(IShipmentService shipmentService)
        {
            return new Container(x =>
            {

                x.For<IMembershipService>().Use(ServicesMockHelper.GetMembershipServiceMock());
                x.For<IShipmentService>().Use(shipmentService);
            });
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipmentApiController"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 public ShipmentApiController(IMerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _shipmentService = merchelloContext.Services.ShipmentService;
     _invoiceService = merchelloContext.Services.InvoiceService;
     _orderService = merchelloContext.Services.OrderService;
     _shipMethodService = ((ServiceContext)merchelloContext.Services).ShipMethodService;
     _merchello = new MerchelloHelper(merchelloContext.Services);
 }
 public SelectSellController(IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IStoreContext storeContext,
     IRepository<StoreMapping> storeMapping)
 {
     _workContext = workContext;
     _productService = productService;
     _pictureService = pictureService;
     _localizationService = localizationService;
     _categoryService = categoryService;
     _manufacturerService = manufacturerService;
     _storeService = storeService;
     _shippingService = shippingService;
     _vendorService = vendorService;
     _storeMappingService = storeMappingService;
     _storeContext = storeContext;
     _storeMapping = storeMapping;
 }
 public OrderController(IOrderService orderService, 
     IShipmentService shipmentService, 
     IWorkContext workContext,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IOrderProcessingService orderProcessingService, 
     IDateTimeHelper dateTimeHelper,
     IPaymentService paymentService, 
     ILocalizationService localizationService,
     IPdfService pdfService, 
     IShippingService shippingService,
     ICountryService countryService, 
     IProductAttributeParser productAttributeParser,
     IWebHelper webHelper,
     IDownloadService downloadService,
     IAddressAttributeFormatter addressAttributeFormatter,
     IStoreContext storeContext,
     IOrderTotalCalculationService orderTotalCalculationService,
     IRewardPointsService rewardPointsService,
     IGiftCardService giftCardService,
     CatalogSettings catalogSettings,
     OrderSettings orderSettings,
     TaxSettings taxSettings,
     ShippingSettings shippingSettings, 
     AddressSettings addressSettings,
     RewardPointsSettings rewardPointsSettings,
     PdfSettings pdfSettings)
 {
     this._orderService = orderService;
     this._shipmentService = shipmentService;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._priceFormatter = priceFormatter;
     this._orderProcessingService = orderProcessingService;
     this._dateTimeHelper = dateTimeHelper;
     this._paymentService = paymentService;
     this._localizationService = localizationService;
     this._pdfService = pdfService;
     this._shippingService = shippingService;
     this._countryService = countryService;
     this._productAttributeParser = productAttributeParser;
     this._webHelper = webHelper;
     this._downloadService = downloadService;
     this._addressAttributeFormatter = addressAttributeFormatter;
     this._storeContext = storeContext;
     this._rewardPointsService = rewardPointsService;
     this._giftCardService = giftCardService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._catalogSettings = catalogSettings;
     this._orderSettings = orderSettings;
     this._taxSettings = taxSettings;
     this._shippingSettings = shippingSettings;
     this._addressSettings = addressSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._pdfSettings = pdfSettings;
 }
Exemple #12
0
        public OrderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService, IShipmentService shipmentService)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");
            Mandate.ParameterNotNull(storeSettingService, "storeSettingService");
            Mandate.ParameterNotNull(shipmentService, "shipmentService");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;
            _storeSettingService = storeSettingService;
            _shipmentService = shipmentService;
        }
        public OrderController(
			IOrderService orderService, 
            IShipmentService shipmentService,
            ICurrencyService currencyService, 
			IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService, 
			IDateTimeHelper dateTimeHelper,
            IPaymentService paymentService,
			IPdfConverter pdfConverter, 
			IShippingService shippingService,
            ICountryService countryService,
            ICheckoutAttributeFormatter checkoutAttributeFormatter,
			IStoreService storeService,
			IProductService productService,
			IProductAttributeFormatter productAttributeFormatter,
			Lazy<IPictureService> pictureService,
			PluginMediator pluginMediator,
			ICommonServices services,
            IQuantityUnitService quantityUnitService)
        {
            this._orderService = orderService;
            this._shipmentService = shipmentService;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._paymentService = paymentService;
			this._pdfConverter = pdfConverter;
            this._shippingService = shippingService;
            this._countryService = countryService;
			this._productService = productService;
			this._productAttributeFormatter = productAttributeFormatter;
			this._storeService = storeService;
            this._checkoutAttributeFormatter = checkoutAttributeFormatter;
			this._pluginMediator = pluginMediator;
			this._services = services;
            this._quantityUnitService = quantityUnitService;
			T = NullLocalizer.Instance;
        }
Exemple #14
0
        public OrderController(IOrderService orderService, 
            IShipmentService shipmentService, IWorkContext workContext,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService,
            IDateTimeHelper dateTimeHelper, IMeasureService measureService,
            IPaymentService paymentService, ILocalizationService localizationService,
            IPdfService pdfService, ICustomerService customerService,
            IWorkflowMessageService workflowMessageService, IShippingService shippingService,
            ICountryService countryService, LocalizationSettings localizationSettings,
            MeasureSettings measureSettings, CatalogSettings catalogSettings,
            OrderSettings orderSettings, TaxSettings taxSettings, PdfSettings pdfSettings,
            ShippingSettings shippingSettings)
        {
            this._orderService = orderService;
            this._shipmentService = shipmentService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._measureService = measureService;
            this._paymentService = paymentService;
            this._localizationService = localizationService;
            this._pdfService = pdfService;
            this._customerService = customerService;
            this._workflowMessageService = workflowMessageService;
            this._shippingService = shippingService;
            this._countryService = countryService;

            this._localizationSettings = localizationSettings;
            this._measureSettings = measureSettings;
            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._taxSettings = taxSettings;
            this._pdfSettings = pdfSettings;
            this._shippingSettings = shippingSettings;
        }
 public ShipmentController(IShipmentService shipmentService, IOrderService orderService, IOptionService optionService)
 {
     this.shipmentService = shipmentService;
     this.orderService = orderService;
     this.optionService = optionService;
 }
Exemple #16
0
 public AffiliatesController(IShipmentService shipmentService)
 {
     _shipmentService = shipmentService;
 }
 /// <summary>
 /// Handles the <see cref="ShipmentService"/> status changed
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The event args
 /// </param>
 private void ShipmentServiceOnStatusChanged(IShipmentService sender, StatusChangeEventArgs<IShipment> e)
 {
     foreach (var shipment in e.StatusChangedEntities)
     {
         shipment.AuditStatusChanged();
     }
 }
        public OrderController(IOrderService orderService, 
            IOrderReportService orderReportService, 
            IOrderProcessingService orderProcessingService,
            IReturnRequestService returnRequestService,
            IPriceCalculationService priceCalculationService,
            ITaxService taxService,
            IDateTimeHelper dateTimeHelper,
            IPriceFormatter priceFormatter,
            IDiscountService discountService,
            ILocalizationService localizationService,
            IWorkContext workContext,
            ICurrencyService currencyService,
            IEncryptionService encryptionService,
            IPaymentService paymentService,
            IMeasureService measureService,
            IPdfService pdfService,
            IAddressService addressService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            IProductService productService,
            IExportManager exportManager,
            IPermissionService permissionService,
            IWorkflowMessageService workflowMessageService,
            ICategoryService categoryService, 
            IManufacturerService manufacturerService,
            IProductAttributeService productAttributeService, 
            IProductAttributeParser productAttributeParser,
            IProductAttributeFormatter productAttributeFormatter, 
            IShoppingCartService shoppingCartService,
            IGiftCardService giftCardService, 
            IDownloadService downloadService,
            IShipmentService shipmentService, 
            IShippingService shippingService,
            IStoreService storeService,
            IVendorService vendorService,
            IAddressAttributeParser addressAttributeParser,
            IAddressAttributeService addressAttributeService,
            IAddressAttributeFormatter addressAttributeFormatter,
            IAffiliateService affiliateService,
            IPictureService pictureService,
            ICustomerActivityService customerActivityService,
            ICacheManager cacheManager,
            OrderSettings orderSettings,
            CurrencySettings currencySettings, 
            TaxSettings taxSettings,
            MeasureSettings measureSettings,
            AddressSettings addressSettings,
            ShippingSettings shippingSettings)
		{
            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderProcessingService = orderProcessingService;
            this._returnRequestService = returnRequestService;
            this._priceCalculationService = priceCalculationService;
            this._taxService = taxService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._discountService = discountService;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._encryptionService = encryptionService;
            this._paymentService = paymentService;
            this._measureService = measureService;
            this._pdfService = pdfService;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._productService = productService;
            this._exportManager = exportManager;
            this._permissionService = permissionService;
            this._workflowMessageService = workflowMessageService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService = shoppingCartService;
            this._giftCardService = giftCardService;
            this._downloadService = downloadService;
            this._shipmentService = shipmentService;
            this._shippingService = shippingService;
            this._storeService = storeService;
            this._vendorService = vendorService;
            this._addressAttributeParser = addressAttributeParser;
            this._addressAttributeService = addressAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._affiliateService = affiliateService;
            this._pictureService = pictureService;
            this._customerActivityService = customerActivityService;
            this._cacheManager = cacheManager;
            this._orderSettings = orderSettings;
            this._currencySettings = currencySettings;
            this._taxSettings = taxSettings;
            this._measureSettings = measureSettings;
            this._addressSettings = addressSettings;
            this._shippingSettings = shippingSettings;
		}
Exemple #19
0
 public OrderService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService, IShipmentService shipmentService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService, shipmentService)
 {
 }
Exemple #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="eventMessagesFactory">
 /// The event messages factory.
 /// </param>
 /// <param name="storeSettingService">
 /// The store setting service.
 /// </param>
 /// <param name="shipmentService">
 /// The shipment service.
 /// </param>
 public OrderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IStoreSettingService storeSettingService, IShipmentService shipmentService)
     : base(provider, repositoryFactory, logger, eventMessagesFactory)
 {
     Mandate.ParameterNotNull(storeSettingService, "storeSettingService");
     Mandate.ParameterNotNull(shipmentService, "shipmentService");
     _storeSettingService = storeSettingService;
     _shipmentService     = shipmentService;
 }
Exemple #21
0
 public CartController(ICartService cartService, IPaymentService paymentService, IShipmentService shipmentService)
 {
     _cartService     = cartService;
     _paymentService  = paymentService;
     _shipmentService = shipmentService;
 }
 /// <summary>
 /// Reindexes an invoice based on order saved
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void ShipmentServiceOnUpdatedOrder(IShipmentService sender, SaveEventArgs <IOrder> e)
 {
     e.SavedEntities.ForEach(IndexOrder);
 }
 public ShipmentsController(IShipmentService shipmentService, IAuthenticationService authenticationService)
 {
     _shipmentService       = shipmentService;
     _authenticationService = authenticationService;
 }
Exemple #24
0
 public ShipmentsController(IMediator mediator, IShipmentService shipmentService)
 {
     _shipmentService = shipmentService;
 }
 public ShipmentTypesController(
     IShipmentService shipmentService)
 {
     _shipmentService = shipmentService;
 }
 public CreateShipment(IShipmentService shipmentService, string loginUser)
 {
     ShipmentService = shipmentService;
     LoginUser       = loginUser;
     InitializeComponent();
 }
Exemple #27
0
 public OrderShipmentUseCase(IOrderRepository orderRepository, IShipmentService shipmentService)
 {
     this.orderRepository = orderRepository;
     this.shipmentService = shipmentService;
 }
        /// <summary>
        /// Gets a total number of items in all shipments
        /// </summary>
        /// <param name="orderItem">Order item</param>
        /// <returns>Total number of items in all shipmentss</returns>
        public static async Task <int> GetTotalNumberOfItemsInAllShipment(this OrderItem orderItem, IOrderService orderService, IShipmentService shipmentService)
        {
            if (orderItem == null)
            {
                throw new ArgumentNullException("orderItem");
            }

            var totalInShipments = 0;
            var order            = await orderService.GetOrderByOrderItemId(orderItem.Id);

            var shipments = await shipmentService.GetShipmentsByOrder(order.Id);

            for (int i = 0; i < shipments.Count; i++)
            {
                var shipment = shipments[i];
                var si       = shipment.ShipmentItems
                               .FirstOrDefault(x => x.OrderItemId == orderItem.Id);
                if (si != null)
                {
                    totalInShipments += si.Quantity;
                }
            }
            return(totalInShipments);
        }
        public OrderController(IOrderService orderService, 
            IOrderReportService orderReportService, IOrderProcessingService orderProcessingService,
            IDateTimeHelper dateTimeHelper, IPriceFormatter priceFormatter, ILocalizationService localizationService,
            IWorkContext workContext, ICurrencyService currencyService,
            IEncryptionService encryptionService, IPaymentService paymentService,
            IMeasureService measureService,
            IAddressService addressService, ICountryService countryService,
            IStateProvinceService stateProvinceService, IProductService productService,
            IExportManager exportManager, IPermissionService permissionService,
            IWorkflowMessageService workflowMessageService,
            ICategoryService categoryService, IManufacturerService manufacturerService,
            IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser,
            IProductAttributeFormatter productAttributeFormatter, IShoppingCartService shoppingCartService,
            ICheckoutAttributeFormatter checkoutAttributeFormatter, 
            IGiftCardService giftCardService, IDownloadService downloadService,
			IShipmentService shipmentService, IStoreService storeService,
			ITaxService taxService,
			IPriceCalculationService priceCalculationService,
			IEventPublisher eventPublisher,
			ICustomerService customerService,
			PluginMediator pluginMediator,
			IAffiliateService affiliateService,
            CatalogSettings catalogSettings, CurrencySettings currencySettings, TaxSettings taxSettings,
            MeasureSettings measureSettings, PdfSettings pdfSettings, AddressSettings addressSettings,
            IPdfConverter pdfConverter, ICommonServices services, Lazy<IPictureService> pictureService)
        {
            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._encryptionService = encryptionService;
            this._paymentService = paymentService;
            this._measureService = measureService;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._productService = productService;
            this._exportManager = exportManager;
            this._permissionService = permissionService;
            this._workflowMessageService = workflowMessageService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService = shoppingCartService;
            this._giftCardService = giftCardService;
            this._downloadService = downloadService;
            this._shipmentService = shipmentService;
            this._storeService = storeService;
            this._taxService = taxService;
            this._priceCalculationService = priceCalculationService;
            this._eventPublisher = eventPublisher;
            this._customerService = customerService;
            this._pluginMediator = pluginMediator;
            this._affiliateService = affiliateService;

            this._catalogSettings = catalogSettings;
            this._currencySettings = currencySettings;
            this._taxSettings = taxSettings;
            this._measureSettings = measureSettings;
            this._pdfSettings = pdfSettings;
            this._addressSettings = addressSettings;

            this._checkoutAttributeFormatter = checkoutAttributeFormatter;
            _pdfConverter = pdfConverter;
            _services = services;
            _pictureService = pictureService;
        }
Exemple #30
0
 public OrderManager(IOrderRepository orderRepository, IShipmentService shipmentService)
 {
     _orderRepository = orderRepository;
     _shipmentService = shipmentService;
 }
Exemple #31
0
        public new void SetUp()
        {
            _workContext = null;

            var pluginFinder = new PluginFinder(new AppDomainTypeFinder());
            var cacheManager = new NopNullCache();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            //price calculation service
            _discountService        = MockRepository.GenerateMock <IDiscountService>();
            _categoryService        = MockRepository.GenerateMock <ICategoryService>();
            _productAttributeParser = MockRepository.GenerateMock <IProductAttributeParser>();
            _priceCalcService       = new PriceCalculationService(_workContext, _discountService,
                                                                  _categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _localizationService = MockRepository.GenerateMock <ILocalizationService>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock <IRepository <ShippingMethod> >();
            _logger          = new NullLogger();
            _shippingService = new ShippingService(cacheManager,
                                                   _shippingMethodRepository,
                                                   _logger,
                                                   _productAttributeParser,
                                                   _checkoutAttributeParser,
                                                   _localizationService,
                                                   _shippingSettings, pluginFinder,
                                                   _eventPublisher, _shoppingCartSettings);
            _shipmentService = MockRepository.GenerateMock <IShipmentService>();


            _paymentService          = MockRepository.GenerateMock <IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock <ICheckoutAttributeParser>();
            _giftCardService         = MockRepository.GenerateMock <IGiftCardService>();
            _genericAttributeService = MockRepository.GenerateMock <IGenericAttributeService>();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock <IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address()
            {
                Id = _taxSettings.DefaultTaxAddressId
            });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext,
                                                                      _priceCalcService, _taxService, _shippingService, _paymentService,
                                                                      _checkoutAttributeParser, _discountService, _giftCardService,
                                                                      _genericAttributeService,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService               = MockRepository.GenerateMock <IOrderService>();
            _webHelper                  = MockRepository.GenerateMock <IWebHelper>();
            _languageService            = MockRepository.GenerateMock <ILanguageService>();
            _productService             = MockRepository.GenerateMock <IProductService>();
            _priceFormatter             = MockRepository.GenerateMock <IPriceFormatter>();
            _productAttributeFormatter  = MockRepository.GenerateMock <IProductAttributeFormatter>();
            _shoppingCartService        = MockRepository.GenerateMock <IShoppingCartService>();
            _checkoutAttributeFormatter = MockRepository.GenerateMock <ICheckoutAttributeFormatter>();
            _customerService            = MockRepository.GenerateMock <ICustomerService>();
            _encryptionService          = MockRepository.GenerateMock <IEncryptionService>();
            _workflowMessageService     = MockRepository.GenerateMock <IWorkflowMessageService>();
            _customerActivityService    = MockRepository.GenerateMock <ICustomerActivityService>();
            _currencyService            = MockRepository.GenerateMock <ICurrencyService>();

            _paymentSettings = new PaymentSettings()
            {
                ActivePaymentMethodSystemNames = new List <string>()
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings = new OrderSettings();

            _localizationSettings = new LocalizationSettings();

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _currencySettings = new CurrencySettings();

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                                                                 _localizationService, _languageService,
                                                                 _productService, _paymentService, _logger,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter,
                                                                 _productAttributeParser, _productAttributeFormatter,
                                                                 _giftCardService, _shoppingCartService, _checkoutAttributeFormatter,
                                                                 _shippingService, _shipmentService, _taxService,
                                                                 _customerService, _discountService,
                                                                 _encryptionService, _workContext, _workflowMessageService,
                                                                 _customerActivityService, _currencyService,
                                                                 _eventPublisher, _paymentSettings, _rewardPointsSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings,
                                                                 _currencySettings);
        }
 public void Init()
 {
     _shipmentService = MerchelloContext.Current.Services.ShipmentService;
 }
Exemple #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="storeSettingService">
 /// The store setting service.
 /// </param>
 /// <param name="shipmentService">
 /// The shipment service.
 /// </param>
 public OrderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService, IShipmentService shipmentService)
     : this(provider, repositoryFactory, logger, new TransientMessageFactory(), storeSettingService, shipmentService)
 {
 }
 public GetShipmentsHandler(IShipmentService shipmentService)
 {
     _shipmentService = shipmentService;
 }
 public ShipmentApiController(IRepository <Shipment> shipmentRepository, IShipmentService shipmentService, IWorkContext workContext)
 {
     _shipmentRepository = shipmentRepository;
     _shipmentService    = shipmentService;
     _workContext        = workContext;
 }
Exemple #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="storeSettingService">
 /// The store setting service.
 /// </param>
 /// <param name="shipmentService">
 /// The shipment service.
 /// </param>
 public OrderService(RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService, IShipmentService shipmentService)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger, storeSettingService, shipmentService)
 {
 }
 public GroupDealsController(
     IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IRepository<GroupDeal> groupDealRepo,
     IRepository<GroupdealPicture> groupdealPictureRepo,
     IGroupDealService groupdealService,
     IGenericAttributeService genericAttributeService)
     : base(productService,
     productTemplateService,
     categoryService,
     manufacturerService,
     customerService,
     urlRecordService,
     workContext,
     languageService,
     localizationService,
     localizedEntityService,
     specificationAttributeService,
     pictureService,
     taxCategoryService,
     productTagService,
     copyProductService,
     pdfService,
     exportManager,
     importManager,
     customerActivityService,
     permissionService,
     aclService,
     storeService,
     orderService,
     storeMappingService,
     vendorService,
     shippingService,
     shipmentService,
     currencyService,
     currencySettings,
     measureService,
     measureSettings,
     adminAreaSettings,
     dateTimeHelper,
     discountService,
     productAttributeService,
     backInStockSubscriptionService,
     shoppingCartService,
     productAttributeFormatter,
     productAttributeParser,
     downloadService,
     groupDealRepo,
     groupdealPictureRepo,
     groupdealService,
     genericAttributeService)
 { }
Exemple #38
0
 /// <summary>
 /// Reindexes an invoice based on order saved
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void ShipmentServiceOnUpdatedOrder(IShipmentService sender, SaveEventArgs<IOrder> e)
 {
     e.SavedEntities.ForEach(IndexOrder);
 }
Exemple #39
0
 public ShipmentLoader(ICustomerService customerService, IShipmentService shipmentService)
 {
     _customerService = customerService;
     _shipmentService = shipmentService;
 }
        public ShipmentsController(IShipmentService shipmentService) {

            _shipmentService = shipmentService;
        }
        /// <summary>
        /// Gets a total number of not yet shipped items (but added to shipments)
        /// </summary>
        /// <param name="orderItem">Order item</param>
        /// <returns>Total number of not yet shipped items (but added to shipments)</returns>
        public static async Task <int> GetTotalNumberOfNotYetShippedItems(this OrderItem orderItem, IOrderService orderService, IShipmentService shipmentService)
        {
            if (orderItem == null)
            {
                throw new ArgumentNullException("orderItem");
            }

            var order = await orderService.GetOrderByOrderItemId(orderItem.Id);

            var result    = 0;
            var shipments = await shipmentService.GetShipmentsByOrder(order.Id);

            for (int i = 0; i < shipments.Count; i++)
            {
                var shipment = shipments[i];
                if (shipment.ShippedDateUtc.HasValue)
                {
                    //already shipped
                    continue;
                }

                var si = shipment.ShipmentItems
                         .FirstOrDefault(x => x.OrderItemId == orderItem.Id);
                if (si != null)
                {
                    result += si.Quantity;
                }
            }

            return(result);
        }
        public AffiliatesController(IShipmentService shipmentService) {

            _shipmentService = shipmentService;
        }
        /// <summary>
        /// Gets a total number of already items which can be added to new shipments
        /// </summary>
        /// <param name="orderItem">Order item</param>
        /// <returns>Total number of already delivered items which can be added to new shipments</returns>
        public static async Task <int> GetTotalNumberOfItemsCanBeAddedToShipment(this OrderItem orderItem, IOrderService orderService, IShipmentService shipmentService)
        {
            if (orderItem == null)
            {
                throw new ArgumentNullException("orderItem");
            }

            var totalInShipments = await orderItem.GetTotalNumberOfItemsInAllShipment(orderService, shipmentService);

            var qtyOrdered = orderItem.Quantity;
            var qtyCanBeAddedToShipmentTotal = qtyOrdered - totalInShipments;

            if (qtyCanBeAddedToShipmentTotal < 0)
            {
                qtyCanBeAddedToShipmentTotal = 0;
            }

            return(qtyCanBeAddedToShipmentTotal);
        }
        /// <summary>
        /// Gets a total number of already delivered items
        /// </summary>
        /// <param name="orderItem">Order  item</param>
        /// <returns>Total number of already delivered items</returns>
        public static async Task <int> GetTotalNumberOfDeliveredItems(this OrderItem orderItem, Order order, IShipmentService shipmentService)
        {
            if (orderItem == null)
            {
                throw new ArgumentNullException("orderItem");
            }

            var result    = 0;
            var shipments = await shipmentService.GetShipmentsByOrder(order.Id);

            for (int i = 0; i < shipments.Count; i++)
            {
                var shipment = shipments[i];
                if (!shipment.DeliveryDateUtc.HasValue)
                {
                    //not delivered yet
                    continue;
                }

                var si = shipment.ShipmentItems
                         .FirstOrDefault(x => x.OrderItemId == orderItem.Id);
                if (si != null)
                {
                    result += si.Quantity;
                }
            }

            return(result);
        }
        /// <summary>
        /// Gets a value indicating whether an order has items to ship
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>A value indicating whether an order has items to ship</returns>
        public static async Task <bool> HasItemsToShip(this Order order, IOrderService orderService, IShipmentService shipmentService, IProductService productService)
        {
            if (order == null)
            {
                throw new ArgumentNullException("order");
            }

            foreach (var orderItem in order.OrderItems)
            {
                //we can ship only shippable products
                var product = await productService.GetProductByIdIncludeArch(orderItem.ProductId);

                if (!product.IsShipEnabled)
                {
                    continue;
                }

                var totalNumberOfNotYetShippedItems = await orderItem.GetTotalNumberOfNotYetShippedItems(orderService, shipmentService);

                if (totalNumberOfNotYetShippedItems <= 0)
                {
                    continue;
                }

                //yes, we have at least one item to ship
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Gets a value indicating whether an order has items to be added to a shipment
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>A value indicating whether an order has items to be added to a shipment</returns>
        public static async Task<bool> HasItemsToAddToShipment(this Order order, IOrderService orderService, IShipmentService shipmentService, IProductService productService)
        {
            if (order == null)
                throw new ArgumentNullException("order");

            foreach (var orderItem in order.OrderItems)
            {
                //we can ship only shippable products
                var product = await productService.GetProductByIdIncludeArch(orderItem.ProductId);
                if (!product.IsShipEnabled)
                    continue;

                var totalNumberOfItemsCanBeAddedToShipment = await orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(orderService, shipmentService);
                if (totalNumberOfItemsCanBeAddedToShipment <= 0)
                    continue;

                //yes, we have at least one item to create a new shipment
                return true;
            }
            return false;
        }
 public ShipmentController(IShipmentService shipmentService, ILoggerManager logger)
 {
     _shipmentService = shipmentService;
     _logger          = logger;
 }
        public Home()
        {
            businessPartnerService            = DependencyResolver.Kernel.Get <IBusinessPartnerService>();
            businessPartnerTypeService        = DependencyResolver.Kernel.Get <IBusinessPartnerTypeService>();
            businessPartnerBankService        = DependencyResolver.Kernel.Get <IBusinessPartnerBankService>();
            businessPartnerDocumentService    = DependencyResolver.Kernel.Get <IBusinessPartnerDocumentService>();
            businessPartnerInstitutionService = DependencyResolver.Kernel.Get <IBusinessPartnerInstitutionService>();
            businessPartnerLocationService    = DependencyResolver.Kernel.Get <IBusinessPartnerLocationService>();
            businessPartnerNoteService        = DependencyResolver.Kernel.Get <IBusinessPartnerNoteService>();
            //businessPartnerOrganizationUnitService = DependencyResolver.Kernel.Get<IBusinessPartnerOrganizationUnitService>();
            businessPartnerPhoneService = DependencyResolver.Kernel.Get <IBusinessPartnerPhoneService>();


            employeeService           = DependencyResolver.Kernel.Get <IEmployeeService>();
            employeeProfessionService = DependencyResolver.Kernel.Get <IEmployeeProfessionService>();
            employeeNoteService       = DependencyResolver.Kernel.Get <IEmployeeNoteService>();
            employeeLicenceService    = DependencyResolver.Kernel.Get <IEmployeeLicenceService>();
            employeeItemService       = DependencyResolver.Kernel.Get <IEmployeeItemService>();
            employeeDocumentService   = DependencyResolver.Kernel.Get <IEmployeeDocumentService>();
            employeeCardService       = DependencyResolver.Kernel.Get <IEmployeeCardService>();

            licenceTypeService  = DependencyResolver.Kernel.Get <ILicenceTypeService>();
            familyMemberService = DependencyResolver.Kernel.Get <IFamilyMemberService>();

            physicalPersonService           = DependencyResolver.Kernel.Get <IPhysicalPersonService>();
            physicalPersonProfessionService = DependencyResolver.Kernel.Get <IPhysicalPersonProfessionService>();
            physicalPersonNoteService       = DependencyResolver.Kernel.Get <IPhysicalPersonNoteService>();
            physicalPersonLicenceService    = DependencyResolver.Kernel.Get <IPhysicalPersonLicenceService>();
            physicalPersonItemService       = DependencyResolver.Kernel.Get <IPhysicalPersonItemService>();
            physicalPersonDocumentService   = DependencyResolver.Kernel.Get <IPhysicalPersonDocumentService>();
            physicalPersonCardService       = DependencyResolver.Kernel.Get <IPhysicalPersonCardService>();


            outputInvoiceService = DependencyResolver.Kernel.Get <IOutputInvoiceService>();
            inputInvoiceService  = DependencyResolver.Kernel.Get <IInputInvoiceService>();

            countryService      = DependencyResolver.Kernel.Get <ICountryService>();
            regionService       = DependencyResolver.Kernel.Get <IRegionService>();
            municipalityService = DependencyResolver.Kernel.Get <IMunicipalityService>();
            cityService         = DependencyResolver.Kernel.Get <ICityService>();

            sectorService     = DependencyResolver.Kernel.Get <ISectorService>();
            professionService = DependencyResolver.Kernel.Get <IProfessionService>();
            bankService       = DependencyResolver.Kernel.Get <IBankService>();
            agencyService     = DependencyResolver.Kernel.Get <IAgencyService>();

            constructionSiteService            = DependencyResolver.Kernel.Get <IConstructionSiteService>();
            constructionSiteDocumentService    = DependencyResolver.Kernel.Get <IConstructionSiteDocumentService>();
            constructionSiteCalculationService = DependencyResolver.Kernel.Get <IConstructionSiteCalculationService>();
            constructionSiteNoteService        = DependencyResolver.Kernel.Get <IConstructionSiteNoteService>();


            //employeeByBusinessPartnerService = DependencyResolver.Kernel.Get<IEmployeeByBusinessPartnerService>(); //radnici po firmama?
            //employeeByConstructionSiteService = DependencyResolver.Kernel.Get<IEmployeeByConstructionSiteService>(); // radnici po gradilistu
            //businessPartnerByConstructionSiteService = DependencyResolver.Kernel.Get<IBusinessPartnerByConstructionSiteService>(); //firme po gradilistu

            taxAdministrationService = DependencyResolver.Kernel.Get <ITaxAdministrationService>();

            limitationService      = DependencyResolver.Kernel.Get <ILimitationService>();
            userService            = DependencyResolver.Kernel.Get <IUserService>();
            vatService             = DependencyResolver.Kernel.Get <IVatService>();
            discountService        = DependencyResolver.Kernel.Get <IDiscountService>();
            serviceDeliveryService = DependencyResolver.Kernel.Get <IServiceDeliveryService>();
            statusService          = DependencyResolver.Kernel.Get <IStatusService>();
            shipmentService        = DependencyResolver.Kernel.Get <IShipmentService>();

            toDoService = DependencyResolver.Kernel.Get <IToDoService>();

            phonebookService  = DependencyResolver.Kernel.Get <IPhonebookService>();
            callCentarService = DependencyResolver.Kernel.Get <ICallCentarService>();

            employeeByConstructionSiteService        = DependencyResolver.Kernel.Get <IEmployeeByConstructionSiteService>();
            businessPartnerByConstructionSiteService = DependencyResolver.Kernel.Get <IBusinessPartnerByConstructionSiteService>();
            employeeByBusinessPartnerService         = DependencyResolver.Kernel.Get <IEmployeeByBusinessPartnerService>();

            documentFolderService = DependencyResolver.Kernel.Get <IDocumentFolderService>();
            documentFileService   = DependencyResolver.Kernel.Get <IDocumentFileService>();

            InitializeComponent();

            this.DataContext = this;

            var resp = new CompanyUserSQLiteRepository().GetCompanyUser(MainWindow.CurrentCompanyId, MainWindow.CurrentUser?.Identifier ?? Guid.Empty);

            if (resp.Success)
            {
                var userRoles = resp.CompanyUser?.UserRoles ?? new List <UserRoleViewModel>();
                if (userRoles.Any(x => x.Name == "CallCentar") || userRoles.Any(x => x.Name == "Admin"))
                {
                    CallCentarList.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    CallCentarList.Visibility = System.Windows.Visibility.Collapsed;
                }
            }
        }
Exemple #49
0
 public ShipmentController(
     IShipmentViewModelService shipmentViewModelService,
     IOrderService orderService,
     IOrderProcessingService orderProcessingService,
     ILocalizationService localizationService,
     IWorkContext workContext,
     IMeasureService measureService,
     IPdfService pdfService,
     IProductService productService,
     IExportManager exportManager,
     IWorkflowMessageService workflowMessageService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductAttributeService productAttributeService,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     IShoppingCartService shoppingCartService,
     IGiftCardService giftCardService,
     IDownloadService downloadService,
     IShipmentService shipmentService,
     IShippingService shippingService,
     IStoreService storeService,
     IVendorService vendorService,
     IAddressAttributeParser addressAttributeParser,
     IAddressAttributeService addressAttributeService,
     IAddressAttributeFormatter addressAttributeFormatter,
     IAffiliateService affiliateService,
     IPictureService pictureService,
     ITaxService taxService,
     IReturnRequestService returnRequestService,
     ICustomerService customerService,
     ICustomerActivityService customerActivityService,
     CurrencySettings currencySettings,
     TaxSettings taxSettings,
     MeasureSettings measureSettings,
     AddressSettings addressSettings,
     ShippingSettings shippingSettings,
     MediaSettings mediaSettings)
 {
     _shipmentViewModelService = shipmentViewModelService;
     _orderService             = orderService;
     _orderProcessingService   = orderProcessingService;
     _localizationService      = localizationService;
     _workContext               = workContext;
     _measureService            = measureService;
     _pdfService                = pdfService;
     _productService            = productService;
     _exportManager             = exportManager;
     _workflowMessageService    = workflowMessageService;
     _categoryService           = categoryService;
     _manufacturerService       = manufacturerService;
     _productAttributeService   = productAttributeService;
     _productAttributeParser    = productAttributeParser;
     _productAttributeFormatter = productAttributeFormatter;
     _shoppingCartService       = shoppingCartService;
     _giftCardService           = giftCardService;
     _downloadService           = downloadService;
     _shipmentService           = shipmentService;
     _shippingService           = shippingService;
     _storeService              = storeService;
     _vendorService             = vendorService;
     _addressAttributeParser    = addressAttributeParser;
     _addressAttributeService   = addressAttributeService;
     _addressAttributeFormatter = addressAttributeFormatter;
     _affiliateService          = affiliateService;
     _pictureService            = pictureService;
     _taxService                = taxService;
     _returnRequestService      = returnRequestService;
     _customerActivityService   = customerActivityService;
     _currencySettings          = currencySettings;
     _taxSettings               = taxSettings;
     _measureSettings           = measureSettings;
     _addressSettings           = addressSettings;
     _shippingSettings          = shippingSettings;
     _customerService           = customerService;
     _mediaSettings             = mediaSettings;
 }
 public GroupDealsController(
     IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IRepository <GroupDeal> groupDealRepo,
     IRepository <GroupdealPicture> groupdealPictureRepo,
     IGroupDealService groupdealService,
     IGenericAttributeService genericAttributeService)
     : base(productService,
            productTemplateService,
            categoryService,
            manufacturerService,
            customerService,
            urlRecordService,
            workContext,
            languageService,
            localizationService,
            localizedEntityService,
            specificationAttributeService,
            pictureService,
            taxCategoryService,
            productTagService,
            copyProductService,
            pdfService,
            exportManager,
            importManager,
            customerActivityService,
            permissionService,
            aclService,
            storeService,
            orderService,
            storeMappingService,
            vendorService,
            shippingService,
            shipmentService,
            currencyService,
            currencySettings,
            measureService,
            measureSettings,
            adminAreaSettings,
            dateTimeHelper,
            discountService,
            productAttributeService,
            backInStockSubscriptionService,
            shoppingCartService,
            productAttributeFormatter,
            productAttributeParser,
            downloadService,
            groupDealRepo,
            groupdealPictureRepo,
            groupdealService,
            genericAttributeService)
 {
 }
 public void Init()
 {
     _shipmentService = MerchelloContext.Current.Services.ShipmentService;
 }
 public ProductController(IProductService productService, 
     IProductTemplateService productTemplateService,
     ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService, 
     IWorkContext workContext, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService, 
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService, 
     IProductTagService productTagService,
     ICopyProductService copyProductService, 
     IPdfService pdfService,
     IExportManager exportManager, 
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService, 
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
      IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService, 
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService)
 {
     this._productService = productService;
     this._productTemplateService = productTemplateService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._workContext = workContext;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._specificationAttributeService = specificationAttributeService;
     this._pictureService = pictureService;
     this._taxCategoryService = taxCategoryService;
     this._productTagService = productTagService;
     this._copyProductService = copyProductService;
     this._pdfService = pdfService;
     this._exportManager = exportManager;
     this._importManager = importManager;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._aclService = aclService;
     this._storeService = storeService;
     this._orderService = orderService;
     this._storeMappingService = storeMappingService;
     this._vendorService = vendorService;
     this._shippingService = shippingService;
     this._shipmentService = shipmentService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._adminAreaSettings = adminAreaSettings;
     this._dateTimeHelper = dateTimeHelper;
     this._discountService = discountService;
     this._productAttributeService = productAttributeService;
     this._backInStockSubscriptionService = backInStockSubscriptionService;
     this._shoppingCartService = shoppingCartService;
     this._productAttributeFormatter = productAttributeFormatter;
     this._productAttributeParser = productAttributeParser;
     this._downloadService = downloadService;
 }
        public new void SetUp()
        {
            _workContext = null;

            var pluginFinder = new PluginFinder();
            var cacheManager = new NopNullCache();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            //price calculation service
            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
            _priceCalcService = new PriceCalculationService(_workContext, _discountService,
                _categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _logger = new NullLogger();
            _shippingService = new ShippingService(cacheManager,
                _shippingMethodRepository,
                _logger,
                _productAttributeParser,
                _checkoutAttributeParser,
                _localizationService,
                _shippingSettings, pluginFinder,
                _eventPublisher, _shoppingCartSettings);
            _shipmentService = MockRepository.GenerateMock<IShipmentService>();

            _paymentService = MockRepository.GenerateMock<IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
            _giftCardService = MockRepository.GenerateMock<IGiftCardService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock<IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext,
                _priceCalcService, _taxService, _shippingService, _paymentService,
                _checkoutAttributeParser, _discountService, _giftCardService,
                _genericAttributeService,
                _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService = MockRepository.GenerateMock<IOrderService>();
            _webHelper = MockRepository.GenerateMock<IWebHelper>();
            _languageService = MockRepository.GenerateMock<ILanguageService>();
            _productService = MockRepository.GenerateMock<IProductService>();
            _priceFormatter= MockRepository.GenerateMock<IPriceFormatter>();
            _productAttributeFormatter= MockRepository.GenerateMock<IProductAttributeFormatter>();
            _shoppingCartService= MockRepository.GenerateMock<IShoppingCartService>();
            _checkoutAttributeFormatter= MockRepository.GenerateMock<ICheckoutAttributeFormatter>();
            _customerService= MockRepository.GenerateMock<ICustomerService>();
            _encryptionService = MockRepository.GenerateMock<IEncryptionService>();
            _workflowMessageService = MockRepository.GenerateMock<IWorkflowMessageService>();
            _customerActivityService = MockRepository.GenerateMock<ICustomerActivityService>();
            _currencyService = MockRepository.GenerateMock<ICurrencyService>();

            _paymentSettings = new PaymentSettings()
            {
                ActivePaymentMethodSystemNames = new List<string>()
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings = new OrderSettings();

            _localizationSettings = new LocalizationSettings();

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _currencySettings = new CurrencySettings();

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                _localizationService, _languageService,
                _productService, _paymentService, _logger,
                _orderTotalCalcService, _priceCalcService, _priceFormatter,
                _productAttributeParser, _productAttributeFormatter,
                _giftCardService, _shoppingCartService, _checkoutAttributeFormatter,
                _shippingService, _shipmentService, _taxService,
                _customerService, _discountService,
                _encryptionService, _workContext, _workflowMessageService,
                _customerActivityService, _currencyService,
                _eventPublisher, _paymentSettings, _rewardPointsSettings,
                _orderSettings, _taxSettings, _localizationSettings,
                _currencySettings);
        }
        public OrderController(IOrderService orderService, 
            IOrderReportService orderReportService, IOrderProcessingService orderProcessingService,
            IDateTimeHelper dateTimeHelper, IPriceFormatter priceFormatter, ILocalizationService localizationService,
            IWorkContext workContext, ICurrencyService currencyService,
            IEncryptionService encryptionService, IPaymentService paymentService,
            IMeasureService measureService, IPdfService pdfService,
            IAddressService addressService, ICountryService countryService,
            IStateProvinceService stateProvinceService, IProductService productService,
            IExportManager exportManager, IPermissionService permissionService,
            IWorkflowMessageService workflowMessageService,
            ICategoryService categoryService, IManufacturerService manufacturerService,
            IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser,
            IProductAttributeFormatter productAttributeFormatter, IShoppingCartService shoppingCartService,
            IGiftCardService giftCardService, IDownloadService downloadService,
            IShipmentService shipmentService,
            CatalogSettings catalogSettings, CurrencySettings currencySettings, TaxSettings taxSettings,
            MeasureSettings measureSettings, PdfSettings pdfSettings, AddressSettings addressSettings)
        {
            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._encryptionService = encryptionService;
            this._paymentService = paymentService;
            this._measureService = measureService;
            this._pdfService = pdfService;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._productService = productService;
            this._exportManager = exportManager;
            this._permissionService = permissionService;
            this._workflowMessageService = workflowMessageService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService = shoppingCartService;
            this._giftCardService = giftCardService;
            this._downloadService = downloadService;
            this._shipmentService = shipmentService;

            this._catalogSettings = catalogSettings;
            this._currencySettings = currencySettings;
            this._taxSettings = taxSettings;
            this._measureSettings = measureSettings;
            this._pdfSettings = pdfSettings;
            this._addressSettings = addressSettings;
        }
        public new void SetUp()
        {
            _workContext = null;
            _services    = MockRepository.GenerateMock <ICommonServices>();

            _store = new Store()
            {
                Id = 1
            };
            _storeContext = MockRepository.GenerateMock <IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            var pluginFinder = PluginFinder.Current;

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            //price calculation service
            _discountService         = MockRepository.GenerateMock <IDiscountService>();
            _categoryService         = MockRepository.GenerateMock <ICategoryService>();
            _manufacturerService     = MockRepository.GenerateMock <IManufacturerService>();
            _productAttributeParser  = MockRepository.GenerateMock <IProductAttributeParser>();
            _productAttributeService = MockRepository.GenerateMock <IProductAttributeService>();
            _genericAttributeService = MockRepository.GenerateMock <IGenericAttributeService>();
            _eventPublisher          = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _localizationService = MockRepository.GenerateMock <ILocalizationService>();
            _settingService      = MockRepository.GenerateMock <ISettingService>();
            _cartRuleProvider    = MockRepository.GenerateMock <ICartRuleProvider>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock <IRepository <ShippingMethod> >();
            _storeMappingRepository   = MockRepository.GenerateMock <IRepository <StoreMapping> >();

            _shippingService = new ShippingService(
                _shippingMethodRepository,
                _storeMappingRepository,
                _productAttributeParser,
                _productService,
                _checkoutAttributeParser,
                _genericAttributeService,
                _shippingSettings,
                _settingService,
                this.ProviderManager,
                _services,
                _cartRuleProvider);

            _shipmentService = MockRepository.GenerateMock <IShipmentService>();

            _paymentService          = MockRepository.GenerateMock <IPaymentService>();
            _providerManager         = MockRepository.GenerateMock <IProviderManager>();
            _checkoutAttributeParser = MockRepository.GenerateMock <ICheckoutAttributeParser>();
            _giftCardService         = MockRepository.GenerateMock <IGiftCardService>();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;

            _addressService = MockRepository.GenerateMock <IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address()
            {
                Id = _taxSettings.DefaultTaxAddressId
            });
            _downloadService  = MockRepository.GenerateMock <IDownloadService>();
            _httpRequestBase  = MockRepository.GenerateMock <HttpRequestBase>();
            _geoCountryLookup = MockRepository.GenerateMock <IGeoCountryLookup>();

            _taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);

            _rewardPointsSettings = new RewardPointsSettings();

            _priceCalcService = new PriceCalculationService(_discountService, _categoryService, _manufacturerService, _productAttributeParser, _productService,
                                                            _catalogSettings, _productAttributeService, _downloadService, _services, _httpRequestBase, _taxService, _taxSettings);

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                                                                      _priceCalcService, _taxService, _shippingService, _providerManager,
                                                                      _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, _paymentService, _currencyService, _productAttributeParser,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService                  = MockRepository.GenerateMock <IOrderService>();
            _webHelper                     = MockRepository.GenerateMock <IWebHelper>();
            _languageService               = MockRepository.GenerateMock <ILanguageService>();
            _productService                = MockRepository.GenerateMock <IProductService>();
            _priceFormatter                = MockRepository.GenerateMock <IPriceFormatter>();
            _productAttributeFormatter     = MockRepository.GenerateMock <IProductAttributeFormatter>();
            _shoppingCartService           = MockRepository.GenerateMock <IShoppingCartService>();
            _checkoutAttributeFormatter    = MockRepository.GenerateMock <ICheckoutAttributeFormatter>();
            _customerService               = MockRepository.GenerateMock <ICustomerService>();
            _encryptionService             = MockRepository.GenerateMock <IEncryptionService>();
            _messageFactory                = MockRepository.GenerateMock <IMessageFactory>();
            _customerActivityService       = MockRepository.GenerateMock <ICustomerActivityService>();
            _currencyService               = MockRepository.GenerateMock <ICurrencyService>();
            _affiliateService              = MockRepository.GenerateMock <IAffiliateService>();
            _newsLetterSubscriptionService = MockRepository.GenerateMock <INewsLetterSubscriptionService>();
            _affiliateService              = MockRepository.GenerateMock <IAffiliateService>();
            _checkoutAttributeParser       = MockRepository.GenerateMock <ICheckoutAttributeParser>();
            _downloadService               = MockRepository.GenerateMock <IDownloadService>();

            _orderSettings        = new OrderSettings();
            _localizationSettings = new LocalizationSettings();

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                                                                 _localizationService, _languageService,
                                                                 _productService, _paymentService,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter,
                                                                 _productAttributeParser, _productAttributeFormatter,
                                                                 _giftCardService, _shoppingCartService, _checkoutAttributeFormatter, _checkoutAttributeParser,
                                                                 _shippingService, _shipmentService, _taxService,
                                                                 _customerService, _discountService,
                                                                 _encryptionService, _workContext, _storeContext,
                                                                 _messageFactory, _customerActivityService, _currencyService, _affiliateService,
                                                                 _eventPublisher, _genericAttributeService,
                                                                 _newsLetterSubscriptionService, _downloadService,
                                                                 _rewardPointsSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings,
                                                                 _shoppingCartSettings,
                                                                 _catalogSettings);
        }
Exemple #56
0
 public ProcessOrderAfterPaymentHandler(IOrderRepository orderRepository, ICatalogService catalogService, IOrderRequestService requestService, IShipmentService shipmentService)
 {
     _orderRepository = orderRepository;
     _catalogService  = catalogService;
     _requestService  = requestService;
     _shipmentService = shipmentService;
 }
        public InvoicesController(IOrderService orderService,
            IOrderReportService orderReportService,
            IOrderProcessingService orderProcessingService,
            IPriceCalculationService priceCalculationService,
            IDateTimeHelper dateTimeHelper,
            IPriceFormatter priceFormatter,
            IDiscountService discountService,
            ILocalizationService localizationService,
            IWorkContext workContext,
            ICurrencyService currencyService,
            IEncryptionService encryptionService,
            IPaymentService paymentService,
            IMeasureService measureService,
            IPdfService pdfService,
            IAddressService addressService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            Nop.Services.Catalog.IProductService productService,
            IExportManager exportManager,
            IPermissionService permissionService,
            IWorkflowMessageService workflowMessageService,
            ICategoryService categoryService,
            IManufacturerService manufacturerService,
            IProductAttributeService productAttributeService,
            IProductAttributeParser productAttributeParser,
            IProductAttributeFormatter productAttributeFormatter,
            IShoppingCartService shoppingCartService,
            IGiftCardService giftCardService,
            IDownloadService downloadService,
            IShipmentService shipmentService,
            IShippingService shippingService,
            IStoreService storeService,
            IVendorService vendorService,
            IAddressAttributeParser addressAttributeParser,
            IAddressAttributeService addressAttributeService,
            IAddressAttributeFormatter addressAttributeFormatter,
            IAffiliateService affiliateService,
            IPictureService pictureService,
            CurrencySettings currencySettings,
            TaxSettings taxSettings,
            MeasureSettings measureSettings,
            AddressSettings addressSettings,
            ShippingSettings shippingSettings,
            IInvoiceService invoiceService,
            IGenericAttributeService genericAttributeService,
            IProductTemplateService productTemplateService,
            IStoreContext storeContext,
            ISettingService settingService,
            IGroupDealService groupDealService)
        {
            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderProcessingService = orderProcessingService;
            this._priceCalculationService = priceCalculationService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._discountService = discountService;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._encryptionService = encryptionService;
            this._paymentService = paymentService;
            this._measureService = measureService;
            this._pdfService = pdfService;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._productService = productService;
            this._exportManager = exportManager;
            this._permissionService = permissionService;
            this._workflowMessageService = workflowMessageService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService = shoppingCartService;
            this._giftCardService = giftCardService;
            this._downloadService = downloadService;
            this._shipmentService = shipmentService;
            this._shippingService = shippingService;
            this._storeService = storeService;
            this._vendorService = vendorService;
            this._addressAttributeParser = addressAttributeParser;
            this._addressAttributeService = addressAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._affiliateService = affiliateService;
            this._pictureService = pictureService;

            this._currencySettings = currencySettings;
            this._taxSettings = taxSettings;
            this._measureSettings = measureSettings;
            this._addressSettings = addressSettings;
            this._shippingSettings = shippingSettings;
            this._invoiceService = invoiceService;
            this._genericAttributeService = genericAttributeService;
            this._productTemplateService = productTemplateService;
            this._storeContext = storeContext;
            this._settingService = settingService;
            this._groupDealService = groupDealService;
        }
        public void TestInitialize()
        {
            _workContext = null;

            _store = new Store {
                Id = "1"
            };
            var tempStoreContext = new Mock <IStoreContext>();
            {
                tempStoreContext.Setup(x => x.CurrentStore).Returns(_store);
                _storeContext = tempStoreContext.Object;
            }

            var pluginFinder = new PluginFinder(_serviceProvider);

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            var tempEventPublisher = new Mock <IMediator>();
            {
                //tempEventPublisher.Setup(x => x.PublishAsync(It.IsAny<object>()));
                _eventPublisher = tempEventPublisher.Object;
            }
            var cacheManager = new TestMemoryCacheManager(new Mock <IMemoryCache>().Object, _eventPublisher);

            _productService = new Mock <IProductService>().Object;

            //price calculation service
            _discountService           = new Mock <IDiscountService>().Object;
            _categoryService           = new Mock <ICategoryService>().Object;
            _manufacturerService       = new Mock <IManufacturerService>().Object;
            _customerService           = new Mock <ICustomerService>().Object;
            _customerProductService    = new Mock <ICustomerProductService>().Object;
            _productReservationService = new Mock <IProductReservationService>().Object;
            _currencyService           = new Mock <ICurrencyService>().Object;
            _auctionService            = new Mock <IAuctionService>().Object;
            _serviceProvider           = new Mock <IServiceProvider>().Object;
            _stateProvinceService      = new Mock <IStateProvinceService>().Object;

            _productAttributeParser = new Mock <IProductAttributeParser>().Object;
            _priceCalcService       = new PriceCalculationService(_workContext, _storeContext,
                                                                  _discountService, _categoryService, _manufacturerService,
                                                                  _productAttributeParser, _productService, _customerProductService,
                                                                  _vendorService, _currencyService, _shoppingCartSettings, _catalogSettings);



            _localizationService = new Mock <ILocalizationService>().Object;

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = new Mock <IRepository <ShippingMethod> >().Object;
            _deliveryDateRepository   = new Mock <IRepository <DeliveryDate> >().Object;
            _warehouseRepository      = new Mock <IRepository <Warehouse> >().Object;

            _logger          = new NullLogger();
            _shippingService = new ShippingService(_shippingMethodRepository,
                                                   _deliveryDateRepository,
                                                   _warehouseRepository,
                                                   null,
                                                   _logger,
                                                   _productService,
                                                   _productAttributeParser,
                                                   _checkoutAttributeParser,
                                                   _localizationService,
                                                   _addressService,
                                                   _countryService,
                                                   _stateProvinceService,
                                                   pluginFinder,
                                                   _eventPublisher,
                                                   _currencyService,
                                                   cacheManager,
                                                   _shoppingCartSettings,
                                                   _shippingSettings);
            _shipmentService = new Mock <IShipmentService>().Object;

            tempPaymentService = new Mock <IPaymentService>();
            {
                _paymentService = tempPaymentService.Object;
            }
            _checkoutAttributeParser = new Mock <ICheckoutAttributeParser>().Object;
            _giftCardService         = new Mock <IGiftCardService>().Object;
            _genericAttributeService = new Mock <IGenericAttributeService>().Object;

            _geoLookupService = new Mock <IGeoLookupService>().Object;
            _countryService   = new Mock <ICountryService>().Object;
            _customerSettings = new CustomerSettings();
            _addressSettings  = new AddressSettings();

            //tax
            _taxSettings = new TaxSettings
            {
                ShippingIsTaxable = true,
                PaymentMethodAdditionalFeeIsTaxable = true,
                DefaultTaxAddressId = "10"
            };

            var tempAddressService = new Mock <IAddressService>();

            {
                tempAddressService.Setup(x => x.GetAddressByIdSettings(_taxSettings.DefaultTaxAddressId))
                .ReturnsAsync(new Address {
                    Id = _taxSettings.DefaultTaxAddressId
                });
                _addressService = tempAddressService.Object;
            }

            _taxService = new TaxService(_addressService, _workContext, pluginFinder, _geoLookupService, _countryService, _logger, _taxSettings, _customerSettings, _addressSettings);

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                                                                      _priceCalcService, _taxService, _shippingService, _paymentService,
                                                                      _checkoutAttributeParser, _discountService, _giftCardService,
                                                                      null, _productService, _currencyService,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService               = new Mock <IOrderService>().Object;
            _webHelper                  = new Mock <IWebHelper>().Object;
            _languageService            = new Mock <ILanguageService>().Object;
            _priceFormatter             = new Mock <IPriceFormatter>().Object;
            _productAttributeFormatter  = new Mock <IProductAttributeFormatter>().Object;
            _shoppingCartService        = new Mock <IShoppingCartService>().Object;
            _checkoutAttributeFormatter = new Mock <ICheckoutAttributeFormatter>().Object;
            _encryptionService          = new Mock <IEncryptionService>().Object;
            _workflowMessageService     = new Mock <IWorkflowMessageService>().Object;
            _customerActivityService    = new Mock <ICustomerActivityService>().Object;
            _currencyService            = new Mock <ICurrencyService>().Object;
            _affiliateService           = new Mock <IAffiliateService>().Object;
            _vendorService              = new Mock <IVendorService>().Object;
            _pdfService                 = new Mock <IPdfService>().Object;

            _paymentSettings = new PaymentSettings
            {
                ActivePaymentMethodSystemNames = new List <string>
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings        = new OrderSettings();
            _localizationSettings = new LocalizationSettings();
            ICustomerActionEventService tempICustomerActionEventService = new Mock <ICustomerActionEventService>().Object;

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                                                                 _localizationService, _languageService,
                                                                 _productService, _paymentService, _logger,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter,
                                                                 _productAttributeParser, _productAttributeFormatter,
                                                                 _giftCardService, _shoppingCartService, _checkoutAttributeFormatter,
                                                                 _shippingService, _taxService,
                                                                 _customerService, _discountService,
                                                                 _encryptionService, _workContext,
                                                                 _workflowMessageService, _vendorService,
                                                                 _currencyService, _affiliateService,
                                                                 _eventPublisher, _pdfService, null, _storeContext, _productReservationService, _auctionService, _countryService,
                                                                 _shippingSettings, _shoppingCartSettings, _paymentSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings);
        }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="orderService">Order service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="languageService">Language service</param>
 /// <param name="productService">Product service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="logger">Logger</param>
 /// <param name="orderTotalCalculationService">Order total calculationservice</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="productAttributeFormatter">Product attribute formatter</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="shoppingCartService">Shopping cart service</param>
 /// <param name="checkoutAttributeFormatter">Checkout attribute service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="shipmentService">Shipment service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="workContext">Work context</param>
 /// <param name="workflowMessageService">Workflow message service</param>
 /// <param name="vendorService">Vendor service</param>
 /// <param name="customerActivityService">Customer activity service</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="affiliateService">Affiliate service</param>
 /// <param name="eventPublisher">Event published</param>
 /// <param name="pdfService">PDF service</param>
 /// <param name="paymentSettings">Payment settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="orderSettings">Order settings</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="localizationSettings">Localization settings</param>
 /// <param name="currencySettings">Currency settings</param>
 public OrderProcessingService(IOrderService orderService,
     IWebHelper webHelper,
     ILocalizationService localizationService,
     ILanguageService languageService,
     IProductService productService,
     IPaymentService paymentService,
     ILogger logger,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     IGiftCardService giftCardService,
     IShoppingCartService shoppingCartService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ITaxService taxService,
     ICustomerService customerService,
     IDiscountService discountService,
     IEncryptionService encryptionService,
     IWorkContext workContext,
     IWorkflowMessageService workflowMessageService,
     IVendorService vendorService,
     ICustomerActivityService customerActivityService,
     ICurrencyService currencyService,
     IAffiliateService affiliateService,
     IEventPublisher eventPublisher,
     IPdfService pdfService,
     ShippingSettings shippingSettings,
     PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     TaxSettings taxSettings,
     LocalizationSettings localizationSettings,
     CurrencySettings currencySettings)
 {
     this._orderService = orderService;
     this._webHelper = webHelper;
     this._localizationService = localizationService;
     this._languageService = languageService;
     this._productService = productService;
     this._paymentService = paymentService;
     this._logger = logger;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productAttributeParser = productAttributeParser;
     this._productAttributeFormatter = productAttributeFormatter;
     this._giftCardService = giftCardService;
     this._shoppingCartService = shoppingCartService;
     this._checkoutAttributeFormatter = checkoutAttributeFormatter;
     this._workContext = workContext;
     this._workflowMessageService = workflowMessageService;
     this._vendorService = vendorService;
     this._shippingService = shippingService;
     this._shipmentService = shipmentService;
     this._taxService = taxService;
     this._customerService = customerService;
     this._discountService = discountService;
     this._encryptionService = encryptionService;
     this._customerActivityService = customerActivityService;
     this._currencyService = currencyService;
     this._affiliateService = affiliateService;
     this._eventPublisher = eventPublisher;
     this._pdfService = pdfService;
     this._paymentSettings = paymentSettings;
     this._shippingSettings = shippingSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._orderSettings = orderSettings;
     this._taxSettings = taxSettings;
     this._localizationSettings = localizationSettings;
     this._currencySettings = currencySettings;
 }
Exemple #60
0
 public Test(IShipmentFactory shipmentFactory)
 {
     _shipmentFactory = shipmentFactory;
     IShipmentService result = _shipmentFactory.CreateShipmentService(CargoFirms.ArasKargo);
 }