Пример #1
0
 /// <summary>
 ///
 /// </summary>
 public MqConfigService()
 {
     _searchService  = new RawSqlSearchService(DbConfigHelper.GetConfig());
     _computerAccess = new ConfigCenterClusterComputerAccess(DbConfigHelper.GetConfig());
     _cacheManager   = new RedisCacheManager((int)CacheRegionName.MqConfig);
     _logger         = LoggerFactory.GetLog();
 }
Пример #2
0
 /// <summary>
 /// 初始化选项卡内控件内容
 /// </summary>
 /// <param name="page"></param>
 private void InitialTabPage(TabPage page)
 {
     if (page == pageMES)
     {
         var info = DbConfigHelper.GetDbInfo();
         var list = Enum.GetNames(typeof(SqlSugar.DbType));
         cmbMES.DataSource    = list;
         cmbMES.SelectedIndex = list.ToList().IndexOf(info.DbType.ToString());
         txtMESServer.Text    = info.DataSource;
         txtMESDbName.Text    = info.DbName;
         txtMESPort.Text      = info.Port.ToString();
         txtMESUser.Text      = info.UserId;
         txtMESPswd.Text      = info.Password;
     }
 }
Пример #3
0
        /// <summary>
        /// This Function loads Configuration Settings from appsettings.json file OR
        /// from DB without code change and just reading the value from appsettings.json file
        /// </summary>
        private void LoadConfiguration()
        {
            string value = _config.GetSection(AppConstants.LoadConfiguration).Value;

            if (value.Equals("FromConfig"))
            {
                // Load Configuration From appsettings.json
                ConfigHelper config = new ConfigHelper(_config);
                _loggingconfiguration = config.GetConfig();
            }

            if (value.Equals("FromDb"))
            {
                // Load Configuration From DB Just for demonstration ** Not Implemented**
                DbConfigHelper config = new DbConfigHelper(_config);
                _loggingconfiguration = config.GetConfig();
            }
        }
Пример #4
0
        private void btnTestMes_Click(object sender, EventArgs e)
        {
            var dbInfo = new DbInfo
            {
                Name   = DbInfoName.MainDb,
                DbType = (SqlSugar.DbType)Enum.Parse(typeof(SqlSugar.DbType),
                                                     cmbMES.SelectedItem as string ?? throw new InvalidOperationException()),
                DataSource = txtMESServer.Text,
                DbName     = txtMESDbName.Text,
                UserId     = txtMESUser.Text,
                Port       = Convert.ToInt32(txtMESPort.Text),
                Password   = txtMESPswd.Text
            };

            if (DbConfigHelper.TestConnection(dbInfo, out var errorMessage))
            {
                MsgBoxLib.ShowInformationOk("连接成功");
            }
            else
            {
                MsgBoxLib.ShowError($"连接失败\n错误信息:\n{errorMessage}");
            }
        }
 public DeviceRegisterCommandVistor()
 {
     _deviceAccess = new DeviceAccess(DbConfigHelper.GetConfig());
 }
 /// <summary>
 ///
 /// </summary>
 public ConfigCenterMqListenerService()
 {
     _access = new AppBasicInfoAccess(DbConfigHelper.GetConfig());
     _logger = LoggerFactory.GetLog();
 }
Пример #7
0
 public RedisConfigService()
 {
     _computerAccess = new ConfigCenterClusterComputerAccess(DbConfigHelper.GetConfig());
     _cacheKeyAccess = new ConfigCenterRedisCacheKeyAccess(DbConfigHelper.GetConfig());
 }