Пример #1
0
 public Base_UserStorBusiness(IDbAccessor db, Cache.IBase_UserCache userCache, IServiceProvider serviceProvider, IMapper mapper)
     : base(db)
 {
     _serviceProvider = serviceProvider;
     _userCache       = userCache;
     _mapper          = mapper;
 }
        public IConfigInit UseDatabase <TDbAccessor>(string conString, DatabaseType dbType) where TDbAccessor : class, IDbAccessor
        {
            if (ShardingConfig.ServiceDescriptors != null)
            {
                ShardingConfig.ServiceDescriptors.AddScoped(_ =>
                {
                    ILoggerFactory loggerFactory = _.GetService <ILoggerFactory>();

                    IDbAccessor repository = DbFactory.GetDbAccessor(conString, dbType, loggerFactory);
                    if (ShardingConfig.LogicDelete)
                    {
                        repository = new LogicDeleteDbAccessor(repository);
                    }

                    if (typeof(TDbAccessor) == typeof(IDbAccessor))
                    {
                        return((TDbAccessor)repository);
                    }
                    else
                    {
                        return(repository.ActLike <TDbAccessor>());
                    }
                });
            }

            return(this);
        }
 public HomeBusiness(IDbAccessor db, IOperator @operator, IMapper mapper, IBase_UserCache base_UserCache)
     : base(db)
 {
     _operator       = @operator;
     _mapper         = mapper;
     _base_UserCache = base_UserCache;
 }
        public BuildCodeBusiness(IDbAccessor db, IHostEnvironment evn)
            : base(db)
        {
            var projectPath = evn.ContentRootPath;

            _solutionPath = Directory.GetParent(projectPath).ToString();
        }
Пример #5
0
 public SaleProductWareHouseStockService(IDbAccessor omsAccessor, IWorkContext workContext, ILogger <ProductService> logger, ILogService logService, IConfiguration configuration, IOrderService orderService)
     : base(omsAccessor, workContext, configuration)
 {
     _logger       = logger;
     _logService   = logService;
     _orderService = orderService;
 }
Пример #6
0
 public mini_component_nestedBusiness(IDbAccessor db, IMapper mapper, Operator op, Imini_page_componentBusiness mini_page_componentBusiness)
     : base(db)
 {
     _mapper   = mapper;
     _operator = op;
     _mini_page_componentBusiness = mini_page_componentBusiness;
 }
 public LogicDeleteDbAccessor(IDbAccessor db, EFCoreShardingOptions shardingOptions)
 {
     FullDbAccessor = db;
     _logicDelete   = shardingOptions.LogicDelete;
     _deletedField  = shardingOptions.DeletedField;
     _keyField      = shardingOptions.KeyField;
 }
 public LogicDeleteDbAccessor(IDbAccessor db, IShardingConfig shardingConfig)
 {
     FullDbAccessor = db;
     _logicDelete   = shardingConfig.LogicDelete;
     _deletedField  = shardingConfig.DeletedField;
     _keyField      = shardingConfig.KeyField;
 }
Пример #9
0
 public HomeBusiness(IDbAccessor db, IOperator @operator, IMapper mapper, Imini_project_userBusiness mini_project_userBusiness)
     : base(db)
 {
     _operator = @operator;
     _mapper   = mapper;
     _mini_project_userBusiness = mini_project_userBusiness;
 }
 public LogicDeleteDbAccessor(IDbAccessor db)
 {
     FullDbAccessor = db;
     _logicDelete   = Constant.LogicDelete;
     _deletedField  = Constant.DeletedField;
     _keyField      = Constant.KeyField;
 }
Пример #11
0
        public void Initialize(string tablePrefix, string schedName, IDbAccessor dbAccessor)
        {
            TablePrefix = tablePrefix;
            SchedName   = schedName;
            DbAccessor  = dbAccessor;

            // No longer required
            SchedNameLiteral = "'" + schedName + "'";
        }
Пример #12
0
        public void Initialize(string tablePrefix, string schedName, IDbAccessor dbAccessor)
        {
            TablePrefix = tablePrefix;
            DbAccessor  = dbAccessor;
            SchedName   = schedName;

            // No longer used in this file
            SchedNameLiteral = "'" + schedName + "'";
        }
Пример #13
0
 public CMBService(IDbAccessor omsAccessor, IWorkContext workContext, ICommonService commonService, IConfiguration configuration, IOrderService orderService
                   , IProductService productService, ILogService logService)
     : base(omsAccessor, workContext, configuration)
 {
     _commonService  = commonService;
     _orderService   = orderService;
     _productService = productService;
     _logService     = logService;
 }
Пример #14
0
        public void WriteAggregate(IDbAccessor accessor, IDbAggregate aggregate)
        {
            if (aggregate == null)
            {
                return;
            }

            WriteAggregates(accessor, new[] { aggregate });
        }
