فهرست منبع

批量修改bug修复

zhangjiaxin 2 ماه پیش
والد
کامیت
47c1ffc3b3
1فایلهای تغییر یافته به همراه16 افزوده شده و 3 حذف شده
  1. 16 3
      OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ModifyCategoryForm.cs

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

@@ -1,5 +1,6 @@
 using DevExpress.Utils;
 using DevExpress.XtraDiagram.Bars;
+using DevExpress.XtraReports.Design;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -81,10 +82,22 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 MessageBox.Show("类别名称不能为空!");
                 return false;
             }
+            int ti = 0;
+            for (int i = 0; i < inputData.Rows.Count; i++)
+            {
+                if (ti < Convert.ToInt32(inputData.Rows[i]["STDId"]))
+                {
+                    ti = Convert.ToInt32(inputData.Rows[i]["STDId"]);
+				}
+            }
+            int TypeId = 50001;
 
-
-
-            int TypeId = 50000 + inputData.Rows.Count + 1;
+            if (ti > 50000)
+            {
+                TypeId = ti + 1;
+            }
+          
+                //int TypeId = 50000 + inputData.Rows.Count + 1;
             string TypeName = textBox1.Text;
     
             string hexColor = RandomColor();