From 4250485f05bf6a4019bc4fd0ed7379bef982d0ef Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周日, 04 5月 2025 10:11:27 +0800 Subject: [PATCH] 22 --- Weben_CMS专用代码生成器/Code/MainForm.cs | 39 ++-- Weben_CMS专用代码生成器/Code/Utility/TextHelper.cs | 105 +++++++++++++ Weben_CMS专用代码生成器/Code/MainForm.Designer.cs | 275 ++++++++++++++++++++-------------- Weben_CMS专用代码生成器/Code/GenerateCode_WeiBen_CMS.csproj | 1 Weben_CMS专用代码生成器/Code/Const/SystemConst.cs | 20 ++ 5 files changed, 310 insertions(+), 130 deletions(-) diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Const/SystemConst.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Const/SystemConst.cs" new file mode 100644 index 0000000..5fcf4a6 --- /dev/null +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Const/SystemConst.cs" @@ -0,0 +1,20 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GenerateCode_WeiBen_WMS.Const +{ + public class SystemConst + { + /// <summary> + /// 鏈嶅姟灞傜殑鏂囦欢澶瑰悕绉� + /// </summary> + public const string server_FolerName = @"\server\"; + /// <summary> + /// 鍓嶇鐨勬枃浠跺す鍚嶇О + /// </summary> + public const string web_FolerName = @"\web\"; + } +} diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/GenerateCode_WeiBen_CMS.csproj" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/GenerateCode_WeiBen_CMS.csproj" index d226dfc..b0f4400 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/GenerateCode_WeiBen_CMS.csproj" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/GenerateCode_WeiBen_CMS.csproj" @@ -101,6 +101,7 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Const\SystemConst.cs" /> <Compile Include="DataBaseFactory\DataBaseServiceHandle.cs" /> <Compile Include="DataBaseFactory\DataBaseServiceFactory.cs" /> <Compile Include="DataBaseFactory\Default\SqlServerDataBaseServiceHandle.cs" /> diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" index 4b815f1..fe3e9df 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" @@ -59,6 +59,8 @@ this.tb_RoutePrefix = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label17 = new System.Windows.Forms.Label(); + this.cmb_DataBase = new System.Windows.Forms.ComboBox(); this.lbl_DataSource = new System.Windows.Forms.Label(); this.cmb_DataSource = new System.Windows.Forms.ComboBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); @@ -72,8 +74,6 @@ this.label12 = new System.Windows.Forms.Label(); this.tb_templeteFileDownName = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); - this.cmb_DataBase = new System.Windows.Forms.ComboBox(); - this.label17 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -81,9 +81,10 @@ // // btnPath // - this.btnPath.Location = new System.Drawing.Point(425, 570); + this.btnPath.Location = new System.Drawing.Point(567, 712); + this.btnPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnPath.Name = "btnPath"; - this.btnPath.Size = new System.Drawing.Size(97, 23); + this.btnPath.Size = new System.Drawing.Size(129, 29); this.btnPath.TabIndex = 1; this.btnPath.Text = "閫夋嫨鐢熸垚璺緞"; this.btnPath.UseVisualStyleBackColor = true; @@ -92,25 +93,28 @@ // lblds // this.lblds.AutoSize = true; - this.lblds.Location = new System.Drawing.Point(22, 72); + this.lblds.Location = new System.Drawing.Point(29, 90); + this.lblds.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblds.Name = "lblds"; - this.lblds.Size = new System.Drawing.Size(35, 12); + this.lblds.Size = new System.Drawing.Size(45, 15); this.lblds.TabIndex = 2; this.lblds.Text = "琛ㄥ悕:"; // // tbPath // - this.tbPath.Location = new System.Drawing.Point(106, 566); + this.tbPath.Location = new System.Drawing.Point(141, 708); + this.tbPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tbPath.Name = "tbPath"; this.tbPath.ReadOnly = true; - this.tbPath.Size = new System.Drawing.Size(253, 21); + this.tbPath.Size = new System.Drawing.Size(336, 25); this.tbPath.TabIndex = 7; // // btnExit // - this.btnExit.Location = new System.Drawing.Point(649, 600); + this.btnExit.Location = new System.Drawing.Point(865, 750); + this.btnExit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnExit.Name = "btnExit"; - this.btnExit.Size = new System.Drawing.Size(171, 67); + this.btnExit.Size = new System.Drawing.Size(228, 84); this.btnExit.TabIndex = 8; this.btnExit.Text = "閫�鍑�"; this.btnExit.UseVisualStyleBackColor = true; @@ -118,9 +122,10 @@ // // btn_CreateFile // - this.btn_CreateFile.Location = new System.Drawing.Point(106, 600); + this.btn_CreateFile.Location = new System.Drawing.Point(141, 750); + this.btn_CreateFile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btn_CreateFile.Name = "btn_CreateFile"; - this.btn_CreateFile.Size = new System.Drawing.Size(157, 67); + this.btn_CreateFile.Size = new System.Drawing.Size(209, 84); this.btn_CreateFile.TabIndex = 14; this.btn_CreateFile.Text = "鐢熸垚鏂囦欢"; this.btn_CreateFile.UseVisualStyleBackColor = true; @@ -128,187 +133,210 @@ // // tb_TableName // - this.tb_TableName.Location = new System.Drawing.Point(92, 69); + this.tb_TableName.Location = new System.Drawing.Point(123, 86); + this.tb_TableName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_TableName.Name = "tb_TableName"; - this.tb_TableName.Size = new System.Drawing.Size(183, 21); + this.tb_TableName.Size = new System.Drawing.Size(243, 25); this.tb_TableName.TabIndex = 15; this.tb_TableName.TextChanged += new System.EventHandler(this.tb_TableName_TextChanged); // // tb_FileName // - this.tb_FileName.Location = new System.Drawing.Point(221, 152); + this.tb_FileName.Location = new System.Drawing.Point(295, 190); + this.tb_FileName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_FileName.Name = "tb_FileName"; - this.tb_FileName.Size = new System.Drawing.Size(199, 21); + this.tb_FileName.Size = new System.Drawing.Size(264, 25); this.tb_FileName.TabIndex = 17; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(25, 154); + this.label1.Location = new System.Drawing.Point(33, 192); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(191, 12); + this.label1.Size = new System.Drawing.Size(241, 15); this.label1.TabIndex = 16; this.label1.Text = "鏂囦欢鍚嶇О(鐢ㄤ簬缁欏悇涓被鍚嶇殑鍓嶇紑):"; // // tb_WCF_NameSpacePath // - this.tb_WCF_NameSpacePath.Location = new System.Drawing.Point(563, 247); + this.tb_WCF_NameSpacePath.Location = new System.Drawing.Point(751, 309); + this.tb_WCF_NameSpacePath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_WCF_NameSpacePath.Name = "tb_WCF_NameSpacePath"; - this.tb_WCF_NameSpacePath.Size = new System.Drawing.Size(197, 21); + this.tb_WCF_NameSpacePath.Size = new System.Drawing.Size(261, 25); this.tb_WCF_NameSpacePath.TabIndex = 19; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(455, 249); + this.label2.Location = new System.Drawing.Point(607, 311); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(101, 12); + this.label2.Size = new System.Drawing.Size(105, 15); this.label2.TabIndex = 18; - this.label2.Text = "WCF椤圭洰鍛藉悕绌洪棿:"; + this.label2.Text = "椤圭洰鍛藉悕绌洪棿:"; // // tb_ChinaComment // - this.tb_ChinaComment.Location = new System.Drawing.Point(221, 234); + this.tb_ChinaComment.Location = new System.Drawing.Point(295, 292); + this.tb_ChinaComment.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_ChinaComment.Name = "tb_ChinaComment"; - this.tb_ChinaComment.Size = new System.Drawing.Size(197, 21); + this.tb_ChinaComment.Size = new System.Drawing.Size(261, 25); this.tb_ChinaComment.TabIndex = 23; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(26, 234); + this.label4.Location = new System.Drawing.Point(35, 292); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(83, 12); + this.label4.Size = new System.Drawing.Size(105, 15); this.label4.TabIndex = 22; this.label4.Text = "琛ㄧ殑涓枃娉ㄨВ:"; // // tb_CreatePerson // - this.tb_CreatePerson.Location = new System.Drawing.Point(221, 279); + this.tb_CreatePerson.Location = new System.Drawing.Point(295, 349); + this.tb_CreatePerson.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_CreatePerson.Name = "tb_CreatePerson"; - this.tb_CreatePerson.Size = new System.Drawing.Size(199, 21); + this.tb_CreatePerson.Size = new System.Drawing.Size(264, 25); this.tb_CreatePerson.TabIndex = 25; // // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(26, 289); + this.label5.Location = new System.Drawing.Point(35, 361); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(107, 12); + this.label5.Size = new System.Drawing.Size(135, 15); this.label5.TabIndex = 24; this.label5.Text = "浣犵殑鍚嶅瓧鎷奸煶缂╁啓:"; // // tb_Primary // - this.tb_Primary.Location = new System.Drawing.Point(338, 69); + this.tb_Primary.Location = new System.Drawing.Point(451, 86); + this.tb_Primary.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_Primary.Name = "tb_Primary"; - this.tb_Primary.Size = new System.Drawing.Size(145, 21); + this.tb_Primary.Size = new System.Drawing.Size(192, 25); this.tb_Primary.TabIndex = 27; // // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(298, 72); + this.label6.Location = new System.Drawing.Point(397, 90); + this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(35, 12); + this.label6.Size = new System.Drawing.Size(45, 15); this.label6.TabIndex = 26; this.label6.Text = "涓婚敭:"; // // tb_EntityProName // - this.tb_EntityProName.Location = new System.Drawing.Point(560, 141); + this.tb_EntityProName.Location = new System.Drawing.Point(747, 176); + this.tb_EntityProName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_EntityProName.Name = "tb_EntityProName"; - this.tb_EntityProName.Size = new System.Drawing.Size(183, 21); + this.tb_EntityProName.Size = new System.Drawing.Size(243, 25); this.tb_EntityProName.TabIndex = 31; this.tb_EntityProName.TextChanged += new System.EventHandler(this.tb_EntityProName_TextChanged); // // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(436, 149); + this.label7.Location = new System.Drawing.Point(581, 186); + this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(125, 12); + this.label7.Size = new System.Drawing.Size(158, 15); this.label7.TabIndex = 30; this.label7.Text = "瀹炰綋绫诲璞″悕/琛ㄥ埆鍚�:"; // // tb_EntityName // - this.tb_EntityName.Location = new System.Drawing.Point(92, 108); + this.tb_EntityName.Location = new System.Drawing.Point(123, 135); + this.tb_EntityName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_EntityName.Name = "tb_EntityName"; - this.tb_EntityName.Size = new System.Drawing.Size(183, 21); + this.tb_EntityName.Size = new System.Drawing.Size(243, 25); this.tb_EntityName.TabIndex = 29; // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(22, 111); + this.label8.Location = new System.Drawing.Point(29, 139); + this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(59, 12); + this.label8.Size = new System.Drawing.Size(75, 15); this.label8.TabIndex = 28; this.label8.Text = "瀹炰綋绫诲悕:"; // // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(463, 210); + this.label9.Location = new System.Drawing.Point(617, 262); + this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(35, 12); + this.label9.Size = new System.Drawing.Size(45, 15); this.label9.TabIndex = 34; this.label9.Text = "鎺掑簭:"; // // tb_OrderBy // - this.tb_OrderBy.Location = new System.Drawing.Point(503, 207); + this.tb_OrderBy.Location = new System.Drawing.Point(671, 259); + this.tb_OrderBy.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_OrderBy.Name = "tb_OrderBy"; - this.tb_OrderBy.Size = new System.Drawing.Size(145, 21); + this.tb_OrderBy.Size = new System.Drawing.Size(192, 25); this.tb_OrderBy.TabIndex = 35; // // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(668, 210); + this.label10.Location = new System.Drawing.Point(891, 262); + this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(65, 12); + this.label10.Size = new System.Drawing.Size(83, 15); this.label10.TabIndex = 36; this.label10.Text = "(榛樿闄嶅簭)"; // // tb_PrimaryDesc // - this.tb_PrimaryDesc.Location = new System.Drawing.Point(569, 69); + this.tb_PrimaryDesc.Location = new System.Drawing.Point(759, 86); + this.tb_PrimaryDesc.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_PrimaryDesc.Name = "tb_PrimaryDesc"; - this.tb_PrimaryDesc.Size = new System.Drawing.Size(145, 21); + this.tb_PrimaryDesc.Size = new System.Drawing.Size(192, 25); this.tb_PrimaryDesc.TabIndex = 38; // // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(508, 72); + this.label11.Location = new System.Drawing.Point(677, 90); + this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(59, 12); + this.label11.Size = new System.Drawing.Size(75, 15); this.label11.TabIndex = 37; this.label11.Text = "涓婚敭鎻忚堪:"; // // tb_Modulelogo // - this.tb_Modulelogo.Location = new System.Drawing.Point(221, 202); + this.tb_Modulelogo.Location = new System.Drawing.Point(295, 252); + this.tb_Modulelogo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_Modulelogo.Name = "tb_Modulelogo"; - this.tb_Modulelogo.Size = new System.Drawing.Size(199, 21); + this.tb_Modulelogo.Size = new System.Drawing.Size(264, 25); this.tb_Modulelogo.TabIndex = 41; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(25, 206); + this.label3.Location = new System.Drawing.Point(33, 258); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(167, 12); + this.label3.Size = new System.Drawing.Size(211, 15); this.label3.TabIndex = 40; this.label3.Text = "妯″潡绠�鍐�(鐢ㄤ簬缁欏悇涓柟娉曞悕):"; // // btn_InsertSql // - this.btn_InsertSql.Location = new System.Drawing.Point(385, 600); + this.btn_InsertSql.Location = new System.Drawing.Point(513, 750); + this.btn_InsertSql.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btn_InsertSql.Name = "btn_InsertSql"; - this.btn_InsertSql.Size = new System.Drawing.Size(157, 67); + this.btn_InsertSql.Size = new System.Drawing.Size(209, 84); this.btn_InsertSql.TabIndex = 42; this.btn_InsertSql.Text = "鐢熸垚InitSQL"; this.btn_InsertSql.UseVisualStyleBackColor = true; @@ -317,18 +345,20 @@ // // tb_RoutePrefix // - this.tb_RoutePrefix.Location = new System.Drawing.Point(538, 276); + this.tb_RoutePrefix.Location = new System.Drawing.Point(717, 345); + this.tb_RoutePrefix.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_RoutePrefix.Name = "tb_RoutePrefix"; - this.tb_RoutePrefix.Size = new System.Drawing.Size(145, 21); + this.tb_RoutePrefix.Size = new System.Drawing.Size(192, 25); this.tb_RoutePrefix.TabIndex = 44; this.tb_RoutePrefix.Text = "1111"; // // label13 // this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(463, 282); + this.label13.Location = new System.Drawing.Point(617, 352); + this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(77, 12); + this.label13.Size = new System.Drawing.Size(99, 15); this.label13.TabIndex = 43; this.label13.Text = "WCF璺敱鍓嶇紑:"; this.label13.Click += new System.EventHandler(this.label13_Click); @@ -339,28 +369,52 @@ this.groupBox1.Controls.Add(this.cmb_DataBase); this.groupBox1.Controls.Add(this.lbl_DataSource); this.groupBox1.Controls.Add(this.cmb_DataSource); - this.groupBox1.Location = new System.Drawing.Point(51, 12); + this.groupBox1.Location = new System.Drawing.Point(68, 15); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(819, 72); + this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox1.Size = new System.Drawing.Size(1092, 90); this.groupBox1.TabIndex = 45; this.groupBox1.TabStop = false; this.groupBox1.Text = "鏁版嵁搴撻厤缃�"; // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(637, 29); + this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(82, 15); + this.label17.TabIndex = 3; + this.label17.Text = "鏁版嵁搴撶被鍨�"; + // + // cmb_DataBase + // + this.cmb_DataBase.FormattingEnabled = true; + this.cmb_DataBase.Location = new System.Drawing.Point(775, 25); + this.cmb_DataBase.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cmb_DataBase.Name = "cmb_DataBase"; + this.cmb_DataBase.Size = new System.Drawing.Size(273, 23); + this.cmb_DataBase.TabIndex = 2; + this.cmb_DataBase.SelectedIndexChanged += new System.EventHandler(this.cmb_DataBase_SelectedIndexChanged); + // // lbl_DataSource // this.lbl_DataSource.AutoSize = true; - this.lbl_DataSource.Location = new System.Drawing.Point(10, 48); + this.lbl_DataSource.Location = new System.Drawing.Point(13, 60); + this.lbl_DataSource.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbl_DataSource.Name = "lbl_DataSource"; - this.lbl_DataSource.Size = new System.Drawing.Size(89, 12); + this.lbl_DataSource.Size = new System.Drawing.Size(112, 15); this.lbl_DataSource.TabIndex = 1; this.lbl_DataSource.Text = "鎴戞槸閾炬帴瀛楃涓�"; // // cmb_DataSource // this.cmb_DataSource.FormattingEnabled = true; - this.cmb_DataSource.Location = new System.Drawing.Point(6, 20); + this.cmb_DataSource.Location = new System.Drawing.Point(8, 25); + this.cmb_DataSource.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.cmb_DataSource.Name = "cmb_DataSource"; - this.cmb_DataSource.Size = new System.Drawing.Size(206, 20); + this.cmb_DataSource.Size = new System.Drawing.Size(273, 23); this.cmb_DataSource.TabIndex = 0; this.cmb_DataSource.SelectedIndexChanged += new System.EventHandler(this.cmb_DataSource_SelectedIndexChanged); // @@ -396,43 +450,49 @@ this.groupBox2.Controls.Add(this.tb_EntityProName); this.groupBox2.Controls.Add(this.tb_EntityName); this.groupBox2.Controls.Add(this.label7); - this.groupBox2.Location = new System.Drawing.Point(51, 90); + this.groupBox2.Location = new System.Drawing.Point(68, 112); + this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(819, 470); + this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox2.Size = new System.Drawing.Size(1092, 588); this.groupBox2.TabIndex = 46; this.groupBox2.TabStop = false; this.groupBox2.Text = "鑷畾涔夐厤缃�"; // // tb_GroupName // - this.tb_GroupName.Location = new System.Drawing.Point(350, 108); + this.tb_GroupName.Location = new System.Drawing.Point(467, 135); + this.tb_GroupName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_GroupName.Name = "tb_GroupName"; - this.tb_GroupName.Size = new System.Drawing.Size(183, 21); + this.tb_GroupName.Size = new System.Drawing.Size(243, 25); this.tb_GroupName.TabIndex = 50; // // label16 // this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(298, 111); + this.label16.Location = new System.Drawing.Point(397, 139); + this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(47, 12); + this.label16.Size = new System.Drawing.Size(60, 15); this.label16.TabIndex = 49; this.label16.Text = "鍒嗙粍鍚�:"; // // label15 // this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(26, 24); + this.label15.Location = new System.Drawing.Point(35, 30); + this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(71, 12); + this.label15.Size = new System.Drawing.Size(90, 15); this.label15.TabIndex = 47; this.label15.Text = "椤圭洰鍚嶅墠缂�:"; // // tb_ProjectNamePrefix // - this.tb_ProjectNamePrefix.Location = new System.Drawing.Point(104, 21); + this.tb_ProjectNamePrefix.Location = new System.Drawing.Point(139, 26); + this.tb_ProjectNamePrefix.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_ProjectNamePrefix.Name = "tb_ProjectNamePrefix"; - this.tb_ProjectNamePrefix.Size = new System.Drawing.Size(183, 21); + this.tb_ProjectNamePrefix.Size = new System.Drawing.Size(243, 25); this.tb_ProjectNamePrefix.TabIndex = 48; // // groupBox3 @@ -442,29 +502,30 @@ this.groupBox3.Controls.Add(this.label12); this.groupBox3.Controls.Add(this.tb_templeteFileDownName); this.groupBox3.Controls.Add(this.label14); - this.groupBox3.Location = new System.Drawing.Point(28, 316); - this.groupBox3.Margin = new System.Windows.Forms.Padding(2); + this.groupBox3.Location = new System.Drawing.Point(37, 395); + this.groupBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Padding = new System.Windows.Forms.Padding(2); - this.groupBox3.Size = new System.Drawing.Size(272, 118); + this.groupBox3.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox3.Size = new System.Drawing.Size(363, 148); this.groupBox3.TabIndex = 46; this.groupBox3.TabStop = false; this.groupBox3.Text = "瀵煎叆鍔熻兘"; // // tb_importExcelCategroy // - this.tb_importExcelCategroy.Location = new System.Drawing.Point(143, 86); + this.tb_importExcelCategroy.Location = new System.Drawing.Point(191, 108); + this.tb_importExcelCategroy.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_importExcelCategroy.Name = "tb_importExcelCategroy"; - this.tb_importExcelCategroy.Size = new System.Drawing.Size(113, 21); + this.tb_importExcelCategroy.Size = new System.Drawing.Size(149, 25); this.tb_importExcelCategroy.TabIndex = 50; // // ck_IsShowImport // this.ck_IsShowImport.AutoSize = true; - this.ck_IsShowImport.Location = new System.Drawing.Point(21, 30); - this.ck_IsShowImport.Margin = new System.Windows.Forms.Padding(2); + this.ck_IsShowImport.Location = new System.Drawing.Point(28, 38); + this.ck_IsShowImport.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ck_IsShowImport.Name = "ck_IsShowImport"; - this.ck_IsShowImport.Size = new System.Drawing.Size(108, 16); + this.ck_IsShowImport.Size = new System.Drawing.Size(134, 19); this.ck_IsShowImport.TabIndex = 45; this.ck_IsShowImport.Text = "鏄惁鏈夊鍏ュ姛鑳�"; this.ck_IsShowImport.UseVisualStyleBackColor = true; @@ -474,51 +535,36 @@ // label12 // this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(9, 94); + this.label12.Location = new System.Drawing.Point(12, 118); + this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(119, 12); + this.label12.Size = new System.Drawing.Size(150, 15); this.label12.TabIndex = 49; this.label12.Text = "涓婁紶鏂囦欢鐨勮姹傚垎绫�:"; // // tb_templeteFileDownName // - this.tb_templeteFileDownName.Location = new System.Drawing.Point(143, 58); + this.tb_templeteFileDownName.Location = new System.Drawing.Point(191, 72); + this.tb_templeteFileDownName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tb_templeteFileDownName.Name = "tb_templeteFileDownName"; - this.tb_templeteFileDownName.Size = new System.Drawing.Size(113, 21); + this.tb_templeteFileDownName.Size = new System.Drawing.Size(149, 25); this.tb_templeteFileDownName.TabIndex = 48; // // label14 // this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(10, 60); + this.label14.Location = new System.Drawing.Point(13, 75); + this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(83, 12); + this.label14.Size = new System.Drawing.Size(105, 15); this.label14.TabIndex = 47; this.label14.Text = "鏂囦欢涓嬭浇鍚嶅瓧:"; // - // cmb_DataBase - // - this.cmb_DataBase.FormattingEnabled = true; - this.cmb_DataBase.Location = new System.Drawing.Point(581, 20); - this.cmb_DataBase.Name = "cmb_DataBase"; - this.cmb_DataBase.Size = new System.Drawing.Size(206, 20); - this.cmb_DataBase.TabIndex = 2; - this.cmb_DataBase.SelectedIndexChanged += new System.EventHandler(this.cmb_DataBase_SelectedIndexChanged); - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(478, 23); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(65, 12); - this.label17.TabIndex = 3; - this.label17.Text = "鏁版嵁搴撶被鍨�"; - // // MainForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(927, 672); + this.ClientSize = new System.Drawing.Size(1236, 840); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.btn_InsertSql); @@ -526,6 +572,7 @@ this.Controls.Add(this.btnExit); this.Controls.Add(this.tbPath); this.Controls.Add(this.btnPath); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "浼熸湰-CMS-浠g爜鐢熸垚鍣�(浼熸湰涓撶敤)V1.0"; diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" index b98d6f0..0c0bbff 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" @@ -6,6 +6,7 @@ using Newtonsoft.Json; using System.Windows.Forms.VisualStyles; using GenerateCode_WeiBen_WMS.DataBaseFactory; +using GenerateCode_WeiBen_WMS.Const; namespace GenerateCode_GEBrilliantFactory { @@ -125,6 +126,12 @@ this.tb_RoutePrefix.Focus(); return; } + if (wcf_NameSpacePath == "") + { + MessageBox.Show("璇疯緭鍏ュ懡鍚嶇┖闂达紒"); + this.tb_WCF_NameSpacePath.Focus(); + return; + } //璇诲彇Mysql var handler = DataBaseServiceFactory.GetHandle(dataBaseEnum); @@ -153,25 +160,25 @@ //鐢熸垚 InputModel 鏂囦欢 str_generate = InputModel_Generate.CreateQueryModelLText(modulelogo, chinaComment, columnList, entityName); - tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); + tf = TextHelper.Export2File_V2(tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Dtos\" + tb_EntityName.Text.Trim(), tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); - //鐢熸垚 OutputModel 鏂囦欢 - str_generate = OutputModel_Generate.CreateQueryModelLText(modulelogo, chinaComment, columnList, entityName); - tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.OutputModel, filePrefixName, entityName, modulelogo); + ////鐢熸垚 OutputModel 鏂囦欢 + //str_generate = OutputModel_Generate.CreateQueryModelLText(modulelogo, chinaComment, columnList, entityName); + //tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.OutputModel, filePrefixName, entityName, modulelogo); - //鐢熸垚Controller鏂囦欢 - //str_generate = Controller_Generate.CreateText(modulelogo, chinaComment, columnList, entityName, orderByName); - //tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.Controller, filePrefixName, entityName, modulelogo); + ////鐢熸垚Controller鏂囦欢 + ////str_generate = Controller_Generate.CreateText(modulelogo, chinaComment, columnList, entityName, orderByName); + ////tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.Controller, filePrefixName, entityName, modulelogo); - //鐢熸垚Services鎺ュ彛鏂囦欢 - str_generate = Services_Interface_Generate.CreateText(wcf_NameSpacePath, modulelogo, entityName, chinaComment, addEntityParam); - tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.WCF_InterFace, filePrefixName, entityName, modulelogo); + ////鐢熸垚Services鎺ュ彛鏂囦欢 + //str_generate = Services_Interface_Generate.CreateText(wcf_NameSpacePath, modulelogo, entityName, chinaComment, addEntityParam); + //tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.WCF_InterFace, filePrefixName, entityName, modulelogo); - //鐢熸垚Services鎺ュ彛瀹炵幇鏂囦欢 - str_generate = Services_InterfaceRealize_Generate.CreateText(wcf_NameSpacePath, modulelogo, - entityName, chinaComment, filePrefixName, primaryKey, tableAlias, addEntityParam, columnList, groupName); - tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.WCF_InterFaceRealize, filePrefixName, entityName, modulelogo); + ////鐢熸垚Services鎺ュ彛瀹炵幇鏂囦欢 + //str_generate = Services_InterfaceRealize_Generate.CreateText(wcf_NameSpacePath, modulelogo, + // entityName, chinaComment, filePrefixName, primaryKey, tableAlias, addEntityParam, columnList, groupName); + //tf = TextHelper.Export2File(tbPath.Text, tableName, str_generate, FileType.WCF_InterFaceRealize, filePrefixName, entityName, modulelogo); /* //鐢熸垚瀛樺偍杩囩▼鏂囦欢 @@ -218,7 +225,7 @@ } //MessageBox.Show("鐢熸垚鏂囦欢鎴愬姛锛�"); //鎴愬姛涔嬪悗鎵撳紑鏂囦欢澶� - using (System.Diagnostics.Process.Start(this.tbPath.Text + "\\" + this.tb_TableName.Text)) + using (System.Diagnostics.Process.Start(this.tbPath.Text)) { } @@ -322,7 +329,7 @@ tb_EntityProName.Enabled = false; tb_FileName.Enabled = false; tb_Modulelogo.Enabled = false; - tb_WCF_NameSpacePath.Enabled = false; + tb_WCF_NameSpacePath.Enabled = true; tb_RoutePrefix.Enabled = false; } diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Utility/TextHelper.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Utility/TextHelper.cs" index 457ca48..c976dd3 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Utility/TextHelper.cs" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Utility/TextHelper.cs" @@ -167,5 +167,110 @@ return true; } + + + /// <summary> + /// 鐢熸垚鏂囦欢 + /// </summary> + /// <param name="_strPath">璺緞</param> + /// <param name="_tableName">琛ㄥ悕</param> + /// <param name="_code">鐢熸垚鐨勪唬鐮佸瓧绗︿覆</param> + /// <param name="fileType">鐢熸垚鐨勬枃浠剁被鍨�</param> + /// <param name="filePrefixName">鍓嶇紑</param> + /// <param name="entityName">瀹炰綋绫诲悕</param> + /// <param name="modulelogo">妯″潡鍚嶅瓧</param> + /// <returns></returns> + public static bool Export2File_V2(string _strPath, string _tableName, string _code, FileType fileType, + string filePrefixName, string entityName, string modulelogo) + { + string fileFolderPath = _strPath + "\\"; + + string fileTypeName = ""; + switch (fileType) + { + case FileType.Model: + fileTypeName = ".cs"; + break; + case FileType.AddModelParam: + entityName = "Add" + modulelogo + "Param"; + fileTypeName = ".cs"; + break; + case FileType.IBLL: + entityName = "I" + filePrefixName + "BLL"; + fileTypeName = ".cs"; + break; + case FileType.Controller: + entityName = entityName + "Controller"; + fileTypeName = ".cs"; + break; + case FileType.JS: + entityName = filePrefixName; + fileTypeName = ".js"; + break; + case FileType.CSHTML_List: + entityName = filePrefixName; + fileTypeName = ".cshtml"; + break; + case FileType.CSHTML_Detail: + entityName = filePrefixName; + fileTypeName = "Detail.cshtml"; + break; + case FileType.XML: + entityName = filePrefixName; + fileTypeName = ".xml"; + break; + case FileType.Proc: + entityName = filePrefixName; + fileTypeName = "Proc.sql"; + break; + case FileType.DAL: + entityName = filePrefixName; + fileTypeName = "DAL.cs"; + break; + case FileType.BLL: + entityName = filePrefixName; + fileTypeName = "BLL.cs"; + break; + case FileType.InputModel: + entityName = entityName + "Input"; + fileTypeName = ".cs"; + break; + case FileType.OutputModel: + entityName = entityName + "Output"; + fileTypeName = ".cs"; + break; + case FileType.WCF_InterFace: + entityName = "I" + entityName + "Service"; + fileTypeName = ".cs"; + break; + case FileType.WCF_InterFaceRealize: + entityName = entityName + "Service"; + fileTypeName = ".cs"; + break; + case FileType.SQL_Insert: + entityName = _tableName + "InsertSQL"; + fileTypeName = ".txt"; + break; + case FileType.VUE_FunConfig: + entityName = _tableName + "VUE鏂规硶閰嶇疆"; + fileTypeName = ".txt"; + break; + case FileType.VUEFile: + entityName = modulelogo; + fileTypeName = ".vue"; + break; + } + if (!Directory.Exists(fileFolderPath)) + { + Directory.CreateDirectory(fileFolderPath); + } + string filePath = fileFolderPath + "\\" + entityName + fileTypeName; + using (StreamWriter outfile = new StreamWriter(filePath, false, Encoding.GetEncoding("UTF-8"))) + { + outfile.Write(_code); + } + + return true; + } } } -- Gitblit v1.9.3