Forráskód Böngészése

Merge branch 'OTSRelease3_2' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_2

gsp 7 hónapja
szülő
commit
8964511a01

+ 2 - 1
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ModifyCategoryForm.Designer.cs

@@ -117,7 +117,8 @@
             this.ClientSize = new System.Drawing.Size(388, 148);
             this.Controls.Add(this.panel1);
             this.Name = "ModifyCategoryForm";
-            this.Text = "ModifyCategoryForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "重新分类颗粒";
             this.Load += new System.EventHandler(this.ModifyCategoryForm_Load);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();

+ 16 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ModifyCategoryForm.cs

@@ -85,6 +85,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 MessageBox.Show("类别名称不能为空!");
                 return false;
             }
+
             int TypeId = 50000 + inputData.Rows.Count + 1;
             string TypeName = textBox1.Text;
             Random random = new Random();
@@ -95,10 +96,25 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // 创建Color对象
             string hexColor = $"#{r:X2}{g:X2}{b:X2}";
             string NewCategory = "New Category";
+
+
+            for (int i = 0; i < inputData.Rows.Count; i++)
+            {
+                if (textBox1.Text == inputData.Rows[i]["TypeName"].ToString())
+                {
+                    TypeId = Convert.ToInt32(inputData.Rows[i]["TypeId"]);
+                    TypeName = inputData.Rows[i]["TypeName"].ToString();
+                    hexColor = inputData.Rows[i]["TypeColor"].ToString();
+                    NewCategory = inputData.Rows[i]["GroupName"].ToString();
+                    break;
+                }
+            }
+
             OutTypeAndName.Add(TypeId.ToString());
             OutTypeAndName.Add(TypeName);
             OutTypeAndName.Add(hexColor);
             OutTypeAndName.Add(NewCategory);
+
             DoYouWantToModifyIt = true;
             return true;
         }

+ 0 - 8
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -1120,7 +1120,6 @@ namespace OTSIncAReportGrids
             string TypeColor = "";
             string GroupName = "";
             DataTable da = Particledata.GetParticleListForParticlSize("area", "");
-           
             ModifyCategoryForm modifyCategoryForm = new ModifyCategoryForm(da, CategoryName);
             DialogResult result = modifyCategoryForm.ShowDialog();
             if(modifyCategoryForm.DoYouWantToModifyIt)
@@ -1130,7 +1129,6 @@ namespace OTSIncAReportGrids
                 TypeColor = modifyCategoryForm.OutTypeAndName[2];
                 GroupName = modifyCategoryForm.OutTypeAndName[3];
 
-
                 List<string> strings = new List<string>();
                 strings.Add(TypeId);
                 strings.Add(TypeName);
@@ -1154,12 +1152,6 @@ namespace OTSIncAReportGrids
                 }
                 Particledata.ExecuteNonQueryBatch(cmdlist);
             }
-        
-            
-    
-            
-
-
         }
 
         private void ToolStripMenuItem5_Click(object sender, EventArgs e)