public JweBlackListService(
     IDataBaseFactory dataBaseFactory,
     IOptionsMonitor <JweOptions> jweOptions)
 {
     this.dataBaseFactory = dataBaseFactory;
     this.jweOptions      = jweOptions;
 }
Esempio n. 2
0
 public ProfilesVisitsCounterService(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache)
 {
     this.dbFactory           = dbFactory;
     this.spamProtectionCache = spamProtectionCache;
 }
 //IServiceAnnonce sa = new ServiceAnnonce(uow);
 public AnnoceController()
 {
     dbf            = new DataBaseFactory();
     uow            = new UnitOfWork(dbf);
     ServiceAnnonce = new ServiceAnnonce();
     ServiceClient  = new ServiceClient();
 }
Esempio n. 4
0
 public ClientController()
 {
     dbf            = new DataBaseFactory();
     uow            = new UnitOfWork(dbf);
     ServiceAnnonce = new Service <Annonce>(uow);
     ServiceClient  = new Service <Client>(uow);
 }
Esempio n. 5
0
 public MenuCache(
     IDataBaseFactory dataBaseFactory,
     IRolesCache rolesCache)
 {
     this.dataBaseFactory = dataBaseFactory;
     this.rolesCache      = rolesCache;
 }
Esempio n. 6
0
 public MaterialsVisitsCounterCache(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache)
 {
     this.dbFactory           = dbFactory;
     this.spamProtectionCache = spamProtectionCache;
 }
Esempio n. 7
0
 public JwtBlackListService(
     IDataBaseFactory dataBaseFactory,
     IOptions <JwtOptions> jwtOptions)
 {
     this.dataBaseFactory = dataBaseFactory;
     this.jwtOptions      = jwtOptions.Value;
 }
Esempio n. 8
0
        public static void AddIdentity(this IServiceCollection services, IDataBaseFactory dataBaseFactory)
        {
            services.AddIdentity <User, Role>(
                options =>
            {
                options.Password.RequireDigit           = false;
                options.Password.RequireLowercase       = false;
                options.Password.RequireNonAlphanumeric = false;
                options.Password.RequireUppercase       = false;
                options.Password.RequiredUniqueChars    = 2;
                options.Password.RequiredLength         = 6;
                options.User.RequireUniqueEmail         = true;

                const string engChars = "abcdefghijklmnopqrstuvwxyz";
                const string rusChars = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
                const string numbers  = "0123456789";
                const string other    = " -";

                options.User.AllowedUserNameCharacters =
                    engChars + engChars.ToUpper() + rusChars + rusChars.ToUpper() + numbers + other;
            })
            .AddLinqToDBStores <int>(dataBaseFactory)
            .AddUserManager <SunUserManager>()
            .AddRoleManager <SunRoleManager>()
            .AddDefaultTokenProviders();
        }
Esempio n. 9
0
        public static void AddCiphers(this IServiceCollection services, IDataBaseFactory dbFactory)
        {
            CryptService cryptService = new CryptService(dbFactory);

            cryptService.AddCipherKey(CaptchaService.CypherName);
            services.AddSingleton <ICryptService>(cryptService);
        }
Esempio n. 10
0
 public EfRepositoryBase(IDataBaseFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     this.DatabaseFactory = factory;
     _context             = _context ?? (_context = DatabaseFactory.Get());
 }
Esempio n. 11
0
 public SectionsCache(
     IDataBaseFactory dataBaseFactory,
     IRolesCache rolesCache,
     SectionTypes sectionTypes)
 {
     this.rolesCache      = rolesCache;
     this.dataBaseFactory = dataBaseFactory;
     this.sectionTypes    = sectionTypes;
     Initialize();
 }
 public CleanCacheJobsService(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache,
     IOptions <SchedulerOptions> schedulerOptions,
     JwtBlackListService jwtBlackListService)
 {
     this.dbFactory           = dbFactory;
     this.spamProtectionCache = spamProtectionCache;
     this.jwtBlackListService = jwtBlackListService;
     this.schedulerOptions    = schedulerOptions.Value;
 }
Esempio n. 13
0
        public OperationKeysContainer(IDataBaseFactory dbFactory)
        {
            using DataBaseConnection db = dbFactory.CreateDb();
            Dictionary <string, int> dictionary = db.OperationKeys
                                                  .ToDictionary(x => x.Name, x => x.OperationKeyId);

            foreach (var propertyInfo in typeof(OperationKeysContainer).GetProperties())
            {
                propertyInfo.SetValue(this, dictionary[propertyInfo.Name]);
            }
        }
Esempio n. 14
0
 public DbContext(IDataBaseFactory dataBaseFactory,
                  IMapToNew <Post, Entities.Post> postMapper,
                  IMapToNew <PostSummary, Entities.PostSummary> postSummaryMapper,
                  IMapToNew <Comment, Entities.Comment> commentMapper,
                  IMapToNew <User, Entities.User> userMapper)
 {
     this.dataBaseFactory   = dataBaseFactory;
     this.postMapper        = postMapper;
     this.commentMapper     = commentMapper;
     this.userMapper        = userMapper;
     this.postSummaryMapper = postSummaryMapper;
 }
