public static SqlTableItemXml AddTable(string currentconnstr, SqlServerItemXml item, SqlDatabaseItemXml item2) { var basemodel = DBConfig.GetBaseXmlConfig(item.BaseNumber); SqlTableItemXml tabletempmodel = new SqlTableItemXml(); tabletempmodel.BaseNumber = item.BaseNumber; tabletempmodel.ServerNumber = item.Number; tabletempmodel.DataBaseNumber = item2.Number; tabletempmodel.Number = DBConfig.GetTableNumber; tabletempmodel.TableName = basemodel.TablePrev + tabletempmodel.Number; tabletempmodel.IsWrite = true; tabletempmodel.IsUse = true; tabletempmodel.RowNum = basemodel.DefaultTableRowNum; tabletempmodel.StorageSize = (item2.StorageSize - item2.StorageSize / 5) / item2.TableNum; DBConfig.TableAdd(basemodel, tabletempmodel); DBProxy.GetDBHelper(item.DBType).ExecuteSql(currentconnstr, DBConfig.GetTableSql(basemodel, tabletempmodel.TableName)); return(tabletempmodel); }
public static SqlDatabaseItemXml AddDatabase(string currentconnstrserver, SqlServerItemXml item) { var basemodel = DBConfig.GetBaseXmlConfig(item.BaseNumber); SqlDatabaseItemXml databasetempmodel = new SqlDatabaseItemXml(); databasetempmodel.BaseNumber = item.BaseNumber; databasetempmodel.ServerNumber = item.Number; databasetempmodel.Number = DBConfig.GetDatabaseNumber; databasetempmodel.DatabaseName = basemodel.DatabasePrev + databasetempmodel.Number; databasetempmodel.StorageSize = ((item.StorageSize - item.StorageSize / 5) - item.RetainStorageSize) / 10; databasetempmodel.TableNum = basemodel.DefaultTableNum; databasetempmodel.IsWrite = true; databasetempmodel.IsUse = true; databasetempmodel.IsCreate = true; databasetempmodel.StorageDirectory = item.StorageDirectory; DBConfig.DatabaseAdd(basemodel, databasetempmodel); DBProxy.GetDBAccess(item.DBType).DatabaseCreate(currentconnstrserver, databasetempmodel.DatabaseName, databasetempmodel.StorageDirectory); return(databasetempmodel); }