Exemplo n.º 1
0
 public CategoryController(ICategoryService categoryService, ICategoryTemplateService categoryTemplateService,
     IManufacturerService manufacturerService, IProductService productService, 
     ICustomerService customerService,
     IUrlRecordService urlRecordService, IPictureService pictureService, ILanguageService languageService,
     ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
     IDiscountService discountService, IPermissionService permissionService,
     IAclService aclService,
     IExportManager exportManager, IWorkContext workContext,
     ICustomerActivityService customerActivityService, AdminAreaSettings adminAreaSettings,
     CatalogSettings catalogSettings)
 {
     this._categoryService = categoryService;
     this._categoryTemplateService = categoryTemplateService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._pictureService = pictureService;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._discountService = discountService;
     this._permissionService = permissionService;
     this._aclService = aclService;
     this._exportManager = exportManager;
     this._workContext = workContext;
     this._customerActivityService = customerActivityService;
     this._adminAreaSettings = adminAreaSettings;
     this._catalogSettings = catalogSettings;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="sciRepository">Shopping cart repository</param>
 /// <param name="workContext">Work context</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="productService">Product settings</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="checkoutAttributeService">Checkout attribute service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="eventPublisher">Event publisher</param>
 /// <param name="permissionService">Permission service</param>
 /// <param name="aclService">ACL service</param>
 public ShoppingCartService(IRepository<ShoppingCartItem> sciRepository,
     IWorkContext workContext, ICurrencyService currencyService,
     IProductService productService, ILocalizationService localizationService,
     IProductAttributeParser productAttributeParser,
     ICheckoutAttributeService checkoutAttributeService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IPriceFormatter priceFormatter,
     ICustomerService customerService,
     ShoppingCartSettings shoppingCartSettings,
     IEventPublisher eventPublisher,
     IPermissionService permissionService, 
     IAclService aclService)
 {
     this._sciRepository = sciRepository;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._productService = productService;
     this._localizationService = localizationService;
     this._productAttributeParser = productAttributeParser;
     this._checkoutAttributeService = checkoutAttributeService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._priceFormatter = priceFormatter;
     this._customerService = customerService;
     this._shoppingCartSettings = shoppingCartSettings;
     this._eventPublisher = eventPublisher;
     this._permissionService = permissionService;
     this._aclService = aclService;
 }
Exemplo n.º 3
0
 public InvoicesController(IInvoiceService invoiceService, IPatronService patronService, IProductService productService, IMapper<Invoice, InvoiceDTO> mapper)
 {
     _invoiceService = invoiceService;
     _patronService = patronService;
     _productService = productService;
     _mapper = mapper;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="httpContext">HTTP context</param>
 /// <param name="productService">Product service</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public CompareProductsService(HttpContextBase httpContext, IProductService productService,
     CatalogSettings catalogSettings)
 {
     this._httpContext = httpContext;
     this._productService = productService;
     this._catalogSettings = catalogSettings;
 }
Exemplo n.º 5
0
 public FroogleService(IScheduleTaskService scheduleTaskService,
     IGoogleService googleService,
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     IWebHelper webHelper,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     StoreInformationSettings storeInformationSettings,
     FroogleSettings froogleSettings,
     CurrencySettings currencySettings,
     GoogleProductObjectContext objectContext)
 {
     this._scheduleTaskService = scheduleTaskService;
     this._googleService = googleService;
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._webHelper = webHelper;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._froogleSettings = froogleSettings;
     this._currencySettings = currencySettings;
     this._objectContext = objectContext;
 }
Exemplo n.º 6
0
        public InvoicePopupViewModel(IInvoiceService invoiceService, IProductService productService)
        {
            InvoiceService = invoiceService;
            ProductService = productService;

            Items = new BindableCollection<SaleItemViewModel>();
        }
Exemplo n.º 7
0
        public CampaignController(
            ICampaignService campaignService,
            ITShirtCostService tshirtService,
            IProductService productService,
            IPromotionService promotionService,
            IRepository<CurrencyRecord> currencyRepository,
            IWorkContextAccessor wca,
            INotifier notifier,
            IOrchardServices services,
            ICookieCultureService cookieCultureService,
            ICountryService countryService)
        {
            _currencyRepository = currencyRepository;
            Services = services;
            _tshirtService = tshirtService;
            _productService = productService;
            _campaignService = campaignService;
            _promotionService = promotionService;
            _wca = wca;
            _notifier = notifier;
            Logger = NullLogger.Instance;

            _cookieCultureService = cookieCultureService;
            //var culture = _wca.GetContext().CurrentCulture.Trim();
            _cultureUsed = _wca.GetContext().CurrentCulture.Trim();
            //cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
            _countryService = countryService;
        }
        public static void MyClassInitialize(TestContext testContext)
        {
            container = TestManager.ConfigureUnityContainer("unity");

            productService = container.Resolve<IProductService>();

        }
 public MiscFacebookShopController(IAclService aclService,
     ICacheManager cacheManager,
     CatalogSettings catalogSettings,
     ICategoryService categoryService,
     ICurrencyService currencyService,
     ILocalizationService localizationService,
     IPermissionService permissionService,
     IPictureService pictureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductService productService,
     IStoreContext storeContext,
     IStoreMappingService storeMappingService,
     ITaxService taxService,
     IWorkContext workContext)
 {
     this._aclService = aclService;
     this._cacheManager = cacheManager;
     this._catalogSettings = catalogSettings;
     this._categoryService = categoryService;
     this._currencyService = currencyService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._pictureService = pictureService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productService = productService;
     this._storeContext = storeContext;
     this._storeMappingService = storeMappingService;
     this._taxService = taxService;
     this._workContext = workContext;
 }
Exemplo n.º 10
0
        public PriceCalculationService(
            IDiscountService discountService,
			ICategoryService categoryService,
            IProductAttributeParser productAttributeParser,
			IProductService productService,
			ShoppingCartSettings shoppingCartSettings, 
            CatalogSettings catalogSettings,
			IProductAttributeService productAttributeService,
			IDownloadService downloadService,
			ICommonServices services,
			HttpRequestBase httpRequestBase,
			ITaxService taxService)
        {
            this._discountService = discountService;
            this._categoryService = categoryService;
            this._productAttributeParser = productAttributeParser;
            this._productService = productService;
            this._shoppingCartSettings = shoppingCartSettings;
            this._catalogSettings = catalogSettings;
            this._productAttributeService = productAttributeService;
            this._downloadService = downloadService;
            this._services = services;
            this._httpRequestBase = httpRequestBase;
            this._taxService = taxService;
        }
 public BackwardCompatibility2XController(IProductService productService,
     ICategoryService categoryService, IManufacturerService manufacturerService)
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
 }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="cacheManager">Cache manager</param>
        /// <param name="categoryRepository">Category repository</param>
        /// <param name="productCategoryRepository">ProductCategory repository</param>
        /// <param name="productRepository">Product repository</param>
        /// <param name="aclRepository">ACL record repository</param>
		/// <param name="storeMappingRepository">Store mapping repository</param>
        /// <param name="workContext">Work context</param>
		/// <param name="storeContext">Store context</param>
        /// <param name="eventPublisher">Event publisher</param>
        public CategoryService(ICacheManager cacheManager,
            IRepository<Category> categoryRepository,
            IRepository<ProductCategory> productCategoryRepository,
            IRepository<Product> productRepository,
            IRepository<AclRecord> aclRepository,
			IRepository<StoreMapping> storeMappingRepository,
            IWorkContext workContext,
			IStoreContext storeContext,
            IEventPublisher eventPublisher,
			IStoreMappingService storeMappingService,
			IAclService aclService,
            Lazy<IEnumerable<ICategoryNavigationFilter>> navigationFilters,
            ICustomerService customerService,
            IProductService productService,
            IStoreService storeService)
        {
            this._cacheManager = cacheManager;
            this._categoryRepository = categoryRepository;
            this._productCategoryRepository = productCategoryRepository;
            this._productRepository = productRepository;
            this._aclRepository = aclRepository;
			this._storeMappingRepository = storeMappingRepository;
            this._workContext = workContext;
			this._storeContext = storeContext;
            this._eventPublisher = eventPublisher;
			this._storeMappingService = storeMappingService;
			this._aclService = aclService;
            this._navigationFilters = navigationFilters;
            this._customerService = customerService;
            this._productService = productService;
            this._storeService = storeService;

			this.QuerySettings = DbQuerySettings.Default;
        }
 public ManufacturerController(ICategoryService categoryService, IManufacturerService manufacturerService,
     IManufacturerTemplateService manufacturerTemplateService, IProductService productService,
     ICustomerService customerService, IStoreService storeService,
     IStoreMappingService storeMappingService,
     IUrlRecordService urlRecordService, IPictureService pictureService,
     ILanguageService languageService, ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService, IExportManager exportManager,
     ICustomerActivityService customerActivityService, IAclService aclService, 
     IPermissionService permissionService,
     AdminAreaSettings adminAreaSettings, CatalogSettings catalogSettings)
 {
     this._categoryService = categoryService;
     this._manufacturerTemplateService = manufacturerTemplateService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._customerService = customerService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._urlRecordService = urlRecordService;
     this._pictureService = pictureService;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._exportManager = exportManager;
     this._customerActivityService = customerActivityService;
     this._aclService = aclService;
     this._permissionService = permissionService;
     this._adminAreaSettings = adminAreaSettings;
     this._catalogSettings = catalogSettings;
 }
        public HomeInstallationQuoteController(
            IWorkContext workContext,
            ISettingService settingService,
            IGenericAttributeService genericAttributeService,
            ILocalizationService localizationService,
            IMessageTokenProvider messageTokenProvider,
            IEmailAccountService emailAccountService,
            IEventPublisher eventPublisher,
            IMessageTemplateService messageTemplateService,
            ITokenizer tokenizer,
            IQueuedEmailService queuedEmailService,
            IProductService productService,

            CaptchaSettings captchaSettings,
            EmailAccountSettings emailAccountSettings)
        {
            _workContext = workContext;
            _settingService = settingService;
            _genericAttributeService = genericAttributeService;
            _localizationService = localizationService;
            _messageTokenProvider = messageTokenProvider;
            _emailAccountService = emailAccountService;
            _eventPublisher = eventPublisher;
            _messageTemplateService = messageTemplateService;
            _tokenizer = tokenizer;
            _queuedEmailService = queuedEmailService;
            _productService = productService;
            _captchaSettings = captchaSettings;
            _emailAccountSettings = emailAccountSettings;
        }
 public ProductController()
 {
     // productService = ServiceLocator.GetProductService();
     IKernel ninjectKernel = new StandardKernel();
     ninjectKernel.Bind<IProductService>().To<ProductService>();
     serviceProduct = ninjectKernel.Get<IProductService>();
 }
