Browse Source

修复bug颗粒列表去除多个元素时发生程序报错问题

zhangjiaxin 2 năm trước cách đây
mục cha
commit
cba9e5d793

+ 6 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -1148,6 +1148,12 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             #endregion
             return DT_Largest20;
         }
+        /// <summary>
+        /// 参数归一化
+        /// </summary>
+        /// <param name="a_mi">总数</param>
+        /// <param name="m">传参</param>
+        /// <returns></returns>
         private string ParameterNormalization(double a_mi,double m)
         {
             double ColVal = Convert.ToDouble(m / a_mi * 100);

+ 9 - 11
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -488,20 +488,13 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 particlesAll = dt.Copy();
                 particlesAll.Columns.Add("Element");
             }
-            //particlesAll = GetInfoForPartucleDevidePage2("");
-
-            //DataTable elementchemistry = GetElementChemistry();
+   
 
             DataTable dt_element = GetElementChemistry();
             DataTable elementchemistry = dt_element.Copy();
 
-            //for (int i = 0; i < dt_element.Rows.Count; i++)
-            //{
-            //    if (dt_element.Rows[i]["Name"].ToString() != "Fe")
-            //    {
-            //        elementchemistry.Rows.Add(dt_element.Rows[i].ItemArray);
-            //    }
-            //}
+          
+            List<int> list_int = new List<int>();
 
             for (int a=0;a<lst_str.Count;a++)
             {
@@ -509,10 +502,15 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 {
                     if (elementchemistry.Rows[i]["Name"].ToString() == lst_str[a].ToString())
                     {
-                        elementchemistry.Rows[i].Delete();
+                        list_int.Add(i);
                     }
                 }
             }
+            
+            for (int i=0;i< list_int.Count;i++)
+            {
+                elementchemistry.Rows[list_int[i]].Delete();
+            }
             elementchemistry.AcceptChanges();
 
             for (int i = 0; i < particlesAll.Rows.Count; i++)

+ 1 - 1
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -745,7 +745,7 @@
     <EmbeddedResource Include="1-UI\OTSTemplateDesigner\OTSReport_TemplateDesignerRM.resx">
       <DependentUpon>OTSReport_TemplateDesignerRM.cs</DependentUpon>
     </EmbeddedResource>
-   
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="ReportTemplate\GBReport.resx">
       <DependentUpon>GBReport.cs</DependentUpon>
     </EmbeddedResource>