当前位置: 首页>>代码示例>>C#>>正文


C# Stores.Store类代码示例

本文整理汇总了C#中Nop.Core.Domain.Stores.Store的典型用法代码示例。如果您正苦于以下问题:C# Store类的具体用法?C# Store怎么用?C# Store使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Store类属于Nop.Core.Domain.Stores命名空间,在下文中一共展示了Store类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public new void SetUp()
        {
            _workContext = null;

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

            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _productService = MockRepository.GenerateMock<IProductService>();


            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();

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

            _cacheManager = new NopNullCache();

            _priceCalcService = new PriceCalculationService(_workContext,
                _storeContext, 
                _discountService,
                _categoryService,
                _productAttributeParser,
                _productService,
                _cacheManager,
                _shoppingCartSettings, 
                _catalogSettings);
        }
开发者ID:minuzZ,项目名称:zelectroshop,代码行数:30,代码来源:PriceCalculationServiceTests.cs

示例2: Can_save_and_load_store

        public void Can_save_and_load_store()
        {
            var store = new Store
            {
                Name = "Computer store",
                Url = "http://www.yourStore.com",
                Hosts = "yourStore.com,www.yourStore.com",
                DefaultLanguageId = 1,
                DisplayOrder = 2,
                CompanyName = "company name",
                CompanyAddress = "some address",
                CompanyPhoneNumber = "123456789",
                CompanyVat = "some vat",
            };

            var fromDb = SaveAndLoadEntity(store);
            fromDb.ShouldNotBeNull();
            fromDb.Name.ShouldEqual("Computer store");
            fromDb.Url.ShouldEqual("http://www.yourStore.com");
            fromDb.Hosts.ShouldEqual("yourStore.com,www.yourStore.com");
            fromDb.DefaultLanguageId.ShouldEqual(1);
            fromDb.DisplayOrder.ShouldEqual(2);
            fromDb.CompanyName.ShouldEqual("company name");
            fromDb.CompanyAddress.ShouldEqual("some address");
            fromDb.CompanyPhoneNumber.ShouldEqual("123456789");
            fromDb.CompanyVat.ShouldEqual("some vat");
        }
开发者ID:491134648,项目名称:nopCommerce,代码行数:27,代码来源:StorePersistenceTests.cs

示例3: UpdateAttributeLocales

 protected virtual void UpdateAttributeLocales(Store store, StoreModel model)
 {
     foreach (var localized in model.Locales)
     {
         _localizedEntityService.SaveLocalizedValue(store,
             x => x.Name,
             localized.Name,
             localized.LanguageId);
     }
 }
开发者ID:RobinHoody,项目名称:nopCommerce,代码行数:10,代码来源:StoreController.cs

示例4: Can_parse_host_values

        public void Can_parse_host_values()
        {
            var store = new Store()
            {
                Hosts = "yourstore.com, www.yourstore.com, "
            };

            var hosts = store.ParseHostValues();
            hosts.Length.ShouldEqual(2);
            hosts[0].ShouldEqual("yourstore.com");
            hosts[1].ShouldEqual("www.yourstore.com");
        }
开发者ID:emretiryaki,项目名称:paymill-nopcommerce,代码行数:12,代码来源:StoreExtensionsTests.cs

示例5: setStore

        public static void setStore(this Vendor vendor, Store store)
        {
            var _vendorStoreRepository = EngineContext.Current.Resolve<IRepository<VendorStore>>();
            var _storeRepository = EngineContext.Current.Resolve<IRepository<Store>>();

            var vendorStore = new VendorStore
            {
                StoreId = store.Id,
                VendorId = vendor.Id
            };

            _vendorStoreRepository.Insert(vendorStore);
        }
开发者ID:mhsohail,项目名称:Livetameion_3.7,代码行数:13,代码来源:VendorExtensions.cs

示例6: Can_find_host_value

        public void Can_find_host_value()
        {
            var store = new Store()
            {
                Hosts = "yourstore.com, www.yourstore.com, "
            };

            store.ContainsHostValue(null).ShouldEqual(false);
            store.ContainsHostValue("").ShouldEqual(false);
            store.ContainsHostValue("store.com").ShouldEqual(false);
            store.ContainsHostValue("yourstore.com").ShouldEqual(true);
            store.ContainsHostValue("yoursTore.com").ShouldEqual(true);
            store.ContainsHostValue("www.yourstore.com").ShouldEqual(true);
        }
开发者ID:emretiryaki,项目名称:paymill-nopcommerce,代码行数:14,代码来源:StoreExtensionsTests.cs

