Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ManageFile"></param>
        /// <param name="Dbh"></param>
        public Manager(string ManageFile, IDBInfo Dbh)
        {
            this.dbHelper = Dbh;
            CreateDALFactory cdf = new CreateDALFactory();

            entityfactory = cdf.GetInstance(ManageFile, this.dbHelper);
        }
Beispiel #2
0
 public DalSql(IDBInfo Dbh)
 {
     this.dbHelper = Dbh;
     if (this.dbHelper != null)
     {
         this.oradbh = new OraDBHelper(this.dbHelper.GetConnectString());
     }
 }
Beispiel #3
0
        /// <summary>
        /// 获取工厂实例
        /// </summary>
        /// <returns></returns>
        public IEntityFactory GetInstance(string ManageFile, IDBInfo Dbh)
        {
            if (fac == null)
            {
                fac = CreateFactory(ManageFile, Dbh);
            }

            return(fac);
        }
Beispiel #4
0
        /// <summary>
        /// 根据实体配置文件创建工厂实例 在此将数据库操作和业务操作解耦
        /// </summary>
        /// <returns></returns>
        public IEntityFactory GetInstance(IDBInfo Dbh)
        {
            string xmlpath = System.Environment.CurrentDirectory.ToString() + "\\EntityFactory.xml";

            if (fac == null)
            {
                fac = CreateFactory(xmlpath, Dbh);
            }

            return(fac);
        }
Beispiel #5
0
        internal Tool(DB db, IDBInfo info)
        {
            this.Db               = db;
            this.Info             = info;
            this.TableComments    = info.TableComments;
            this.DbType           = db.DBType;
            this.ExcludeTableCols = db.GetInsertExcludeColumns();
            switch (DbType)
            {
            case DBType.SqlServer:
                this.Dict_CSharpType    = Global.Dict_SqlServer_CSharpType;
                this.Dict_Data_DefValue = Global.Dict_SqlServer_DefValue;
                break;

            case DBType.MySql:
                this.Dict_CSharpType    = Global.Dict_MySql_CSharpType;
                this.Dict_Data_DefValue = Global.Dict_MySql_DefValue;
                break;

            case DBType.Oracle:
            case DBType.OracleDDTek:
                this.Dict_CSharpType    = Global.Dict_Oracle_CSharpType;
                this.Dict_Data_DefValue = Global.Dict_Oracle_DefValue;
                break;

            case DBType.PostgreSql:
                this.Dict_CSharpType    = Global.Dict_PostgreSql_CSharpType;
                this.Dict_Data_DefValue = Global.Dict_PostgreSql_DefValue;
                break;

            case DBType.SQLite:
                this.Dict_CSharpType    = Global.Dict_Sqlite_CSharpType;
                this.Dict_Data_DefValue = Global.Dict_Sqlite_DefValue;
                break;

            case DBType.DB2:
                this.Dict_CSharpType    = Global.Dict_DB2_CSharpType;
                this.Dict_Data_DefValue = Global.Dict_DB2_DefValue;
                break;

            default:
                throw new Exception("未指定Charp类型字典!");
            }
        }
Beispiel #6
0
        /// <summary>
        /// 创建工厂实例对象
        /// </summary>
        /// <returns></returns>
        public static IEntityFactory CreateInstance(string ManageFile, IDBInfo Dbh)
        {
            string    xmlpath      = ManageFile;
            XmlHelper xmh          = new XmlHelper(xmlpath);
            string    AssemblyPath = xmh.GetNodeValue("descendant::AssemblyPath") + ".dll";

            if (File.Exists(AssemblyPath))
            {
                Assembly      ably  = Assembly.LoadFile(AssemblyPath);
                System.Type[] types = ably.GetTypes();
                foreach (System.Type type in types)
                {
                    if (type.GetInterface("IEntityFactory") != null)
                    {
                        return(( IEntityFactory)Activator.CreateInstance(type, Dbh));
                    }
                }
            }
            else
            {
            }
            return(null);
        }
Beispiel #7
0
 public AppDBManager(IBaseConfiguration config, ILog log, IDBInfo dbInfo)
     : base(config, log, dbInfo)
 {
 }
Beispiel #8
0
 public NCcodeList(IDBInfo dbInfo)
 {
     dbinfo = dbInfo;
 }
Beispiel #9
0
 public NCcodeList(IDBInfo dbInfo)
 {
     dbinfo = dbInfo;
 }
 public DBInfoListItem(IDBInfo item, IRefreshChartBinding chart)
 {
     Item = item;
     _isChecked = false;
     _chart = chart;
 }
Beispiel #11
0
 /// <summary>
 /// 创建工厂实例
 /// </summary>
 /// <returns></returns>
 public static IEntityFactory CreateFactory(string ManageFile, IDBInfo Dbh)
 {
     return(CreateInstance(ManageFile, Dbh));
 }
Beispiel #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Dbh"></param>
 public DALManager(IDBInfo Dbh)
 {
     this.odbh = new OraDBHelper(Dbh.GetConnectString());
 }
 public DBInfoListItem(IDBInfo item, IRefreshChartBinding chart)
 {
     Item       = item;
     _isChecked = false;
     _chart     = chart;
 }