Exemplo n.º 16
0
        public ExportManager(ICategoryService categoryService,
            IManufacturerService manufacturerService,
            IProductService productService,
			IProductAttributeService productAttributeService,
            IProductTemplateService productTemplateService,
            IPictureService pictureService,
            INewsLetterSubscriptionService newsLetterSubscriptionService,
            ILanguageService languageService,
			MediaSettings mediaSettings,
			ICommonServices services,
            IStoreMappingService storeMappingService)
        {
            _categoryService = categoryService;
            _manufacturerService = manufacturerService;
            _productService = productService;
			_productAttributeService = productAttributeService;
			_productTemplateService = productTemplateService;
            _pictureService = pictureService;
            _newsLetterSubscriptionService = newsLetterSubscriptionService;
            _languageService = languageService;
			_mediaSettings = mediaSettings;
			_services = services;
            _storeMappingService = storeMappingService;

			Logger = NullLogger.Instance;
        }
Exemplo n.º 17
0
 public PromoController(
     IPromoUtilities promoUtilities,
     IPriceFormatter priceFormatter,
     IWorkContext workContext,
     PromoSettings promoSettings,
     IProductMappingService productMappingService,
     IProductPromoMappingService productPromoMappingService,
     IPromoDetailService promoDetailService,
     IStoreService storeService,
     IStoreContext storeContext,
     IAttributeValueService attributeValueService,
     ICurrencyService currencyService,
     IPromoPictureService promoPictureService,
     IPictureService pictureService,
     IProductService productService,
     ILocalizationService localizationService)
 {
     this._promoUtilities = promoUtilities;
     this._priceFormatter = priceFormatter;
     this._workContext = workContext;
     this._productMappingService = productMappingService;
     this._productPromoMappingService = productPromoMappingService;
     this._promoDetailService = promoDetailService;
     this._promoSettings = promoSettings;
     this._storeService = storeService;
     this._storeContext = storeContext;
     this._attributeValueService = attributeValueService;
     this._currencyService = currencyService;
     this._promoPictureService = promoPictureService;
     this._pictureService = pictureService;
     this._productService = productService;
     this._localizationService = localizationService;
 }