示例7: DeleteStore

        /// <summary>
        /// Deletes a store
        /// </summary>
        /// <param name="store">Store</param>
        public virtual void DeleteStore(Store store)
        {
            if (store == null)
                throw new ArgumentNullException("store");

            var allStores = GetAllStores();
            if (allStores.Count == 1)
                throw new Exception("You cannot delete the only configured store");

            _storeRepository.Delete(store);

            _cacheManager.RemoveByPattern(STORES_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityDeleted(store);
        }
开发者ID:haithemChkel,项目名称:nopCommerce_33,代码行数:20,代码来源:StoreService.cs

示例8: SetUp

        public new void SetUp()
        {
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");

            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _deliveryDateRepository = MockRepository.GenerateMock<IRepository<DeliveryDate>>();
            _warehouseRepository = MockRepository.GenerateMock<IRepository<Warehouse>>();
            _logger = new NullLogger();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();

            var cacheManager = new NopNullCache();

            var pluginFinder = new PluginFinder();
            _productService = MockRepository.GenerateMock<IProductService>();

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

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();
            _addressService = MockRepository.GenerateMock<IAddressService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

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

            _shoppingCartSettings = new ShoppingCartSettings();
            _shippingService = new ShippingService(_shippingMethodRepository,
                _deliveryDateRepository,
                _warehouseRepository,
                _logger,
                _productService,
                _productAttributeParser,
                _checkoutAttributeParser,
                _genericAttributeService,
                _localizationService,
                _addressService,
                _shippingSettings, 
                pluginFinder,
                _storeContext,
                _eventPublisher,
                _shoppingCartSettings,
                cacheManager);
        }
开发者ID:nvolpe,项目名称:raver,代码行数:47,代码来源:ShippingServiceTests.cs

示例9: Can_save_and_load_store

        public void Can_save_and_load_store()
        {
            var store = new Store
            {
                Name = "Computer store",
                Url = "http://www.yourStore.com",
                Hosts = "yourStore.com,www.yourStore.com",
                DisplayOrder = 1
            };

            var fromDb = SaveAndLoadEntity(store);
            fromDb.ShouldNotBeNull();
            fromDb.Name.ShouldEqual("Computer store");
            fromDb.Url.ShouldEqual("http://www.yourStore.com");
            fromDb.Hosts.ShouldEqual("yourStore.com,www.yourStore.com");
            fromDb.DisplayOrder.ShouldEqual(1);
        }
开发者ID:minuzZ,项目名称:zelectroshop,代码行数:17,代码来源:StorePersistenceTests.cs

示例10: SetUp

        public new void SetUp()
        {
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
            _settingService = MockRepository.GenerateMock<ISettingService>();

            _workContext = MockRepository.GenerateMock<IWorkContext>();

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

            _dateTimeSettings = new DateTimeSettings
            {
                AllowCustomersToSetTimeZone = false,
                DefaultStoreTimeZoneId = ""
            };

            _dateTimeHelper = new DateTimeHelper(_workContext, _genericAttributeService,
                _settingService, _dateTimeSettings);
        }
开发者ID:nvolpe,项目名称:raver,代码行数:20,代码来源:DateTimeHelperTests.cs

示例11: DeleteStore

 public void DeleteStore(Store store) {
     throw new NotImplementedException();
 }
开发者ID:jasonholloway,项目名称:brigita,代码行数:3,代码来源:BrigitaStores.cs

示例12: InsertStore

 public void InsertStore(Store store) {
     throw new NotImplementedException();
 }
开发者ID:jasonholloway,项目名称:brigita,代码行数:3,代码来源:BrigitaStores.cs

示例13: AddStoreTokens

        public virtual void AddStoreTokens(IList<Token> tokens, Store store, EmailAccount emailAccount)
        {
            if (emailAccount == null)
                throw new ArgumentNullException("emailAccount");

            tokens.Add(new Token("Store.Name", store.GetLocalized(x => x.Name)));
            tokens.Add(new Token("Store.URL", store.Url, true));
            tokens.Add(new Token("Store.Email", emailAccount.Email));
            tokens.Add(new Token("Store.CompanyName", store.CompanyName));
            tokens.Add(new Token("Store.CompanyAddress", store.CompanyAddress));
            tokens.Add(new Token("Store.CompanyPhoneNumber", store.CompanyPhoneNumber));
            tokens.Add(new Token("Store.CompanyVat", store.CompanyVat));

            //event notification
            _eventPublisher.EntityTokensAdded(store, tokens);
        }
开发者ID:jianghaihui,项目名称:nopCommerce,代码行数:16,代码来源:MessageTokenProvider.cs

示例14: UpdateStore

        /// <summary>
        /// Updates the store
        /// </summary>
        /// <param name="store">Store</param>
        public virtual void UpdateStore(Store store)
        {
            if (store == null)
                throw new ArgumentNullException("store");

            _storeRepository.Update(store);

            _cacheManager.RemoveByPattern(STORES_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityUpdated(store);
        }
开发者ID:haithemChkel,项目名称:nopCommerce_33,代码行数:16,代码来源:StoreService.cs

示例15: AddStoreTokens

 public virtual void AddStoreTokens(IList<Token> tokens, Store store)
 {
     tokens.Add(new Token("Store.Name", store.Name));
     tokens.Add(new Token("Store.URL", store.Url, true));
     var defaultEmailAccount = _emailAccountService.GetEmailAccountById(_emailAccountSettings.DefaultEmailAccountId);
     if (defaultEmailAccount == null)
         defaultEmailAccount = _emailAccountService.GetAllEmailAccounts().FirstOrDefault();
     tokens.Add(new Token("Store.Email", defaultEmailAccount.Email));
 }
开发者ID:kramerica-industries,项目名称:KramericaFramework,代码行数:9,代码来源:MessageTokenProvider.cs


注:本文中的Nop.Core.Domain.Stores.Store类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。