From 1f0372b581e735868940c976925b74454d9869a4 Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 16 Aug 2018 16:56:18 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E4=BF=AE=E6=AD=A3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=9E=B6=E6=9E=84=E6=9F=A5=E7=9C=8B=E5=99=A8=EF=BC=9B?= =?UTF-8?q?=20*=20=E4=BF=AE=E6=AD=A3=E6=95=B0=E6=8D=AE=E5=BA=93=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=94=9F=E6=88=90=E5=99=A8=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++++- src/Kalman.Studio/ToolForm/DbDocBuilder.cs | 18 ++++++++++++++---- src/Kalman.Studio/ToolForm/DbSchemaViewer.cs | 13 ++++++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) 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",