コード例 #1
0
 public ShippingZoneService(DataContext db, ICountryService countryService, IRegionService regionService, IShippingMethodService shippingMethodService)
 {
     this.db = db;
     this.countryService = countryService;
     this.regionService = regionService;
     this.shippingMethodService = shippingMethodService;
 }
コード例 #2
0
ファイル: TaxZoneService.cs プロジェクト: alin-rautoiu/Cart42
 public TaxZoneService(DataContext db, ITaxRateService taxRateService, ICountryService countryService, IRegionService  regionService)
 {
     this.db = db;
     this.taxRateService = taxRateService;
     this.countryService = countryService;
     this.regionService = regionService;
 }
コード例 #3
0
        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();
        }
コード例 #4
0
 public PageTemplateController(DataContext db, ISettingService settingService, 
     ITemplateSettingService templateSettingService)
     : base(db)
 {
     this.settingService = settingService;
     this.templateSettingService = templateSettingService;
 }
コード例 #5
0
 public CategoryDeleter(DataContext db, ICategoryService categoryService,
     IDeleterService deleterService, ICacheService cacheService)
 {
     this.db = db;
     this.categoryService = categoryService;
     this.deleterService = deleterService;
     this.cacheService = cacheService;
 }
コード例 #6
0
 public DataImportController(DataContext db, ICategoryService categoryService,
     IProductFinder productFinder, IProductService productService)
     : base(db)
 {
     this.categoryService = categoryService;
     this.productFinder = productFinder;
     this.productService = productService;
 }
コード例 #7
0
ファイル: ProductService.cs プロジェクト: alin-rautoiu/Cart42
 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;
 }
コード例 #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);
        }
コード例 #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;
 }
コード例 #10
0
 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;
 }
コード例 #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;
 }
コード例 #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
                    }
                }
            }
        }
コード例 #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
                    }
                }
            }
        }
コード例 #14
0
ファイル: ProductFinder.cs プロジェクト: alin-rautoiu/Cart42
 public ProductFinder(DataContext db, ICategoryService categoryService)
 {
     this.db = db;
     this.categoryService = categoryService;
 }
コード例 #15
0
ファイル: OrderService.cs プロジェクト: alin-rautoiu/Cart42
 public OrderService(DataContext db)
 {
     this.db = db;
 }
コード例 #16
0
 public BlogPostCommentService(DataContext db)
 {
     this.db = db;
 }
コード例 #17
0
 public SettingController(DataContext db, ISettingService settings)
     : base(db)
 {
     this.settings = settings;
 }
コード例 #18
0
ファイル: PaymentHelper.cs プロジェクト: alin-rautoiu/Cart42
 public PaymentHelper(DataContext db, OrderHelper orderHelper)
 {
     this.db = db;
     this.orderHelper = orderHelper;
 }
コード例 #19
0
 public TranslationController(DataContext db, ICacheService cacheService)
     : base(db)
 {
     this.cacheService = cacheService;
 }
コード例 #20
0
 public CustomerController(DataContext db, ICustomerService customerService)
     : base(db)
 {
     this.customerService = customerService;
 }
コード例 #21
0
 // GET: /Admin/EmailTemplate/
 public EmailTemplateController(DataContext db)
     : base(db)
 {
 }
コード例 #22
0
ファイル: CountryService.cs プロジェクト: alin-rautoiu/Cart42
 public CountryService(DataContext db, IRegionService regionService)
 {
     this.regionService = regionService;
     this.db = db;
 }
コード例 #23
0
 public ProductSkuService(DataContext db)
 {
     this.db = db;
 }
コード例 #24
0
        public const int CACHE_DURATION = 30 * 60 * 60; // 30 minutes

        public ReportController(DataContext db)
            : base(db)
        {
        }
コード例 #25
0
 public WorkProcessService(DataContext db)
 {
     this.db = db;
 }
コード例 #26
0
ファイル: RegionService.cs プロジェクト: alin-rautoiu/Cart42
 public RegionService(DataContext db)
 {
     this.db = db;
 }
コード例 #27
0
 public PaymentController(DataContext db)
     : base(db)
 {
 }
コード例 #28
0
 public ContentPageController(DataContext db, ICacheService cacheService)
     : base(db)
 {
     this.cacheService = cacheService;
 }
コード例 #29
0
 public UploadController(DataContext db)
     : base(db)
 {
 }
コード例 #30
0
ファイル: CurrentUser.cs プロジェクト: alin-rautoiu/Cart42
 public CurrentUser(IIdentity identity, DataContext db)
 {
     this.identity = identity;
     this.db = db;
 }