Esempio n. 1
0
 public ShippingZoneService(DataContext db, ICountryService countryService, IRegionService regionService, IShippingMethodService shippingMethodService)
 {
     this.db = db;
     this.countryService = countryService;
     this.regionService = regionService;
     this.shippingMethodService = shippingMethodService;
 }
Esempio n. 2
0
 public TaxZoneService(DataContext db, ITaxRateService taxRateService, ICountryService countryService, IRegionService  regionService)
 {
     this.db = db;
     this.taxRateService = taxRateService;
     this.countryService = countryService;
     this.regionService = regionService;
 }
        public static void ImportTranslationsCsv(DataContext db, CsvReader csv, TranslationArea area)
        {
            while (csv.Read())
            {
                var code = csv.GetField<string>(0);
                var key = csv.GetField<string>(1);
                var value = csv.GetField<string>(2);

                // ToList is called on purpose for case sensitive search
                var translation =
                    db.Translations.ToList().FirstOrDefault(
                        t => t.LanguageCode == code && t.Key == key && t.Area == area);

                if (translation == null)
                {
                    translation = new Translation
                                  {
                                      LanguageCode = code,
                                      Key = key,
                                      Value = value,
                                      Area = area
                                  };
                    db.Translations.Add(translation);
                }
                else
                {
                    translation.Value = value;
                }
            }

            db.SaveChanges();

            TranslationHelper.ClearCache();
        }
 public PageTemplateController(DataContext db, ISettingService settingService, 
     ITemplateSettingService templateSettingService)
     : base(db)
 {
     this.settingService = settingService;
     this.templateSettingService = templateSettingService;
 }
Esempio n. 5
0
 public CategoryDeleter(DataContext db, ICategoryService categoryService,
     IDeleterService deleterService, ICacheService cacheService)
 {
     this.db = db;
     this.categoryService = categoryService;
     this.deleterService = deleterService;
     this.cacheService = cacheService;
 }
 public DataImportController(DataContext db, ICategoryService categoryService,
     IProductFinder productFinder, IProductService productService)
     : base(db)
 {
     this.categoryService = categoryService;
     this.productFinder = productFinder;
     this.productService = productService;
 }
Esempio n. 7
0
 public ProductService(DataContext db, IProductFinder productFinder, ICategoryService categoryService,
     IProductSkuService productSkuService, ICacheService cacheService)
 {
     this.db = db;
     this.productFinder = productFinder;
     this.categoryService = categoryService;
     this.productSkuService = productSkuService;
     this.cacheService = cacheService;
 }
Esempio n. 8
0
        public DataExportService()
        {
            // Not using structuremap as dependencies are being disposed too early

            db = DataContext.Create();
            categoryService = new CategoryService(db, null, new CacheService());
            productFinder = new ProductFinder(db, categoryService);
            workProcessService = new WorkProcessService(db);
        }
Esempio n. 9
0
 public ProductController(DataContext db, IProductFinder productFinder, IDeleterService deleterService,
     IProductService productService, ITaxClassService taxClassService, ISettingService settingService)
     : base(db)
 {
     this.productFinder = productFinder;
     this.deleterService = deleterService;
     this.productService = productService;
     this.taxClassService = taxClassService;
     this.settingService = settingService;
 }
 public ShoppingCartController(DataContext db, ICurrentUser currentUser, ISettingService settings,
     ITaxZoneService taxZoneService, ICustomerService customerService, ITaxRateService taxRateService,
     IShippingService shippingService, IProductSkuService productSkuService, IProductService productService) : base(db, currentUser)
 {
     this.settings = settings;
     this.taxZoneService = taxZoneService;
     this.customerService = customerService;
     this.taxRateService = taxRateService;
     this.shippingService = shippingService;
     this.productSkuService = productSkuService;
     this.productService = productService;
 }
