浏览代码

报告程序元素成分选择颗粒为空修改bug

CXS 3 年之前
父节点
当前提交
3c3dcb9aaa
共有 1 个文件被更改,包括 20 次插入16 次删除
  1. 20 16
      OTSIncAReportApp/1-UI/Control_Grids/ElementContentGrid.cs

+ 20 - 16
OTSIncAReportApp/1-UI/Control_Grids/ElementContentGrid.cs

@@ -53,7 +53,6 @@ namespace OTSIncAReportGrids
             }
 
             int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            //int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             string filedAndParticle = "";
             if (sel == 1)
             {
@@ -66,25 +65,30 @@ namespace OTSIncAReportGrids
                 {
                     filedAndParticle = filedAndParticle + ",";
                 }
-            }
 
-            if (filedAndParticle != "")
-            {
-                DataTable dt = particledata.GetElementForArea(filedAndParticle);
-                double totalArea = 0;
-                foreach (DataRow item in dt.Rows)
+
+                if (filedAndParticle != "")
                 {
-                    totalArea += Convert.ToDouble(item["earea"]);
+                    DataTable dt = particledata.GetElementForArea(filedAndParticle);
+                    double totalArea = 0;
+                    foreach (DataRow item in dt.Rows)
+                    {
+                        totalArea += Convert.ToDouble(item["earea"]);
+                    }
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        int add_rowindex = gridView.Rows.Add();
+                        gridView.Rows[i].Cells[0].Value = (i + 1).ToString();
+                        gridView.Rows[i].Cells[1].Value = dt.Rows[i]["name"];
+                        double d = Convert.ToDouble(dt.Rows[i]["earea"]) / totalArea;
+                        gridView.Rows[i].Cells[2].Value = Math.Round(d, 6) * 100;
+                        gridView.Rows[i].Cells[1].Style.BackColor = Color.Azure;
+                        gridView.Rows[i].Cells[2].Style.BackColor = Color.Azure;
+                    }
                 }
-                for (int i = 0; i < dt.Rows.Count; i++)
+                else
                 {
-                    int add_rowindex = gridView.Rows.Add();
-                    gridView.Rows[i].Cells[0].Value = (i + 1).ToString();
-                    gridView.Rows[i].Cells[1].Value = dt.Rows[i]["name"];
-                    double d = Convert.ToDouble(dt.Rows[i]["earea"]) / totalArea;
-                    gridView.Rows[i].Cells[2].Value = Math.Round(d, 6) * 100;
-                    gridView.Rows[i].Cells[1].Style.BackColor = Color.Azure;
-                    gridView.Rows[i].Cells[2].Style.BackColor = Color.Azure;
+
                 }
             }
             else