Exemplo n.º 18
0
        public ImportManager(
			IProductService productService, 
			ICategoryService categoryService,
            IManufacturerService manufacturerService, 
			IPictureService pictureService,
            IUrlRecordService urlRecordService,
			SeoSettings seoSettings,
			IEventPublisher eventPublisher,
			IRepository<Product> rsProduct,
			IRepository<ProductCategory> rsProductCategory,
			IRepository<ProductManufacturer> rsProductManufacturer,
            IRepository<Picture> rsPicture,
			IRepository<ProductPicture> rsProductPicture,
            IRepository<UrlRecord> rsUrlRecord,
            ILanguageService languageService,
            ILocalizedEntityService localizedEntityService,
            IStoreMappingService storeMappingService)
        {
            this._productService = productService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._pictureService = pictureService;
            this._urlRecordService = urlRecordService;
            this._seoSettings = seoSettings;
            this._eventPublisher = eventPublisher;
            this._rsProduct = rsProduct;
            this._rsProductCategory = rsProductCategory;
            this._rsProductManufacturer = rsProductManufacturer;
            this._rsProductPicture = rsProductPicture;
            this._rsUrlRecord = rsUrlRecord;
            this._rsPicture = rsPicture;
            this._languageService = languageService;
            this._localizedEntityService = localizedEntityService;
            this._storeMappingService = storeMappingService;
        }
Exemplo n.º 19
0
        public GoogleFeedService(
			IRepository<GoogleProductRecord> gpRepository,
			IProductService productService,
			IManufacturerService manufacturerService,
			FroogleSettings settings,
			IMeasureService measureService,
			MeasureSettings measureSettings,
			IDbContext dbContext,
			AdminAreaSettings adminAreaSettings,
			ICurrencyService currencyService,
			ICommonServices services,
			IComponentContext ctx)
        {
            _gpRepository = gpRepository;
            _productService = productService;
            _manufacturerService = manufacturerService;
            Settings = settings;
            _measureService = measureService;
            _measureSettings = measureSettings;
            _dbContext = dbContext;
            _adminAreaSettings = adminAreaSettings;
            _currencyService = currencyService;
            _services = services;

            _helper = new FeedPluginHelper(ctx, "SmartStore.GoogleMerchantCenter", "SmartStore.GoogleMerchantCenter", () =>
            {
                return Settings as PromotionFeedSettings;
            });
        }
Exemplo n.º 20
0
        public override void FixtureSetup()
        {
            base.FixtureSetup();

            DbPreTestDataWorker.DeleteAllProducts();
            DbPreTestDataWorker.DeleteAllEntityCollections();

            _productService = DbPreTestDataWorker.ProductService;
            _entityCollectionService = DbPreTestDataWorker.EntityCollectionService;

            _product = DbPreTestDataWorker.MakeExistingProduct();
            _product.ProductOptions.Add(new ProductOption("Color"));
            _product.ProductOptions.First(x => x.Name == "Color").Choices.Add(new ProductAttribute("Black", "Blk"));
            _product.ProductOptions.First(x => x.Name == "Color").Choices.Add(new ProductAttribute("Blue", "Blu"));
            _product.ProductOptions.First(x => x.Name == "Color").Choices.Add(new ProductAttribute("Red", "Red"));
            _product.ProductOptions.First(x => x.Name == "Color").Choices.Add(new ProductAttribute("Green", "Gre"));
            _product.ProductOptions.Add(new ProductOption("Size"));
            _product.ProductOptions.First(x => x.Name == "Size").Choices.Add(new ProductAttribute("Small", "Sm"));
            _product.ProductOptions.First(x => x.Name == "Size").Choices.Add(new ProductAttribute("Medium", "M"));
            _product.ProductOptions.First(x => x.Name == "Size").Choices.Add(new ProductAttribute("Large", "Lg"));
            _product.ProductOptions.First(x => x.Name == "Size").Choices.Add(new ProductAttribute("X-Large", "XL"));
            _product.Height = 20;
            _product.Weight = 20;
            _product.Length = 20;
            _product.Width = 20;
            _product.Shippable = true;
            _productService.Save(_product);
        }
Exemplo n.º 21
0
 public ProductController(IUnitOfWork unitOfWork, ICategoryService categoryService, IProductService productService, IUserService userService)
 {
     this._unitOfWork = unitOfWork;
     this._categoryService = categoryService;
     this._productService = productService;
     this._userService = userService;
 }
 public CountingController(IUserService userService, IProductReviewService productReviewService, IProductService productService, ICartService cartService)
 {
     this.userService = userService;
     this.productReviewService = productReviewService;
     this.productService = productService;
     this.cartService = cartService;
 }