Esempio n. 11
0
 public OrderController(DataContext db, ICustomerService customerService, IProductFinder productFinder,
     IShippingService shippingService, ITaxService taxService, ISettingService settingService,
     IOrderService orderService, IOptionService optionService)
     : base(db)
 {
     this.customerService = customerService;
     this.productFinder = productFinder;
     this.shippingService = shippingService;
     this.taxService = taxService;
     this.settingService = settingService;
     this.orderService = orderService;
     this.optionService = optionService;
 }
Esempio n. 12
0
        public OperatorService(DataContext db, IUserStore<User> userStore, IRoleStore<IdentityRole, string> roleStore)
        {
            this.db = db;
            userManager = new UserManager<User>(userStore);
            roleManager = new RoleManager<IdentityRole>(roleStore);

            if (_operatorRoleId == null)
            {
                lock (padlock)
                {
                    if (_operatorRoleId == null)
                    {
                        // ReSharper disable PossibleMultipleWriteAccessInDoubleCheckLocking
                        _operatorRoleId = roleManager.FindByName(User.OPERATOR_ROLE).Id;
                        // ReSharper restore PossibleMultipleWriteAccessInDoubleCheckLocking
                    }
                }
            }
        }
Esempio n. 13
0
        public CustomerService(DataContext db, IUserStore<User> userStore, IRoleStore<IdentityRole, string> roleStore,IDeleterService deleteService)
        {
            this.db = db;
            this.deleteService = deleteService;
            userManager = new UserManager<User>(userStore);

            if (_customerRoleID == null)
            {
                lock (padlock)
                {
                    if (_customerRoleID == null)
                    {
                        var roleManager = new RoleManager<IdentityRole>(roleStore);
                        // ReSharper disable PossibleMultipleWriteAccessInDoubleCheckLocking
                        _customerRoleID = roleManager.FindByName(User.CUSTOMER_ROLE).Id;
                        // ReSharper restore PossibleMultipleWriteAccessInDoubleCheckLocking
                    }
                }
            }
        }
Esempio n. 14
0
 public ProductFinder(DataContext db, ICategoryService categoryService)
 {
     this.db = db;
     this.categoryService = categoryService;
 }
Esempio n. 15
0
 public OrderService(DataContext db)
 {
     this.db = db;
 }
 public BlogPostCommentService(DataContext db)
 {
     this.db = db;
 }
Esempio n. 17
0
 public SettingController(DataContext db, ISettingService settings)
     : base(db)
 {
     this.settings = settings;
 }
Esempio n. 18
0
 public PaymentHelper(DataContext db, OrderHelper orderHelper)
 {
     this.db = db;
     this.orderHelper = orderHelper;
 }
Esempio n. 19
0
 public TranslationController(DataContext db, ICacheService cacheService)
     : base(db)
 {
     this.cacheService = cacheService;
 }
Esempio n. 20
0
 public CustomerController(DataContext db, ICustomerService customerService)
     : base(db)
 {
     this.customerService = customerService;
 }
 // GET: /Admin/EmailTemplate/
 public EmailTemplateController(DataContext db)
     : base(db)
 {
 }
Esempio n. 22
0
 public CountryService(DataContext db, IRegionService regionService)
 {
     this.regionService = regionService;
     this.db = db;
 }
Esempio n. 23
0
 public ProductSkuService(DataContext db)
 {
     this.db = db;
 }
Esempio n. 24
0
        public const int CACHE_DURATION = 30 * 60 * 60; // 30 minutes

        public ReportController(DataContext db)
            : base(db)
        {
        }
Esempio n. 25
0
 public WorkProcessService(DataContext db)
 {
     this.db = db;
 }
Esempio n. 26
0
 public RegionService(DataContext db)
 {
     this.db = db;
 }
Esempio n. 27
0
 public PaymentController(DataContext db)
     : base(db)
 {
 }
Esempio n. 28
0
 public ContentPageController(DataContext db, ICacheService cacheService)
     : base(db)
 {
     this.cacheService = cacheService;
 }
Esempio n. 29
0
 public UploadController(DataContext db)
     : base(db)
 {
 }
Esempio n. 30
0
 public CurrentUser(IIdentity identity, DataContext db)
 {
     this.identity = identity;
     this.db = db;
 }