cxs 1 month ago
parent
commit
8a995198fb

+ 5 - 5
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -417,7 +417,7 @@ namespace OTSIncAReportGrids
             return true;
         }
 
-        private void DisplayGridView()
+        private void RefreshGridView()
         {
             dgV_ParticlesDevidePage.Visible = false;
             if (m_frm_userprogress.IsDisposed)
@@ -1320,7 +1320,7 @@ namespace OTSIncAReportGrids
         /// </summary>
         private void DrawControl(bool callEvent)
         {
-            DisplayGridView();
+            RefreshGridView();
             lblTotalCount.Text = RecordCount.ToString();
             lblPageCount.Text = PageCount.ToString();
             txtPageNum.Text = PageIndex.ToString();
@@ -2405,7 +2405,7 @@ namespace OTSIncAReportGrids
             {
                 dgV_ParticlesDevidePage.Rows.Clear();
                 dgV_ParticlesDevidePage.Columns.Clear();
-                DisplayGridView();
+                RefreshGridView();
                 SetDataGridViewStyle();
             }
         }
@@ -2602,11 +2602,11 @@ namespace OTSIncAReportGrids
             int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
             if (sel == (int)SelItem.analyticalParticle)
             {
-                str = "where xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=4";
+                str = "where xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=4 and SubParticles is not 'IsSubParticle' ";
             }
             else if (sel == (int)SelItem.otherParticles)
             {
-                str = "where typeid =9 or typeid =-1 or typeid =4";
+                str = "where SubParticles is not 'IsSubParticle'and(typeid =9 or typeid =-1 or typeid =4)";
             }
             else
             {

+ 13 - 19
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -153,7 +153,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,sum(Area) as Area,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ";
-            sqlp = sqlp + "from IncAData where typeid !=-1 and typeid !=4 and fieldid !=-1 group by TypeId";
+            sqlp = sqlp + "from IncAData where typeid !=-1 and typeid !=4 and SubParticles is not 'IsSubParticle' group by TypeId";
 
             DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
             return DT;
@@ -164,7 +164,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             string sqlp = @"select TypeId,TypeName,GroupId ,TypeColor,count(1) as con,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ,GroupName";
-            sqlp = sqlp + " from IncAData where typeid !=-1 and fieldid!=-1 and typeid !=4 and ParticleId !=-1";
+            sqlp = sqlp + " from IncAData where typeid !=-1 and typeid !=4 and ParticleId !=-1 and SubParticles is not 'IsSubParticle'";
             if (fieldAndPartic != "")
             {
                 sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
@@ -257,7 +257,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <returns></returns>
         public DataTable GetParticleAll(string fieldAndPartic)
         {
-            string sqlp = @"select * from INcAData where typeid !=-1 and typeid !=4";
+            string sqlp = @"select * from INcAData where typeid !=-1 and typeid !=4 and SubParticles is not 'IsSubParticle'";
             if (fieldAndPartic != "")
             {
                 sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
@@ -452,7 +452,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 		/// <returns></returns>
 		public DataTable GetAreaByAllIncA(string fieldAndPartic)
         {
-            string sqlp = @"select TypeId,TypeName,GroupId,sum(area) as ar,count(1) as con ,GroupName from INcAData where typeid !=-1 and typeid !=4 and ParticleId > -1";
+            string sqlp = @"select TypeId,TypeName,GroupId,sum(area) as ar,count(1) as con ,GroupName from INcAData where typeid !=-1 and typeid !=4 and ParticleId > -1 and SubParticles is not 'IsSubParticle' ";
             if (fieldAndPartic != "")
             {
                 sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
@@ -484,7 +484,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         public DataTable GetAreaByIncA(string TypeId, string fieldAndPartic)
         {
             string sqlp = @"select e.name,sum(e.percentage*p.area) as pc,p.TypeId from ElementChemistry e 
-                        inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid where p.TypeId=" + TypeId + " ";
+                        inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid where p.TypeId=" + TypeId + " and SubParticles is not 'IsSubParticle' ";
             if (fieldAndPartic != "")
             {
                 sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||p.fieldid||'-'||p.particleid||',%')";
@@ -497,7 +497,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         public DataTable GetAreaByIncA_All()
         {
             string sqlp = @"select e.name,sum(e.percentage*p.area) as pc,p.TypeId from ElementChemistry e 
-                    inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid group by e.name ";
+                    inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid group by e.name where SubParticles is not 'IsSubParticle' ";
             DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
             return DT;
         }
@@ -805,9 +805,6 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
 
 
-
-
-
         public DataTable GetInfoForPartucleDevidePage_allParticles(string condition)
         {
             string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData  where xrayid > -1 and SubParticles is not 'IsSubParticle' " +
@@ -827,7 +824,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         
         public DataTable GetInfoForPartucleDevidePage_NotIdentifyParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =9 " +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =9 and SubParticles is not 'IsSubParticle' " +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
@@ -835,25 +832,22 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
         public DataTable GetInfoForPartucleDevidePage_InvalidParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =-1 " +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =-1 and SubParticles is not 'IsSubParticle' " +
                 condition;
-            DataTable DT = new DataTable();
-            DT = dbHelper.ExecuteQuery(sqliteString);
+            DataTable DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
         public DataTable GetInfoForPartucleDevidePage_LowCountsParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 typeid =4 " +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 typeid =4 and SubParticles is not 'IsSubParticle' " +
                 condition;
-            DataTable DT = new DataTable();
-            DT = dbHelper.ExecuteQuery(sqliteString);
+            DataTable DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
         public DataTable GetClassificationOfAllParticles(string condition)
         {
-            string sqliteString1 = "select distinct TypeName from INcAData "+ condition;
-            DataTable DT = new DataTable();
-            DT = dbHelper.ExecuteQuery(sqliteString1);
+            string sqliteString1 = "select distinct TypeName from INcAData " + condition;
+            DataTable DT = dbHelper.ExecuteQuery(sqliteString1);
             return DT;
         }
         public DataTable GetXRayData()