Esempio n. 15
0
        public BudgetStatistician Statistic(IDataBaseFactory factory)
        {
            string sql = string.Format("SELECT sum(TB_Budget.Estimate),sum(Actuality),sum((CASE WHEN Level = '{0}' THEN Actuality ELSE 0 END)) FROM TB_Budget", EnumBudgetState.Signed);

            using (var db = factory.OpenDefalutDataBase())
            {
                DataSet set = db.ExecuteSqlToDataSet(sql);
                SumEstimate    = onConvertToDouble(set.Tables[0].Rows[0][0].ToString());
                FinishEstimate = onConvertToDouble(set.Tables[0].Rows[0][1].ToString());
                FinishAcutual  = onConvertToDouble(set.Tables[0].Rows[0][2].ToString());
            }
            return(this);
        }
Esempio n. 16
0
        public CryptService(IDataBaseFactory dbFactory)
        {
            this.dbFactory = dbFactory;

            cipher = new AesManaged
            {
                KeySize   = 256,
                BlockSize = 128,
                Padding   = PaddingMode.ISO10126,
                Mode      = CipherMode.CBC
            };

            Initialize();
        }
Esempio n. 17
0
        public static IServiceCollection AddDatabase(this IServiceCollection services, IConfiguration configuration,
                                                     out IDataBaseFactory dataBaseFactory)
        {
            LinqToDB.Common.Configuration.Linq.AllowMultipleQuery = true;

            var dbFactory = DataBaseFactory.DefaultDataBaseFactory;

            services.AddSingleton <IDataBaseFactory>(dbFactory);
            services.AddScoped(x => dbFactory.CreateDb());

            dataBaseFactory = dbFactory;

            return(services);
        }
Esempio n. 18
0
 public CleanCacheJobsService(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache,
     IOptionsMonitor <SchedulerOptions> schedulerOptions,
     IMaterialsVisitsCounterCache materialsVisitsCounterCache,
     IProfilesVisitsCounterService profilesVisitsCounterService,
     JweBlackListService jweBlackListService)
 {
     this.dbFactory                    = dbFactory;
     this.spamProtectionCache          = spamProtectionCache;
     this.jweBlackListService          = jweBlackListService;
     this.materialsVisitsCounterCache  = materialsVisitsCounterCache;
     this.profilesVisitsCounterService = profilesVisitsCounterService;
     this.schedulerOptions             = schedulerOptions;
 }
Esempio n. 19
0
        /// <summary>
        /// Add Singleton cache services
        /// </summary>
        public static void AddCaches(this IServiceCollection services, IDataBaseFactory dataBaseFactory)
        {
            services.AddSingleton <IRolesCache>(new RolesCache(dataBaseFactory));

            services.AddSingleton <ICategoriesCache, CategoriesCache>();

            services.AddSingleton <IMenuCache, MenuCache>();

            services.AddSingleton <IComponentsCache, ComponentsCache>();

            services.AddSingleton <IContentCache, CategoryContentCache>();

            services.AddSingleton <CacheKeyGenerator>();

            services.AddSingleton <SpamProtectionCache>();

            services.AddSingleton <IMailTemplatesCache, MailTemplatesCache>();

            services.AddSingleton <CaptchaCacheService>();
        }
Esempio n. 20
0
        public CryptService(IDataBaseFactory dbFactory)
        {
            this.dbFactory = dbFactory;

            cipher = new RijndaelManaged
            {
                KeySize   = 256,
                BlockSize = 128,
                Padding   = PaddingMode.ISO10126,
                Mode      = CipherMode.CBC
            };

            using (var db = dbFactory.CreateDb())
            {
                foreach (var x in db.CipherSecrets)
                {
                    AddCipherKey(x.Name, x.Secret);
                }
            }
        }
Esempio n. 21
0
        private void SubscribeConn_SubscribeMySqlLog(MySqlResponseData data)
        {
            if (data != null)
            {
                IDataBaseFactory dataBaseFactory = null;
                switch (data.DataBaseName.ToLower())
                {
                case "jijiaworkflow":
                    dataBaseFactory = new JiJiaWorkFlowFactory();
                    break;

                default:
                    break;
                }
                if (dataBaseFactory != null)
                {
                    dataBaseFactory.GetTableData(data);
                }
            }
        }
Esempio n. 22
0
 public UnitOfWork(IDataBaseFactory SolutionFactory)
 {
     DBFactory = SolutionFactory;
 }
Esempio n. 23
0
 public ProductRepository(IDataBaseFactory dataBaseFactory) : base(dataBaseFactory)
 {
     dbset = DataContext.Set <PRODUCT>();
 }
Esempio n. 24
0
 public SenderRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
 }
Esempio n. 25
0
 public HMRCResponseRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
 }
Esempio n. 26
0
 public InvoiceRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
     this._databasefactory = databasefactory;
 }
Esempio n. 27
0
 public ClientRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
 }
Esempio n. 28
0
 public PeriodDataRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
     this._databasefactory = databasefactory;
 }
Esempio n. 29
0
 public BusinessRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
     this._databasefactory = databasefactory;
 }
Esempio n. 30
0
 public UnitOfWork(IDataBaseFactory factory)
 {
     this.factory = factory;
 }