Example #1
0
        private void AddLanguageChildItems(MenuItem parent, Language lang, ICommerceDatabase database)
        {
            var culture = CultureInfo.GetCultureInfo(lang.Name);

            AddLanguageChildItem <Brand>(parent, culture, "Brands", "Brand", database.Repository <Brand>().Query());
            AddLanguageChildItem <Category>(parent, culture, "Categories", "Category", database.Repository <Category>().Query());
            AddLanguageChildItem <Product>(parent, culture, "Products", "Product", database.Repository <Product>().Query());
            AddLanguageChildItem <ProductType>(parent, culture, "Product types", "ProductType", database.Repository <ProductType>().Query());
        }
Example #2
0
 public static void Delete <T>(this ICommerceDatabase database, T entity)
     where T : class
 {
     database.Repository <T>().Delete(entity);
 }
Example #3
0
 public static void Insert <T>(this ICommerceDatabase database, T entity)
     where T : class
 {
     database.Repository <T>().Insert(entity);
 }
Example #4
0
 public static IQueryable <T> Query <T>(this ICommerceDatabase database)
     where T : class
 {
     return(database.Repository <T>().Query());
 }
Example #5
0
 public static T Find <T>(this ICommerceDatabase database, params object[] ids)
     where T : class
 {
     return(database.Repository <T>().Find(ids));
 }
 public PredefinedCustomFieldService(ICommerceDatabase database)
 {
     _repository = database.Repository<CustomFieldDefinition>();
 }
Example #7
0
 public SettingService(ICommerceDatabase database)
 {
     _repository = database.Repository <SettingItem>();
 }
Example #8
0
 public CountryService(ICommerceDatabase database)
 {
     _countryRepository = database.Repository<Country>();
 }
Example #9
0
 public CountryService(ICommerceDatabase database)
 {
     _countryRepository = database.Repository <Country>();
 }
Example #10
0
 public Product Find(int id)
 {
     return(_database.Repository <Product>().Find(id));
 }
 public PredefinedCustomFieldService(ICommerceDatabase database)
 {
     _repository = database.Repository <CustomFieldDefinition>();
 }
        private Customer GetCustomer(IOrderEvent @event)
        {
            var order = _database.Repository <Order>().Find(@event.OrderId);

            return(order == null ? null : order.Customer);
        }