diff --git a/DatabasetoEntityclass/Form1.Designer.cs b/DatabasetoEntityclass/Form1.Designer.cs index 0c42575..8b1c672 100644 --- a/DatabasetoEntityclass/Form1.Designer.cs +++ b/DatabasetoEntityclass/Form1.Designer.cs @@ -52,6 +52,7 @@ this.isGeneratorValidateClass = new System.Windows.Forms.CheckBox(); this.label8 = new System.Windows.Forms.Label(); this.isGeneratorDynamicTableName = new System.Windows.Forms.CheckBox(); + this.openGeneratorFolder = new System.Windows.Forms.Button(); this.SuspendLayout(); // // modelGen @@ -159,7 +160,7 @@ // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(87, 405); + this.label4.Location = new System.Drawing.Point(73, 405); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(827, 12); this.label4.TabIndex = 77; @@ -234,11 +235,11 @@ // databaseLable // this.databaseLable.AutoSize = true; - this.databaseLable.Location = new System.Drawing.Point(140, 17); + this.databaseLable.Location = new System.Drawing.Point(123, 16); this.databaseLable.Name = "databaseLable"; - this.databaseLable.Size = new System.Drawing.Size(41, 12); + this.databaseLable.Size = new System.Drawing.Size(65, 12); this.databaseLable.TabIndex = 84; - this.databaseLable.Text = "表名:"; + this.databaseLable.Text = "数据库名:"; // // label7 // @@ -276,11 +277,22 @@ this.isGeneratorDynamicTableName.TabIndex = 88; this.isGeneratorDynamicTableName.UseVisualStyleBackColor = true; // + // openGeneratorFolder + // + this.openGeneratorFolder.Location = new System.Drawing.Point(208, 322); + this.openGeneratorFolder.Name = "openGeneratorFolder"; + this.openGeneratorFolder.Size = new System.Drawing.Size(102, 23); + this.openGeneratorFolder.TabIndex = 90; + this.openGeneratorFolder.Text = "打开生成目录"; + this.openGeneratorFolder.UseVisualStyleBackColor = true; + this.openGeneratorFolder.Click += new System.EventHandler(this.openGeneratorFolder_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1065, 778); + this.Controls.Add(this.openGeneratorFolder); this.Controls.Add(this.label8); this.Controls.Add(this.isGeneratorDynamicTableName); this.Controls.Add(this.label7); @@ -339,6 +351,7 @@ private System.Windows.Forms.CheckBox isGeneratorValidateClass; private System.Windows.Forms.Label label8; private System.Windows.Forms.CheckBox isGeneratorDynamicTableName; + private System.Windows.Forms.Button openGeneratorFolder; } } diff --git a/DatabasetoEntityclass/Form1.cs b/DatabasetoEntityclass/Form1.cs index 8e69ddb..87783e9 100644 --- a/DatabasetoEntityclass/Form1.cs +++ b/DatabasetoEntityclass/Form1.cs @@ -2,8 +2,10 @@ using System.Collections.Generic; using System.IO; using System.Windows.Forms; +using System.Xml.Linq; using GenerateClass.Util; using JinianNet.JNTemplate; +using MySqlX.XDevAPI.Common; using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace GenerateClass @@ -222,5 +224,10 @@ namespace GenerateClass this.txt_tablename.Text = ""; this.txt_tablename.Items.AddRange(DbUtil.GetTableName().ToArray()); } + + private void openGeneratorFolder_Click(object sender, EventArgs e) + { + DbUtil.openFile(); + } } } diff --git a/DatabasetoEntityclass/SystemConfig.xml b/DatabasetoEntityclass/SystemConfig.xml index 4c820be..c73756d 100644 --- a/DatabasetoEntityclass/SystemConfig.xml +++ b/DatabasetoEntityclass/SystemConfig.xml @@ -1,6 +1,6 @@  - + diff --git a/DatabasetoEntityclass/Template/ModelFile.template b/DatabasetoEntityclass/Template/ModelFile.template index 1ddac57..f8c89ae 100644 --- a/DatabasetoEntityclass/Template/ModelFile.template +++ b/DatabasetoEntityclass/Template/ModelFile.template @@ -4,7 +4,7 @@ using FluentValidation; $end using System.ComponentModel; using NCA_MES_Models.CommonUtils.DB.DBAttribute; -//using NCA_MES_Models.CommUtil.DB.DBAttribute; +//using NAC_MES_InterfaceLib.CommUtil.DB.DBAttribute; namespace ${namespace_name} { /// diff --git a/DatabasetoEntityclass/Util/DbUtil.cs b/DatabasetoEntityclass/Util/DbUtil.cs index 2cc802c..55afa34 100644 --- a/DatabasetoEntityclass/Util/DbUtil.cs +++ b/DatabasetoEntityclass/Util/DbUtil.cs @@ -24,7 +24,14 @@ namespace GenerateClass.Util // 打开文件夹 System.Diagnostics.Process.Start(folderPath); } - + public static void openFile() + { + // 创建文件夹 + string folderPath = Path.Combine(Environment.CurrentDirectory, folderName); + Directory.CreateDirectory(folderPath); + // 打开文件夹 + System.Diagnostics.Process.Start(folderPath); + } public static string joinList(List list) { string str = "";