diff --git a/README.md b/README.md index 253f33e..879d708 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Kalman.Studio -开发辅助工具,内置基于T4的代码生成器。 +开发辅助工具,自动代码生成器,内置基于T4的代码生成器。 作者博客:http://www.cnblogs.com/lingyun_k + QQ群:122161138 [![stable](https://img.shields.io/badge/stable-stable-green.svg)](https://github.com/loamen/Kalman.Studio/) @@ -30,6 +31,11 @@ QQ群:122161138 ## 二、更新日志 +2018-08-16 + + * 修正数据库架构查看器; + * 修正数据库文档生成器; + 2018-07-25 * 修正MySql无法连接的问题; diff --git a/src/Kalman.Studio/ToolForm/DbDocBuilder.cs b/src/Kalman.Studio/ToolForm/DbDocBuilder.cs index 6221793..2cd3c40 100644 --- a/src/Kalman.Studio/ToolForm/DbDocBuilder.cs +++ b/src/Kalman.Studio/ToolForm/DbDocBuilder.cs @@ -10,6 +10,7 @@ using Kalman.Command; using Kalman.Data; using Kalman.Data.SchemaObject; +using Kalman.Database; namespace Kalman.Studio { @@ -33,9 +34,15 @@ public DbDocBuilder() private void DbDocBuilder_Load(object sender, EventArgs e) { - foreach (ConnectionStringSettings css in ConfigurationManager.ConnectionStrings) + var dal = new DbConnDAL(); + //dal.InitData(); + + var list = dal.FindAll().ToList(); + + foreach (var item in list) { - cbConnectionStrings.Items.Add(css.Name); + if (item.IsActive) + cbConnectionStrings.Items.Add(item.Name); } if (string.IsNullOrEmpty(CSName) == false) @@ -50,8 +57,11 @@ private void DbDocBuilder_Load(object sender, EventArgs e) //改变连接 void ChangeConnection(string csName) { - ConnectionStringSettings css = ConfigurationManager.ConnectionStrings[csName]; - currentSchema = DbSchemaFactory.Create(css.Name); + DbConnDAL dal = new DbConnDAL(); + + var model = dal.FindOne(csName); + + currentSchema = DbSchemaFactory.Create(model.Name); List dbList = currentSchema.GetDatabaseList(); cbDatabase.Items.Clear(); diff --git a/src/Kalman.Studio/ToolForm/DbSchemaViewer.cs b/src/Kalman.Studio/ToolForm/DbSchemaViewer.cs index 3bdd9ee..79591c4 100644 --- a/src/Kalman.Studio/ToolForm/DbSchemaViewer.cs +++ b/src/Kalman.Studio/ToolForm/DbSchemaViewer.cs @@ -11,6 +11,7 @@ using System.Data.SqlClient; using WeifenLuo.WinFormsUI.Docking; using Kalman.Data; +using Kalman.Database; namespace Kalman.Studio { @@ -23,11 +24,17 @@ public DbSchemaViewer() private void DbSchemaViewer_Load(object sender, EventArgs e) { - foreach (ConnectionStringSettings css in ConfigurationManager.ConnectionStrings) + var dal = new DbConnDAL(); + //dal.InitData(); + + var list = dal.FindAll().ToList(); + + foreach (var item in list) { - cbConnectionStrings.Items.Add(css.Name); + if (item.IsActive) + cbConnectionStrings.Items.Add(item.Name); } - + cbSchemaName.DataSource = new string[]{ "MetaDataCollections", "Databases",