本文整理汇总了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);
}
示例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");
}
示例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);
}
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例11: DeleteStore
public void DeleteStore(Store store) {
throw new NotImplementedException();
}
示例12: InsertStore
public void InsertStore(Store store) {
throw new NotImplementedException();
}
示例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);
}
示例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);
}
示例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));
}