コード例 #1
0
        private DatabaseDTO ToDatabaseDTO(DatabaseInformation item)
        {
            DatabaseDTO result = new DatabaseDTO();

            result.ID               = item.ID;
            result.Name             = item.Name;
            result.Title            = item.Title;
            result.DBServerID       = item.DBServerID;
            result.DBServerName     = item.DBServer.Name;
            result.ConnectionString = item.ConnectionString;
            return(result);
        }
コード例 #2
0
        private static I_DBHelper GetDBHelper(DatabaseInformation database)
        {
            I_DBHelper dbHelper = System.Runtime.Remoting.Messaging.CallContext.GetData(database.Name) as I_DBHelper;

            if (dbHelper == null)
            {
                var dbProvider = GetDatabaseProvider(database);
                if (dbProvider == DatabaseProvider.SQLServer)
                {
                    var connection = new SqlConnection(database.ConnectionString);
                    dbHelper = new SQLHelper(connection);
                    System.Runtime.Remoting.Messaging.CallContext.SetData(database.Name, dbHelper);
                }
                else if (dbProvider == DatabaseProvider.Oracle)
                {
                }
            }

            return(dbHelper);
        }
コード例 #3
0
 private static DatabaseProvider GetDatabaseProvider(DatabaseInformation databaseDTO)
 {
     return(DatabaseProvider.SQLServer);
 }