|
@@ -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;
|
|
|
}
|