Weben_CMS专用代码生成器/Code/File/GenerateCodeConfigParamFiles/物料信息表配置文本.txt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/GenerateCode_WeiBen_CMS.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/MainForm.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/MainForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/Model/GenerateCodeConfigParam.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/File/GenerateCodeConfigParamFiles/ÎïÁÏÐÅÏ¢±íÅäÖÃÎı¾.txt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ [表å]:scms_wmsmaterials [å®ä½ç±»å]:WmsMaterial [å®ä½ç±»å¯¹è±¡å]:wmsMaterial [页é¢èåå]:ç©æä¿¡æ¯ [页é¢èå对象缩å]:wmsMaterial [表çä¸ææ³¨è§£]:ç©æåºç¡ä¿¡æ¯è¡¨ [é夿§æ ¡éªå段]:MaterialCode [å é¤æç¤ºåæ®µ]:MaterialCode [æ¨¡ç³æ¥è¯¢å段]:'MaterialCode', 'MaterialName', 'Remark' [æ¨¡ç³æ¥è¯¢å段å]:请è¾å ¥ç©æç¼ç /ç©æåç§°/夿³¨ [项ç®å½å空é´]:HIAWms [æä¸¾ç±»ååæ®µéå]:PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|MaterialTypeDesc,IsMainBranch|YesNoEnum|IsMainBranchDesc Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/GenerateCode_WeiBen_CMS.csproj
@@ -249,6 +249,7 @@ <Compile Include="Generate\Web\Views\Pages\EntityNameClass\EntityNameClass_Config_Generate.cs" /> <Compile Include="Generate\Web\Views\Pages\EntityNameClass\EntityNameClass_Generate.cs" /> <Compile Include="Generate\Web\Views\Pages\EntityNameClass\EntityNameClass_module_Generate.cs" /> <Compile Include="Model\GenerateCodeConfigParam.cs" /> <Compile Include="Model\GenerateCodeParam.cs" /> <Compile Include="Model\Enum\DataBaseEnum.cs" /> <Compile Include="Model\Enum\DataTypeEnum.cs" /> @@ -475,6 +476,9 @@ <Content Include="Templete\Web\Views\Pages\EntityNameClass\EntityNameClass模æ¿.txt"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="File\GenerateCodeConfigParamFiles\ç©æä¿¡æ¯é ç½®ææ¬.txt"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="常ç¨.txt" /> </ItemGroup> <ItemGroup /> Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.Designer.cs
@@ -64,6 +64,8 @@ this.lbl_DataSource = new System.Windows.Forms.Label(); this.cmb_DataSource = new System.Windows.Forms.ComboBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tb_DeleteAlertAttr = new System.Windows.Forms.TextBox(); this.label25 = new System.Windows.Forms.Label(); this.tb_ValidateRepeatName = new System.Windows.Forms.TextBox(); this.label24 = new System.Windows.Forms.Label(); this.tb_LikeQueryAttrsName = new System.Windows.Forms.TextBox(); @@ -87,8 +89,9 @@ this.label12 = new System.Windows.Forms.Label(); this.tb_templeteFileDownName = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); this.label25 = new System.Windows.Forms.Label(); this.tb_DeleteAlertAttr = new System.Windows.Forms.TextBox(); this.tb_FilePath = new System.Windows.Forms.TextBox(); this.btn_SelectFile = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -96,7 +99,7 @@ // // btnPath // this.btnPath.Location = new System.Drawing.Point(425, 570); this.btnPath.Location = new System.Drawing.Point(453, 723); this.btnPath.Name = "btnPath"; this.btnPath.Size = new System.Drawing.Size(97, 23); this.btnPath.TabIndex = 1; @@ -115,7 +118,7 @@ // // tbPath // this.tbPath.Location = new System.Drawing.Point(106, 566); this.tbPath.Location = new System.Drawing.Point(134, 719); this.tbPath.Name = "tbPath"; this.tbPath.ReadOnly = true; this.tbPath.Size = new System.Drawing.Size(253, 21); @@ -123,7 +126,7 @@ // // btnExit // this.btnExit.Location = new System.Drawing.Point(649, 600); this.btnExit.Location = new System.Drawing.Point(677, 753); this.btnExit.Name = "btnExit"; this.btnExit.Size = new System.Drawing.Size(171, 67); this.btnExit.TabIndex = 8; @@ -133,7 +136,7 @@ // // btn_CreateFile // this.btn_CreateFile.Location = new System.Drawing.Point(106, 600); this.btn_CreateFile.Location = new System.Drawing.Point(134, 753); this.btn_CreateFile.Name = "btn_CreateFile"; this.btn_CreateFile.Size = new System.Drawing.Size(157, 67); this.btn_CreateFile.TabIndex = 14; @@ -324,7 +327,7 @@ // // btn_InsertSql // this.btn_InsertSql.Location = new System.Drawing.Point(385, 600); this.btn_InsertSql.Location = new System.Drawing.Point(413, 753); this.btn_InsertSql.Name = "btn_InsertSql"; this.btn_InsertSql.Size = new System.Drawing.Size(157, 67); this.btn_InsertSql.TabIndex = 42; @@ -454,6 +457,22 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "èªå®ä¹é ç½®"; // // tb_DeleteAlertAttr // this.tb_DeleteAlertAttr.Location = new System.Drawing.Point(552, 246); this.tb_DeleteAlertAttr.Name = "tb_DeleteAlertAttr"; this.tb_DeleteAlertAttr.Size = new System.Drawing.Size(145, 21); this.tb_DeleteAlertAttr.TabIndex = 65; // // label25 // this.label25.AutoSize = true; this.label25.Location = new System.Drawing.Point(452, 255); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(83, 12); this.label25.TabIndex = 64; this.label25.Text = "å é¤æç¤ºåæ®µ:"; // // tb_ValidateRepeatName // this.tb_ValidateRepeatName.Location = new System.Drawing.Point(402, 108); @@ -555,7 +574,7 @@ // // tb_EnumList // this.tb_EnumList.Location = new System.Drawing.Point(418, 361); this.tb_EnumList.Location = new System.Drawing.Point(431, 361); this.tb_EnumList.Multiline = true; this.tb_EnumList.Name = "tb_EnumList"; this.tb_EnumList.Size = new System.Drawing.Size(369, 104); @@ -654,27 +673,43 @@ this.label14.TabIndex = 47; this.label14.Text = "æä»¶ä¸è½½åå:"; // // label25 // tb_FilePath // this.label25.AutoSize = true; this.label25.Location = new System.Drawing.Point(452, 255); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(83, 12); this.label25.TabIndex = 64; this.label25.Text = "å é¤æç¤ºåæ®µ:"; this.tb_FilePath.Enabled = false; this.tb_FilePath.Location = new System.Drawing.Point(51, 579); this.tb_FilePath.Name = "tb_FilePath"; this.tb_FilePath.Size = new System.Drawing.Size(568, 21); this.tb_FilePath.TabIndex = 47; this.tb_FilePath.TextChanged += new System.EventHandler(this.tb_FilePath_TextChanged); // // tb_DeleteAlertAttr // btn_SelectFile // this.tb_DeleteAlertAttr.Location = new System.Drawing.Point(552, 246); this.tb_DeleteAlertAttr.Name = "tb_DeleteAlertAttr"; this.tb_DeleteAlertAttr.Size = new System.Drawing.Size(145, 21); this.tb_DeleteAlertAttr.TabIndex = 65; this.btn_SelectFile.Location = new System.Drawing.Point(632, 571); this.btn_SelectFile.Name = "btn_SelectFile"; this.btn_SelectFile.Size = new System.Drawing.Size(252, 34); this.btn_SelectFile.TabIndex = 48; this.btn_SelectFile.Text = "è¯·å¨æ¤å¯¼å ¥çæä»£ç éè¦çé ç½®ææ¬ï¼ï¼"; this.btn_SelectFile.UseVisualStyleBackColor = true; this.btn_SelectFile.Click += new System.EventHandler(this.btn_SelectFile_Click); // // button1 // this.button1.Location = new System.Drawing.Point(890, 571); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(108, 34); this.button1.TabIndex = 49; this.button1.Text = "æ¸ ç©ºå¯¼å ¥è·¯å¾ï¼ï¼"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click_1); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1250, 672); this.ClientSize = new System.Drawing.Size(1250, 831); this.Controls.Add(this.button1); this.Controls.Add(this.btn_SelectFile); this.Controls.Add(this.tb_FilePath); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.btn_InsertSql); @@ -760,6 +795,9 @@ private System.Windows.Forms.Label label24; private System.Windows.Forms.TextBox tb_DeleteAlertAttr; private System.Windows.Forms.Label label25; private System.Windows.Forms.TextBox tb_FilePath; private System.Windows.Forms.Button btn_SelectFile; private System.Windows.Forms.Button button1; } } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.cs
@@ -9,6 +9,7 @@ using GenerateCode_WeiBen_WMS.Const; using GenerateCode_WeiBen_WMS.Model; using GenerateCode_WeiBen_WMS.Utility; using System.Xml; namespace GenerateCode_GEBrilliantFactory { @@ -685,5 +686,128 @@ dataBaseEnum = (DataBaseEnum)Enum.Parse(typeof(DataBaseEnum), name); } private void btn_SelectFile_Click(object sender, EventArgs e) { OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.Multiselect = true; fileDialog.Title = "è¯·éæ©æä»¶"; fileDialog.Filter = "æææä»¶(*txt*)|*.txt*"; //设置è¦éæ©çæä»¶çç±»å if (fileDialog.ShowDialog() == DialogResult.OK) { string file = fileDialog.FileName;//è¿åæä»¶ç宿´è·¯å¾ this.tb_FilePath.Text = file; } } private void tb_FilePath_TextChanged(object sender, EventArgs e) { try { string filePath = this.tb_FilePath.Text; string[] lines = File.ReadAllLines(filePath); // å建å®ä½ç±»å¯¹è±¡ GenerateCodeConfigParam entity = new GenerateCodeConfigParam(); // è§£ææ¯ä¸è¡å 容并èµå¼ç»å®ä½ç±»å±æ§ foreach (string line in lines) { if (line.Contains(":")) { string[] parts = line.Split(':'); string propertyName = parts[0].Trim('[', ']'); string propertyValue = parts[1].Trim(); // æ ¹æ®å±æ§åèµå¼ switch (propertyName) { case "表å": entity.表å = propertyValue; break; case "å®ä½ç±»å": entity.å®ä½ç±»å = propertyValue; break; case "å®ä½ç±»å¯¹è±¡å": entity.å®ä½ç±»å¯¹è±¡å = propertyValue; break; case "页é¢èåå": entity.页é¢èåå = propertyValue; break; case "页é¢èå对象缩å": entity.页é¢èå对象缩å = propertyValue; break; case "表çä¸ææ³¨è§£": entity.表çä¸ææ³¨è§£ = propertyValue; break; case "é夿§æ ¡éªå段": entity.é夿§æ ¡éªå段 = propertyValue; break; case "å é¤æç¤ºåæ®µ": entity.å é¤æç¤ºåæ®µ = propertyValue; break; case "æ¨¡ç³æ¥è¯¢å段": entity.æ¨¡ç³æ¥è¯¢å段 = propertyValue; break; case "æ¨¡ç³æ¥è¯¢å段å": entity.æ¨¡ç³æ¥è¯¢å段å = propertyValue; break; case "项ç®å½å空é´": entity.项ç®å½åç©ºé´ = propertyValue; break; case "æä¸¾ç±»ååæ®µéå": entity.æä¸¾ç±»ååæ®µéå = propertyValue; break; } } } //ç»çé¢èµå¼ this.tb_TableName.Text = "";//表å this.tb_WCF_NameSpacePath.Text = "";//表å this.tb_ChinaComment.Text = "";//表å this.tb_MenuName.Text = "";//表å this.tb_PageMenuInstanceName.Text = "";//表å this.tb_EntityName.Text = "";//表å this.tb_LikeQueryAttrs.Text = "";//表å this.tb_LikeQueryAttrsName.Text = "";//表å this.tb_EntityProName.Text = "";//表å this.tb_EnumList.Text = "";//表å this.tb_ValidateRepeatName.Text = "";//表å this.tb_DeleteAlertAttr.Text = "";//表å this.tb_TableName.Text = entity.表å;//表å this.tb_WCF_NameSpacePath.Text = entity.项ç®å½å空é´;//WCF项ç®å½åç©ºé´ this.tb_ChinaComment.Text = entity.表çä¸ææ³¨è§£;//ä¸ææ³¨é this.tb_MenuName.Text = entity.页é¢èåå; this.tb_PageMenuInstanceName.Text = entity.页é¢èå对象缩å; this.tb_EntityName.Text = entity.å®ä½ç±»å;//å®ä½ç±»å this.tb_LikeQueryAttrs.Text = entity.æ¨¡ç³æ¥è¯¢å段; this.tb_LikeQueryAttrsName.Text = entity.æ¨¡ç³æ¥è¯¢å段å; this.tb_EntityProName.Text = entity.å®ä½ç±»å¯¹è±¡å;//å®ä½ç±»å¯¹è±¡å this.tb_EnumList.Text = entity.æä¸¾ç±»ååæ®µéå; this.tb_ValidateRepeatName.Text = entity.é夿§æ ¡éªå段; this.tb_DeleteAlertAttr.Text = entity.å é¤æç¤ºåæ®µ; } catch (FileNotFoundException) { Console.WriteLine("é误: æä»¶æªæ¾å°!"); } catch (Exception ex) { Console.WriteLine($"é误: åçäºä¸ä¸ªæªç¥é误: {ex.Message}"); } } private void button1_Click_1(object sender, EventArgs e) { this.tb_FilePath.Text = ""; } } } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Model/GenerateCodeConfigParam.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,25 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GenerateCode_WeiBen_WMS.Model { internal class GenerateCodeConfigParam { public string 表å { get; set; } public string å®ä½ç±»å { get; set; } public string å®ä½ç±»å¯¹è±¡å { get; set; } public string 页é¢èåå { get; set; } public string 页é¢èå对象缩å { get; set; } public string 表çä¸ææ³¨è§£ { get; set; } public string é夿§æ ¡éªå段 { get; set; } public string å é¤æç¤ºåæ®µ { get; set; } public string æ¨¡ç³æ¥è¯¢å段 { get; set; } public string æ¨¡ç³æ¥è¯¢å段å { get; set; } public string 项ç®å½åç©ºé´ { get; set; } public string æä¸¾ç±»ååæ®µéå { get; set; } } }