Exemplo n.º 23
0
 public ProductController(IProductService productService, 
     IProductTemplateService productTemplateService,
     ICategoryService categoryService, IManufacturerService manufacturerService,
     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, AdminAreaSettings adminAreaSettings)
 {
     this._productService = productService;
     this._productTemplateService = productTemplateService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     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._adminAreaSettings = adminAreaSettings;
 }
 public FrmBillOfMaterial()
 {
     _commonService = new CommonService();
     _billOfMaterial = new BillOfMaterialService();
     _productService = new ProductService();
     InitializeComponent();
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="httpContext">HTTP context</param>
 /// <param name="productService">Product service</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public RecentlyViewedProductsService(HttpContextBase httpContext, IProductService productService,
     CatalogSettings catalogSettings)
 {
     this._httpContext = httpContext;
     this._productService = productService;
     this._catalogSettings = catalogSettings;
 }
Exemplo n.º 26
0
 public CopyProductService(IProductService productService,
     IProductAttributeService productAttributeService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService,
     ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     ISpecificationAttributeService specificationAttributeService,
     IDownloadService downloadService,
     IProductAttributeParser productAttributeParser,
     IUrlRecordService urlRecordService, 
     IStoreMappingService storeMappingService)
 {
     this._productService = productService;
     this._productAttributeService = productAttributeService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._pictureService = pictureService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._specificationAttributeService = specificationAttributeService;
     this._downloadService = downloadService;
     this._productAttributeParser = productAttributeParser;
     this._urlRecordService = urlRecordService;
     this._storeMappingService = storeMappingService;
 }
Exemplo n.º 27
0
 public MainViewModel(INavigationService navigationService, IProductService productService)
     : base(navigationService)
 {
     _productService = productService;
     Title = "Caliburn Demo";
     Products = new BindableCollection<Product>(_productService.GetAll());
 }
 public CountingController()
 {
     this.userService = new UserService();
     this.productReviewService = new ProductReviewService();
     this.productService = new ProductService();
     this.cartService = new CartService();
 }
Exemplo n.º 29
0
        public ProductStockAdjustmentViewModel(IEventAggregator eventAggregator, IProductService productService)
        {
            EventAggregator = eventAggregator;
            ProductService = productService;

            DisplayName = "New Stock Adjustment";
        }
Exemplo n.º 30
0
 public DiscountController(IDiscountService discountService, 
     ILocalizationService localizationService,
     ICurrencyService currencyService,
     ICategoryService categoryService,
     IProductService productService,
     IWebHelper webHelper, 
     IDateTimeHelper dateTimeHelper,
     ICustomerActivityService customerActivityService, 
     CurrencySettings currencySettings,
     IPermissionService permissionService,
     IWorkContext workContext,
     IManufacturerService manufacturerService,
     IStoreService storeService,
     IVendorService vendorService,
     IOrderService orderService,
     IPriceFormatter priceFormatter)
 {
     this._discountService = discountService;
     this._localizationService = localizationService;
     this._currencyService = currencyService;
     this._categoryService = categoryService;
     this._productService = productService;
     this._webHelper = webHelper;
     this._dateTimeHelper = dateTimeHelper;
     this._customerActivityService = customerActivityService;
     this._currencySettings = currencySettings;
     this._permissionService = permissionService;
     this._workContext = workContext;
     this._manufacturerService = manufacturerService;
     this._storeService = storeService;
     this._vendorService = vendorService;
     this._orderService = orderService;
     this._priceFormatter = priceFormatter;
 }
Exemplo n.º 31
0
        public static IList <VendorReviewListModel> ToListModel(this IList <VendorReview> VendorReviews, IPictureService _pictureService, IProductService _productService, IVendorService _vendorService, ICustomerService _customerService)
        {
            var vrList = new List <VendorReviewListModel>();

            foreach (var vr in VendorReviews)
            {
                vrList.Add(vr.ToListModel(_pictureService, _productService, _vendorService, _customerService));
            }

            return(vrList);
        }
 public ProductsController(IProductService productService)
 {
     _productService = productService;
 }
Exemplo n.º 33
0
 public ProductController(IProductService productservice, IWebHostEnvironment webHostEnvironment, ILogger <ProductController> logger)
 {
     _productservice = productservice;
     _webHost        = webHostEnvironment;
     _logger         = logger;
 }
Exemplo n.º 34
0
 public HomeController(IProductService productService)
 {
     _productService = productService;
 }
Exemplo n.º 35
0
 public ProductController(IGroupService groupService, IProductService productService)
 {
     _groupService   = groupService;
     _productService = productService;
 }
        /// <summary>
        /// Gets a value indicating whether an order has items to deliver
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>A value indicating whether an order has items to deliver</returns>
        public static async Task<bool> HasItemsToDeliver(this Order order, 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 totalNumberOfShippedItems = await orderItem.GetTotalNumberOfShippedItems(order, shipmentService);
                var totalNumberOfDeliveredItems = await orderItem.GetTotalNumberOfDeliveredItems(order, shipmentService);
                if (totalNumberOfShippedItems <= totalNumberOfDeliveredItems)
                    continue;

                //yes, we have at least one item to deliver
                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;
        }
