示例#1
0
 public DefaultTable GetTableAsDefault(string tableName)
 {
     tableName = tableName.ToUpper();
     if (!SchemaManager.SchemaDictionary.ContainsKey(tableName))
     {
         MultipleSchemas schemas = this.LoadSchemas(tableName);
         SchemaManager.SchemaDictionary.Add(tableName, schemas);
     }
     return(SchemaManager.SchemaDictionary[tableName]["DEFAULT"].Clone() as DefaultTable);
 }
示例#2
0
 public RelationalTable GetTableAsRelational(string tableName)
 {
     tableName = tableName.ToUpper();
     if (!SchemaManager.SchemaDictionary.ContainsKey(tableName))
     {
         MultipleSchemas schemas = this.LoadSchemas(tableName);
         SchemaManager.SchemaDictionary.Add(tableName, schemas);
     }
     return(SchemaManager.SchemaDictionary[tableName]["RELATIONAL"].Clone() as RelationalTable);
 }
示例#3
0
 public MasterTable GetTableAsMaster(string tableName)
 {
     tableName = tableName.ToUpper();
     if (!SchemaManager.SchemaDictionary.ContainsKey(tableName))
     {
         MultipleSchemas schemas = this.LoadSchemas(tableName);
         SchemaManager.SchemaDictionary.Add(tableName, schemas);
     }
     return(SchemaManager.SchemaDictionary[tableName]["MASTER"].Clone() as MasterTable);
 }
示例#4
0
        private MultipleSchemas LoadSchemas(string tableName)
        {
            string          queries         = "SELECT TOP 0 * FROM [" + tableName + "];\n";
            SqlCommand      command         = new SqlCommand(queries);
            SqlDataReader   reader          = (SqlDataReader)this.Database.ExecuteReader(command);
            MasterTable     masterTable     = new MasterTable(tableName);
            DefaultTable    defaultTable    = new DefaultTable(tableName);
            RelationalTable relationalTable = new RelationalTable(tableName);

            masterTable.Load(reader);
            defaultTable.Load(masterTable.CreateDataReader());
            relationalTable.Load(masterTable.CreateDataReader());

            MultipleSchemas schemas = new MultipleSchemas();

            schemas.Add("MASTER", masterTable);
            schemas.Add("DEFAULT", defaultTable);
            schemas.Add("RELATIONAL", relationalTable);
            return(schemas);
        }