Пример #15
0
 public ExecuteService(IDbAccessor omsAccessor, IWorkContext workContext, IConfiguration configuration, IOrderSyncService orderSyncService, ILogService logService, IProductService productService,
                       ICMBService cmbService)
     : base(omsAccessor, workContext)
 {
     _orderSyncService = orderSyncService;
     _configuration    = configuration;
     _logService       = logService;
     _productService   = productService;
     _cmbService       = cmbService;
 }
Пример #16
0
        /// <summary>
        /// 从已加载的数据中获取对应类型的List<>, 如果对应类型不存在, 加载并返回加载后的结果
        /// </summary>
        private IList GetSubItemList(Type type, IDbAccessorFactory dbAcsFty, object key)
        {
            ClassDesc   clsDesc    = GetClassDesc(type);
            IDbAccessor dbAccessor = dbAcsFty.GetDbAccessor(clsDesc.TableName);
            IDataReader reader     = dbAccessor.Query(GetQueryString(clsDesc.TableName, clsDesc.RootKeyAttribute.ColumnName, key));
            IList       list       = ReadItems(type, reader, clsDesc, dbAcsFty, key);

            dbAccessor.CloseDbReader();
            return(list);
        }
Пример #17
0
 public StockRemindService(IDbAccessor omsAccessor, IWorkContext context, IDistributedCache cache, IHubContext <HubContext, IHubContext> hubContext, ICommonService common, IStockRemindNotify remindNotify, IConfiguration configuration)
 {
     this.omsAccessor  = omsAccessor;
     user              = context.CurrentUser;
     this.cache        = cache;
     this.hubContext   = hubContext;
     this.common       = common;
     this.remindNotify = remindNotify;
     this.conn         = configuration["ConnectionStrings:DefaultConnection"];
 }
Пример #18
0
 public OrderSyncService(IDbAccessor omsAccessor, IWorkContext workContext, ICommonService commonService, IOrderService orderService, IServiceProvider serviceProvider, IProductService productService, IDeliveriesService deliveriesService, ILogService logService)
     : base(omsAccessor, workContext)
 {
     _commonService     = commonService;
     _orderService      = orderService;
     _rootProvider      = serviceProvider;
     _productService    = productService;
     _deliveriesService = deliveriesService;
     _logService        = logService;
 }
 public Base_UserBusiness(
     IDbAccessor db,
     IBase_UserCache userCache,
     IOperator @operator,
     IMapper mapper
     )
     : base(db)
 {
     _userCache = userCache;
     _operator  = @operator;
     _mapper    = mapper;
 }
Пример #20
0
        public Examples()
        {
            m_Filename = Path.GetTempFileName();
            m_Accessor = DbFactory.CreateAccessor(
                DbAccessorType.SqLite,
                AccessorExtension.All,
                () => new SQLiteConnection(String.Format("Data Source={0};Version=3;New=True", m_Filename))
                );

            m_Accessor.Execute(CREATE_DATABASE_SCRIPT);
            //m_Accessor.Log = Console.Out;
        }
        public IDbAccessor GetMapDbAccessor(string conString, DatabaseType dbType, string suffix)
        {
            var         dbId = GetDbId(conString, dbType, suffix);
            IDbAccessor db   = _dbs.GetOrAdd(dbId, key => _dbFactory.GetDbAccessor(conString, dbType, null, suffix));

            if (OpenedTransaction)
            {
                _transaction.AddDbAccessor(db);
            }

            return(db);
        }
Пример #22
0
 public CustomerController(ICustomerService customerService, IAuthenticationService authenticationService, ICommonService commonService, IPermissionService permissionService,
                           ISalesManService salesManService, IScheduleTaskFuncService scheduleTaskFuncService, IHostingEnvironment hostingEnvironment, IDbAccessor omsAccessor)
 {
     _customerService         = customerService;
     _authenticationsService  = authenticationService;
     _commonService           = commonService;
     _permissionService       = permissionService;
     _salesManService         = salesManService;
     _scheduleTaskFuncService = scheduleTaskFuncService;
     _hostingEnvironment      = hostingEnvironment;
     _omsAccessor             = omsAccessor;
 }
Пример #23
0
 public HomeBusiness(IDbAccessor db, IOperator @operator,
                     IMapper mapper,
                     Imini_project_userBusiness mini_project_userBusiness,
                     IBase_UserCache userCache,
                     IWorkOrderDbAccessor workOrderDbAccessor,
                     Base_UserBusiness base_UserBusiness)
     : base(db)
 {
     _operator          = @operator;
     _mapper            = mapper;
     _userCache         = userCache;
     _Base_UserBusiness = base_UserBusiness;
 }
Пример #24
0
        public override void Rule(IDbAccessor omsAccessor, SetDto set)
        {
            var templateCodes = set.Key.Select(c => c.TemplateCode).ToList();
            var templateCode  = omsAccessor.Get <RemindTemplateModel>().Where(c => templateCodes.Any(d => d == c.TemplateCode)).ToList();

            templateCode.ForEach(c =>
            {
                // 标题/提醒库存 不同时,视为更新
                if (c.TemplateTitle != set.TemplateTitle || c.RemindStock != set.RemindStock)
                {
                    c.IsUpdate = true;
                }
            });
        }