Exemplo n.º 38
0
        public void TestInitialize()
        {
            _productRepo = new MongoDBRepositoryTest <Product>();
            //dropdown list: adding 2 options "atributes" that can be selected via DropDownList
            pa1 = new ProductAttribute {
                Id   = "1",
                Name = "Color"
            };
            pam1_1 = new ProductAttributeMapping {
                Id                   = "11",
                ProductId            = "1",
                TextPrompt           = "Select color:",
                IsRequired           = true,
                AttributeControlType = AttributeControlType.DropdownList,
                DisplayOrder         = 1,
                ProductAttributeId   = pa1.Id
            };
            pav1_1 = new ProductAttributeValue {
                Id           = "11",
                Name         = "Green",
                DisplayOrder = 1,
                ProductAttributeMappingId = pam1_1.Id
            };
            pav1_2 = new ProductAttributeValue {
                Id           = "12",
                Name         = "Red",
                DisplayOrder = 2,
                ProductAttributeMappingId = pam1_1.Id
            };
            //adding colors (as product atributes)
            pam1_1.ProductAttributeValues.Add(pav1_1);
            pam1_1.ProductAttributeValues.Add(pav1_2);

            //checkboxes - adding 2 options that can be ticked via CheckBox'es
            pa2 = new ProductAttribute {
                Id   = "2",
                Name = "Some custom option",
            };
            pam2_1 = new ProductAttributeMapping {
                Id                   = "21",
                ProductId            = "1",
                TextPrompt           = "Select at least one option:",
                IsRequired           = true,
                AttributeControlType = AttributeControlType.Checkboxes,
                DisplayOrder         = 2,
                ProductAttributeId   = pa2.Id
            };
            pav2_1 = new ProductAttributeValue {
                Id           = "21",
                Name         = "Option 1",
                DisplayOrder = 1,
                ProductAttributeMappingId = pam2_1.Id
            };
            pav2_2 = new ProductAttributeValue {
                Id           = "22",
                Name         = "Option 2",
                DisplayOrder = 2,
                ProductAttributeMappingId = pam2_1.Id
            };
            pam2_1.ProductAttributeValues.Add(pav2_1);
            pam2_1.ProductAttributeValues.Add(pav2_2);

            //adds custom text (user can add its own text)
            pa3 = new ProductAttribute {
                Id   = "3",
                Name = "Custom text",
            };
            pam3_1 = new ProductAttributeMapping {
                Id                   = "31",
                ProductId            = "1",
                TextPrompt           = "Enter custom text:",
                IsRequired           = true,
                AttributeControlType = AttributeControlType.TextBox,
                DisplayOrder         = 1,
                ProductAttributeId   = pa3.Id
            };

            _product = new Product();
            _product.ProductAttributeMappings.Add(pam1_1);
            _product.ProductAttributeMappings.Add(pam2_1);
            _product.ProductAttributeMappings.Add(pam3_1);
            _productRepo.Insert(_product); //26 april

            var tempEventPublisher = new Mock <IMediator>();
            {
                //tempEventPublisher.Setup(x => x.Publish(It.IsAny<object>()));
                _eventPublisher = tempEventPublisher.Object;
            }

            var cacheManager = new TestMemoryCacheManager(new Mock <IMemoryCache>().Object, _eventPublisher);

            _productAttributeRepo = new Mock <IRepository <ProductAttribute> >().Object;

            _productAttributeService = new ProductAttributeService(cacheManager,
                                                                   _productAttributeRepo,
                                                                   _productRepo,
                                                                   _eventPublisher);
            _productAttributeParser  = new ProductAttributeParser();
            _priceCalculationService = new Mock <IPriceCalculationService>().Object;

            var tempWorkContext = new Mock <IWorkContext>();

            {
                var workingLanguage = new Language();
                tempWorkContext.Setup(x => x.WorkingLanguage).Returns(workingLanguage);
                _workContext = tempWorkContext.Object;
            }
            _currencyService = new Mock <ICurrencyService>().Object;
            var tempLocalizationService = new Mock <ILocalizationService>();

            {
                tempLocalizationService.Setup(x => x.GetResource("GiftCardAttribute.For.Virtual")).Returns("For: {0} <{1}>");
                tempLocalizationService.Setup(x => x.GetResource("GiftCardAttribute.From.Virtual")).Returns("From: {0} <{1}>");
                tempLocalizationService.Setup(x => x.GetResource("GiftCardAttribute.For.Physical")).Returns("For: {0}");
                tempLocalizationService.Setup(x => x.GetResource("GiftCardAttribute.From.Physical")).Returns("From: {0}");
                _localizationService = tempLocalizationService.Object;
            }

            _taxService           = new Mock <ITaxService>().Object;
            _priceFormatter       = new Mock <IPriceFormatter>().Object;
            _downloadService      = new Mock <IDownloadService>().Object;
            _webHelper            = new Mock <IWebHelper>().Object;
            _shoppingCartSettings = new Mock <ShoppingCartSettings>().Object;
            _productService       = new Mock <IProductService>().Object;

            _productAttributeFormatter = new ProductAttributeFormatter(_workContext,
                                                                       _productAttributeService,
                                                                       _productAttributeParser,
                                                                       _currencyService,
                                                                       _localizationService,
                                                                       _taxService,
                                                                       _priceFormatter,
                                                                       _downloadService,
                                                                       _webHelper,
                                                                       _priceCalculationService,
                                                                       _productService,
                                                                       _shoppingCartSettings);
        }
Exemplo n.º 39
0
 public ProductController(IProductService productService, IValidationHelper validationHelper)
 {
     _productService   = productService;
     _validationHelper = validationHelper;
 }
Exemplo n.º 40
0
        public static VendorReviewListModel ToListModel(this VendorReview Review, IPictureService _pictureService, IProductService _productService, IVendorService _vendorService, ICustomerService _customerService)
        {
            var Product  = _productService.GetProductById(Review.ProductId);
            var Vendor   = _vendorService.GetVendorById(Review.VendorId);
            var Customer = _customerService.GetCustomerById(Review.CustomerId);
            var model    = new VendorReviewListModel()
            {
                CreatedOnUTC        = Review.CreatedOnUTC,
                CustomerId          = Review.CustomerId,
                CustomerName        = Customer.GetFullName(),
                HelpfulnessNoTotal  = Review.HelpfulnessNoTotal,
                HelpfulnessYesTotal = Review.HelpfulnessYesTotal,
                Id                    = Review.Id,
                IsApproved            = Review.IsApproved,
                ProductId             = Review.ProductId,
                Rating                = Review.Rating,
                ReviewText            = Review.ReviewText,
                Title                 = Review.Title,
                VendorId              = Review.VendorId,
                OrderId               = Review.OrderId,
                CertifiedBuyerReview  = Review.CertifiedBuyerReview,
                DisplayCertifiedBadge = Review.DisplayCertifiedBadge,
            };

            if (Product != null)
            {
                model.ProductName     = Product.Name;
                model.ProductSeName   = Product.GetSeName();
                model.ProductImageUrl = _pictureService.GetPictureUrl(Product.ProductPictures.FirstOrDefault().Picture);
            }
            if (Vendor != null)
            {
                model.VendorName   = Vendor.Name;
                model.VendorSeName = Vendor.GetSeName();
            }

            return(model);
        }
