Пример #1
0
        /// <summary>
        ///  获得数据库操作对象
        /// </summary>
        public DBManager Manager(int index)
        {
            if (lstManagers == null)
            {
                lstManagers = new Dictionary <int, DBManager>();
            }

            if (lstManagers.ContainsKey(index))
            {
                return(lstManagers[index]);
            }

            DbSource dbsur = DBPool.GetInstance()[index].DbInitSource;

            if (dbsur == null)
            {
                return(null);
            }
            if (dbsur.DBType == EDBType.MSSqlServer)
            {
                lstManagers.Add(index, new DBManager_SqlImpl());
            }
            return(lstManagers[index]);
        }
Пример #2
0
        /// <summary>
        ///  获得数据库操作对象
        /// </summary>
        public DBManager Manager(string dbName)
        {
            int index = DBPool.GetInstance().GetIndexBySetName(dbName);

            return(Manager(index));
        }