Пример #25
0
 public PurchasingController(IPermissionService permissionService, IPurchasingService purchasingService, IWareHouseService wareHouseService,
                             ICommonService commonService, IProductService productService, ILogService logService, IUserService userService, IScheduleTaskFuncService scheduleTaskFuncService, IDbAccessor omsAccessor
                             , IHostingEnvironment hostingEnvironment)
 {
     _permissionService       = permissionService;
     _purchasingService       = purchasingService;
     _wareHouseService        = wareHouseService;
     _commonService           = commonService;
     _productService          = productService;
     _logService              = logService;
     _userService             = userService;
     _scheduleTaskFuncService = scheduleTaskFuncService;
     _omsAccessor             = omsAccessor;
     _hostingEnvironment      = hostingEnvironment;
 }
Пример #26
0
 public ScheduleTaskFuncService(IDbAccessor omsAccessor,
                                IWorkContext workContext,
                                IConfiguration configuration,
                                IOrderSyncService orderSyncService,
                                ILogService logService,
                                IProductService productService,
                                ICMBService cmbService)
     : base(omsAccessor, workContext, configuration)
 {
     _orderSyncService    = orderSyncService;
     WMSApiUrl            = configuration.GetSection("WMSApi")["domain"].ToString();
     this._logService     = logService;
     this._productService = productService;
     _cmbService          = cmbService;
 }
Пример #27
0
        public void WriteAggregates(IDbAccessor accessor, IEnumerable <IDbAggregate> aggregates)
        {
            if (aggregates == null || !aggregates.Any())
            {
                return;
            }

            var aggregateTypes = aggregates
                                 .Where(a => a != null)
                                 .ToLookup(a => a.GetType());

            foreach (var aggregateType in aggregateTypes)
            {
                WriteAggregatesOfSameType(accessor, aggregateType);
            }
        }
Пример #28
0
 public CommandProcessor(INotifier notifier,
                         IReportingService service,
                         IDbAccessor dbAccessor,
                         IMailSender mailSender,
                         IPinGenerator pinGenerator,
                         IServiceProvider serviceProvider,
                         IOptions <Config> options)
 {
     _notifier        = Arg.NotNull(notifier, nameof(notifier));
     _service         = Arg.NotNull(service, nameof(service));
     _config          = Arg.NotNull(options.Value, nameof(options));
     _dbAccessor      = Arg.NotNull(dbAccessor, nameof(dbAccessor));
     _mailSender      = Arg.NotNull(mailSender, nameof(mailSender));
     _pinGenerator    = Arg.NotNull(pinGenerator, nameof(pinGenerator));
     _serviceProvider = Arg.NotNull(serviceProvider, nameof(serviceProvider));
 }
Пример #29
0
        public IDbAccessor GetMapDbAccessor(string conString, DatabaseType dbType, string suffix)
        {
            var         dbId = GetDbId(conString, dbType, suffix);
            IDbAccessor db   = _dbs.GetOrAdd(dbId, key => _dbFactory.GetDbAccessor(new DbContextParamters
            {
                ConnectionString = conString,
                DbType           = dbType,
                Suffix           = suffix
            }));

            if (OpenedTransaction)
            {
                _transaction.AddDbAccessor(db);
            }

            return(db);
        }
Пример #30
0
        public MainController(IDbAccessor dbAccessor)
        {
            _dbAccessor = dbAccessor;
            IServiceMgr serviceMgr = ServiceMgr.Current;

            _logMgr        = serviceMgr.GetInstance <ILogMgr>();
            _logger        = _logMgr.GetLogger("Request.MainController");
            _dialogMgr     = serviceMgr.GetInstance <IViewFormMgr>();
            _regionMgr     = serviceMgr.GetInstance <IRegionMgr>();
            _commonService = serviceMgr.GetInstance <ICommonService>();
            _dbMgr         = serviceMgr.GetInstance <IDbMgr>();
            _eventMgr      = serviceMgr.GetInstance <IEventMgr>();
            _logger.Debug("Create.");
            _logger.Debug("Interfaces: IDBMgr = {0}; ICommonDbService = {1}; _dialogMgr = {2}; IRegionMgr = {3}; IEventMgr = {4}.", _dbMgr.ToStateString(), _commonService.ToStateString(), _dialogMgr.ToStateString(), _regionMgr.ToStateString(), _eventMgr.ToStateString());

            Init();
        }
 public MsSqlConfigurationSettingsRepository(IDatabaseConnectionStringProvider databaseConnectionStringProvider)
 {
     _dbAccessor = new DbAccessor(databaseConnectionStringProvider);
 }
 public void Initialize(string tablePrefix, string schedName, IDbAccessor dbAccessor)
 {
     TablePrefix = tablePrefix;
     SchedNameLiteral = "'" + schedName + "'";
     DbAccessor = dbAccessor;
 }