Exemplo n.º 41
0
 public HomeController(ILogger <HomeController> logger, IProductService productService, IUnitofWork unitofWork)
 {
     _logger         = logger;
     _productService = productService;
     _unitofWork     = unitofWork;
 }
Exemplo n.º 42
0
 public ProductController(IProductService productService, IProductCategoryService productCategoryService)
 {
     _productService         = productService;
     _productCategoryService = productCategoryService;
 }
Exemplo n.º 43
0
 public CatalogController(IProductService productService)
 {
     _productService = productService;
 }
Exemplo n.º 44
0
 public ProductsController(IProductService products)
 {
     this.products = products;
 }
Exemplo n.º 45
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)
 {
     this._shipmentViewModelService = shipmentViewModelService;
     this._orderService             = orderService;
     this._orderProcessingService   = orderProcessingService;
     this._localizationService      = localizationService;
     this._workContext               = workContext;
     this._measureService            = measureService;
     this._pdfService                = pdfService;
     this._productService            = productService;
     this._exportManager             = exportManager;
     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._taxService                = taxService;
     this._returnRequestService      = returnRequestService;
     this._customerActivityService   = customerActivityService;
     this._currencySettings          = currencySettings;
     this._taxSettings               = taxSettings;
     this._measureSettings           = measureSettings;
     this._addressSettings           = addressSettings;
     this._shippingSettings          = shippingSettings;
     this._customerService           = customerService;
     this._mediaSettings             = mediaSettings;
 }
Exemplo n.º 46
0
 public HomeController(ILogger <HomeController> logger, IProductService productService)
 {
     _logger         = logger;
     _productService = productService;
 }
Exemplo n.º 47
0
 public ProductController(IErrorService errorService, IProductService productService)
     : base(errorService)
 {
     this._productService = productService;
 }
 public SalesController(ISaleProcessService saleProcessService, IEmployeeService employeeService, ICustomerService customerService, IProductService productService)
 {
     _saleProcessService = saleProcessService;
     _customerService    = customerService;
     _employeeService    = employeeService;
     _productService     = productService;
 }
Exemplo n.º 49
0
 public ManufacturerController(ICategoryService categoryService, IManufacturerService manufacturerService,
                               IManufacturerTemplateService manufacturerTemplateService, IProductService productService,
                               ICustomerService customerService, IStoreService storeService,
                               IStoreMappingService storeMappingService,
                               IUrlRecordService urlRecordService, IPictureService pictureService,
                               ILanguageService languageService, ILocalizationService localizationService,
                               ILocalizedEntityService localizedEntityService, IExportManager exportManager,
                               ICustomerActivityService customerActivityService, IVendorService vendorService,
                               IAclService aclService, IPermissionService permissionService,
                               AdminAreaSettings adminAreaSettings, CatalogSettings catalogSettings)
 {
     this._categoryService             = categoryService;
     this._manufacturerTemplateService = manufacturerTemplateService;
     this._manufacturerService         = manufacturerService;
     this._productService          = productService;
     this._customerService         = customerService;
     this._storeService            = storeService;
     this._storeMappingService     = storeMappingService;
     this._urlRecordService        = urlRecordService;
     this._pictureService          = pictureService;
     this._languageService         = languageService;
     this._localizationService     = localizationService;
     this._localizedEntityService  = localizedEntityService;
     this._exportManager           = exportManager;
     this._customerActivityService = customerActivityService;
     this._vendorService           = vendorService;
     this._aclService        = aclService;
     this._permissionService = permissionService;
     this._adminAreaSettings = adminAreaSettings;
     this._catalogSettings   = catalogSettings;
 }
Exemplo n.º 50
0
        public UnitTest1()
        {
            IProductService servicee = (IProductService)service;

            _controller = new ProductsController(context, servicee);
        }
Exemplo n.º 51
0
 /// <summary>
 /// The product service on deleted.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="deleteEventArgs">
 /// The delete event args.
 /// </param>
 protected void ProductServiceOnDeleted(IProductService sender, DeleteEventArgs <IProduct> deleteEventArgs)
 {
     ClearCache();
 }
