示例#1
0
        public static DBAct InitDBAct(DBTypeEnum.DBType dbtype, string connectstring)
        {
            DBAct dbact = new DBAct();

            dbact.ConnectionStr = connectstring;
            dbact.DBType        = Enum.GetName(dbtype.GetType(), dbtype);
            dbact.DBTypeValue   = (int)dbtype;
            dbact.DBABase       = new DBActBase(connectstring);
            return(dbact);
        }
示例#2
0
 /// <summary>
 /// 初始化配置
 /// </summary>
 /// <param name="Type">数据库类型</param>
 public static void InitSetting(DBTypeEnum.DBType Type)
 {
     try
     {
         ConnectConfig   = ConfigurationManager.ConnectionStrings;
         AppSetingConfig = ConfigurationManager.AppSettings;
         LogPath         = ConfigurationManager.AppSettings["LogPath"];//日志文件路径不含文件名
         DBType          = Enum.GetName(Type.GetType(), Type);
         ConnectString   = ConfigurationManager.ConnectionStrings[DBType].ToString();
         KEY             = ConfigurationManager.AppSettings["Key"];
     }
     catch (System.Exception ex)
     {
         Log.LogInBatchExceptWrite(ex, "文件读取配置部分错误!");
     }
 }
示例#3
0
 public DBActBase(DBTypeEnum.DBType dbtype, string connectstr)
 {
     this.ConnectionStr = connectstr;
     this.DBType        = Enum.GetName(dbtype.GetType(), dbtype);
     this.DBTypeValue   = (int)dbtype;
 }