Exemplo n.º 52
0
        public ExchangeBillPageViewModel(INavigationService navigationService,
                                         IExchangeBillService exchangeBillService,
                                         IProductService productService,
                                         IUserService userService,
                                         ITerminalService terminalService,
                                         IWareHousesService wareHousesService,
                                         IAccountingService accountingService,
                                         IMicrophoneService microphoneService,
                                         ISaleBillService saleBillService,
                                         //IMapper mapper,
                                         IDialogService dialogService
                                         ) : base(navigationService,
                                                  productService, terminalService,
                                                  userService, wareHousesService,
                                                  accountingService, dialogService)
        {
            Title = "换货单";

            _saleBillService     = saleBillService;
            _exchangeBillService = exchangeBillService;
            _microphoneService   = microphoneService;
            //_mapper = mapper;

            InitBill();

            #region //配送日期指定
            var weekDays  = new List <WeekDay>();
            var startTime = DateTime.Now;
            var endTime   = DateTime.Now.AddDays(7);
            while (endTime.Subtract(startTime).Days > 0)
            {
                var wd = new WeekDay
                {
                    Wname           = $"{startTime:MM-dd} - {GlobalSettings.GetWeek(startTime.DayOfWeek.ToString())}",
                    Date            = startTime,
                    AMTimeRange     = $"09:00-12:00",
                    PMTimeRange     = $"15:00-21:00",
                    SelectedCommand = ReactiveCommand.Create <WeekDay>(r =>
                    {
                        this.WeekDays.ForEach(s => { s.Selected = false; });
                        r.Selected       = !r.Selected;
                        this.DeliverDate = r;
                        this.AMTimeRange = r.AMTimeRange;
                        this.PMTimeRange = r.PMTimeRange;
                    })
                };
                weekDays.Add(wd);
                startTime = startTime.AddDays(1);
            }
            var defaultWd = weekDays.FirstOrDefault();
            if (defaultWd != null)
            {
                defaultWd.Selected = true;
                this.AMTimeRange   = defaultWd.AMTimeRange;
                this.PMTimeRange   = defaultWd.PMTimeRange;
            }
            this.WeekDays = new ObservableCollection <WeekDay>(weekDays);

            #endregion

            //验证
            var valid_IsReversed     = this.ValidationRule(x => x.Bill.ReversedStatus, _isBool, "已红冲单据不能操作");
            var valid_IsAudited      = this.ValidationRule(x => x.Bill.AuditedStatus, _isBool, "已审核单据不能操作");
            var valid_TerminalId     = this.ValidationRule(x => x.Bill.TerminalId, _isZero, "客户未指定");
            var valid_BusinessUserId = this.ValidationRule(x => x.Bill.DeliveryUserId, _isZero, "配送员未指定");
            var valid_WareHouseId    = this.ValidationRule(x => x.Bill.WareHouseId, _isZero, "仓库未指定");
            var valid_ProductCount   = this.ValidationRule(x => x.Bill.Items.Count, _isZero, "请添加商品项目");

            //添加商品
            this.AddProductCommand = ReactiveCommand.Create <object>(async e =>
            {
                if (this.Bill.AuditedStatus && !this.ReferencePage.Equals("UnDeliveryPage"))
                {
                    _dialogService.ShortAlert("已审核单据不能操作");
                    return;
                }

                if (!valid_TerminalId.IsValid)
                {
                    _dialogService.ShortAlert(valid_TerminalId.Message[0]);
                    ((ICommand)CustomSelected)?.Execute(null);
                    return;
                }

                if (!valid_WareHouseId.IsValid)
                {
                    _dialogService.ShortAlert(valid_WareHouseId.Message[0]);
                    ((ICommand)StockSelected)?.Execute(null);
                    return;
                }

                if (!valid_BusinessUserId.IsValid)
                {
                    _dialogService.ShortAlert(valid_BusinessUserId.Message[0]);
                    ((ICommand)DeliverSelected)?.Execute(null);
                    return;
                }

                //转向商品选择
                await this.NavigateAsync("SelectProductPage", ("Reference", this.PageName),
                                         ("WareHouse", WareHouse),
                                         ("TerminalId", Bill.TerminalId),
                                         ("Terminaler", this.Terminal),
                                         ("SerchKey", Filter.SerchKey));
            });

            //编辑商品
            this.WhenAnyValue(x => x.Selecter).Throttle(TimeSpan.FromMilliseconds(500))
            .Skip(1)
            .Where(x => x != null)
            .SubOnMainThread(async item =>
            {
                if (this.Bill.ReversedStatus)
                {
                    _dialogService.ShortAlert("已红冲单据不能操作");
                    return;
                }

                if (this.Bill.AuditedStatus)
                {
                    _dialogService.ShortAlert("已审核单据不能操作");
                    return;
                }

                if (this.Bill.IsSubmitBill)
                {
                    _dialogService.ShortAlert("已提交的单据不能编辑");
                    return;
                }

                if (item != null)
                {
                    var product = ProductSeries.Select(p => p).Where(p => p.Id == item.ProductId).FirstOrDefault();
                    if (product != null)
                    {
                        product.UnitId   = item.UnitId;
                        product.Quantity = item.Quantity;
                        product.Price    = item.Price;
                        product.Amount   = item.Amount;
                        product.Remark   = item.Remark;
                        product.Subtotal = item.Subtotal;
                        product.UnitName = item.UnitName;

                        if (item.BigUnitId > 0)
                        {
                            product.bigOption.Name        = item.UnitName;
                            product.BigPriceUnit.Quantity = item.Quantity;
                            product.BigPriceUnit.UnitId   = item.BigUnitId;
                            product.BigPriceUnit.Amount   = item.Amount;
                            product.BigPriceUnit.Remark   = item.Remark;
                        }

                        if (item.SmallUnitId > 0)
                        {
                            product.bigOption.Name          = item.UnitName;
                            product.SmallPriceUnit.Quantity = item.Quantity;
                            product.SmallPriceUnit.UnitId   = item.SmallUnitId;
                            product.SmallPriceUnit.Amount   = item.Amount;
                            product.SmallPriceUnit.Remark   = item.Remark;
                        }

                        await this.NavigateAsync("EditProductPage", ("Product", product), ("Reference", PageName), ("Item", item), ("WareHouse", WareHouse));
                    }
                }

                this.Selecter = null;
            })
            .DisposeWith(DeactivateWith);

            //提交表单
            this.SubmitDataCommand = ReactiveCommand.CreateFromTask <object, Unit>(async _ =>
            {
                return(await this.Access(AccessGranularityEnum.ExchangeBillsSave, async() =>
                {
                    if (this.Bill.ReversedStatus)
                    {
                        _dialogService.ShortAlert("已红冲单据不能操作");
                        return Unit.Default;
                    }

                    if (this.Bill.AuditedStatus || DispatchItem != null)
                    {
                        _dialogService.ShortAlert("已审核单据不能操作");
                        return Unit.Default;
                    }

                    //结算方式
                    Bill.PayTypeId = 0;
                    Bill.PayTypeName = "";

                    if (Bill.BusinessUserId == 0)
                    {
                        Bill.BusinessUserId = Settings.UserId;
                    }

                    var postMData = new ExchangeBillUpdateModel()
                    {
                        BillNumber = this.Bill.BillNumber,
                        //客户
                        TerminalId = Bill.TerminalId,
                        //业务员
                        BusinessUserId = Bill.BusinessUserId,
                        //送货员
                        DeliveryUserId = Bill.DeliveryUserId,
                        //仓库
                        WareHouseId = Bill.WareHouseId,
                        //交易日期
                        TransactionDate = DateTime.Now,
                        //默认售价方式
                        DefaultAmountId = Settings.DefaultPricePlan,
                        //备注
                        Remark = Bill.Remark,
                        //优惠金额
                        PreferentialAmount = 0,
                        //优惠后金额
                        PreferentialEndAmount = 0,
                        //欠款金额
                        OweCash = 0,
                        //商品项目
                        Items = Bill.Items,
                        //收款账户
                        //预收款
                        AdvanceAmount = 0,
                        //预收款余额
                        AdvanceAmountBalance = 0,
                        //配送时间
                        DeliverDate = this.DeliverDate?.Date ?? DateTime.Now,
                        AMTimeRange = this.DeliverDate?.AMTimeRange,
                        PMTimeRange = this.DeliverDate?.PMTimeRange
                    };


                    return await SubmitAsync(postMData, Bill.Id, _exchangeBillService.CreateOrUpdateAsync, async(result) =>
                    {
                        BillId = result.Code;
                        //清空单据
                        Bill = new ExchangeBillModel();


                        if (IsVisit) //拜访时开单
                        {
                            //转向拜访界面
                            await this.NavigateAsync("VisitStorePage", ("BillTypeId", BillTypeEnum.ExchangeBill),
                                                     ("BillId", BillId),
                                                     ("Amount", Bill.SumAmount));
                        }
                    }, !IsVisit, token: new System.Threading.CancellationToken());
                }));
            },
Exemplo n.º 53
0
 public ProductController(IProductService productService, ILoggingService loggingService)
 {
     _productService = productService;
     _loggingService = loggingService;
 }
Exemplo n.º 54
0
 /// <summary>
 /// The product service on saved.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="saveEventArgs">
 /// The save event args.
 /// </param>
 protected void ProductServiceOnSaved(IProductService sender, SaveEventArgs <IProduct> saveEventArgs)
 {
     ClearCache();
 }
Exemplo n.º 55
0
 public LoginController(IOrderService orderService, IProductService productService)
 {
     this.orderService   = orderService;
     this.productService = productService;
 }
Exemplo n.º 56
0
 public ProductServiceTest()
 {
     _productService = MockProductService();
 }
Exemplo n.º 57
0
 public void SetUp()
 {
     BrEngineContext.Init(null);
     this._productService = BrEngineContext.Current.Resolve <IProductService>();
     this._databaseDb     = BrEngineContext.Current.Resolve <IDatabaseHelper>().Db;
 }
Exemplo n.º 58
0
 public OrderService(IRepository <Order> orderRepository, IProductService productService)
 {
     this._orderRepository = orderRepository;
     this._productService  = productService;
 }
Exemplo n.º 59
0
 public MenuController(IMenuService menuService, IProductService productService)
 {
     _menuService    = menuService;
     _productService = productService;
 }
Exemplo n.º 60
0
        public void TestInitialize()
        {
            new Grand.Services.Tests.ServiceTest().PluginInitializator();

            _workContext          = new Mock <IWorkContext>().Object;
            _stateProvinceService = new Mock <IStateProvinceService>().Object;

            _store = new Store {
                Id = "1"
            };
            var tempStoreContext = new Mock <IStoreContext>();

            {
                tempStoreContext.Setup(x => x.CurrentStore).Returns(_store);
                _storeContext = tempStoreContext.Object;
            }

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

            var pluginFinder = new PluginFinder(_serviceProvider);
            var cacheManager = new TestMemoryCacheManager(new Mock <IMemoryCache>().Object);

            _discountService        = new Mock <IDiscountService>().Object;
            _categoryService        = new Mock <ICategoryService>().Object;
            _manufacturerService    = new Mock <IManufacturerService>().Object;
            _productAttributeParser = new Mock <IProductAttributeParser>().Object;
            _vendorService          = new Mock <IVendorService>().Object;
            _currencyService        = new Mock <ICurrencyService>().Object;
            _serviceProvider        = new Mock <IServiceProvider>().Object;

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();
            _customerService      = new Mock <ICustomerService>().Object;

            _priceCalcService = new PriceCalculationService(_workContext, _storeContext,
                                                            _discountService, _categoryService,
                                                            _manufacturerService, _productAttributeParser, _productService, _customerService,
                                                            cacheManager, _vendorService, _currencyService,
                                                            _shoppingCartSettings, _catalogSettings);

            var tempEventPublisher = new Mock <IMediator>();

            {
                //tempEventPublisher.Setup(x => x.PublishAsync(It.IsAny<object>()));
                _eventPublisher = tempEventPublisher.Object;
            }

            _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();
            _paymentService          = new Mock <IPaymentService>().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();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = "10";

            _shippingService = new ShippingService(_shippingMethodRepository,
                                                   _deliveryDateRepository,
                                                   _warehouseRepository,
                                                   null,
                                                   _logger,
                                                   _productService,
                                                   _productAttributeParser,
                                                   _checkoutAttributeParser,
                                                   _localizationService,
                                                   _addressService,
                                                   _countryService,
                                                   _stateProvinceService,
                                                   pluginFinder,
                                                   _storeContext,
                                                   _eventPublisher,
                                                   _currencyService,
                                                   cacheManager,
                                                   null,
                                                   _shoppingCartSettings,
                                                   _shippingSettings);



            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, _taxSettings,
                                         pluginFinder, _geoLookupService, _countryService, _serviceProvider, _logger, _customerSettings, _addressSettings);

            _rewardPointsSettings = new RewardPointsSettings();

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