cxs преди 1 месец
родител
ревизия
b801b60330

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

@@ -7,6 +7,7 @@ using OTSCommon.DBOperate.Model;
 
 using OTSIncAReportApp;
 using OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage;
+using OTSIncAReportApp._2_CommonFunction.CommonClass;
 using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.OTSRstMgrFunction;
 using OTSIncAReportApp.SysMgrTools;

+ 56 - 0
OTSIncAReportApp/2-CommonFunction/CommonClass/UserSTDDbData.cs

@@ -0,0 +1,56 @@
+using OTSIncAReportApp.DataOperation.DataAccess;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OTSIncAReportApp._2_CommonFunction.CommonClass
+{
+    internal class UserSTDDbData
+    {
+
+        private SqlHelper dbHelper;
+
+        public UserSTDDbData(string STDDbName, string resultpath)
+        {
+            NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+            if (!STDDbName.Contains(".db"))
+            {
+                STDDbName += ".db";
+            }
+            if (STDDbName.ToLower() == "nostddb.db")
+            {
+                dbHelper = null;
+                log.Error("Failed to load user-defined library" + "!");
+            }
+            string fullPath = resultpath + STDDbName;
+            string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + STDDbName;
+            if (System.IO.File.Exists(fullPath))
+            {
+                dbHelper = new SqlHelper("data source='" + fullPath + "'");
+                log.Warn("Loading the user standard library:" + fullPath + "!");
+            }
+            else if (System.IO.File.Exists(fullPath2))
+            {
+                dbHelper = new SqlHelper("data source='" + fullPath2 + "'");
+                log.Warn("Loading the user standard library:" + fullPath2 + "!");
+            }
+            else
+            {
+                dbHelper = null;
+                log.Error("Failed to load user-defined library" + "!");
+            }
+        }
+        public DataTable GetSubAttributeFromDatabase()
+        {
+            string sqliteString = "select STDId,Hardness,Density,Electrical_conductivity from ClassifySTD";
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+
+        public SqlHelper GetSqlHelper() { return dbHelper; }
+    }
+}

+ 0 - 47
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -1597,52 +1597,5 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 			return dt_stl;
 		}
 		#endregion
-
 	}
-
-	public class UserSTDDbData
-    {
-        private SqlHelper dbHelper;
-
-        public UserSTDDbData(string STDDbName,string resultpath)
-        {
-            NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
-            if (!STDDbName.Contains(".db"))
-            {
-                STDDbName += ".db";
-            }
-            if(STDDbName.ToLower()== "nostddb.db")
-            {
-                dbHelper = null;
-                log.Error("Failed to load user-defined library" + "!");
-            }
-            string fullPath = resultpath + STDDbName;
-            string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + STDDbName;
-            if (System.IO.File.Exists(fullPath))
-            {
-                dbHelper = new SqlHelper("data source='" + fullPath + "'");
-                log.Warn("Loading the user standard library:" + fullPath + "!");
-            }
-            else if(System.IO.File.Exists(fullPath2))
-            {
-                dbHelper = new SqlHelper("data source='" + fullPath2 + "'");
-                log.Warn("Loading the user standard library:" + fullPath2 + "!");
-            }
-            else
-            {
-                dbHelper = null;
-                log.Error("Failed to load user-defined library"+ "!");
-            }
-        }
-
-        public DataTable GetSubAttributeFromDatabase()
-        {
-            string sqliteString = "select STDId,Hardness,Density,Electrical_conductivity from ClassifySTD";
-            DataTable DT = new DataTable();
-            DT = dbHelper.ExecuteQuery(sqliteString);
-            return DT;
-        }
-
-        public SqlHelper GetSqlHelper() { return dbHelper; }
-    }
 }

+ 1 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -780,6 +780,7 @@
     <Compile Include="1-UI\OTSReportExport\Cleanness\OTSReport_Template_CleannessA.Designer.cs">
       <DependentUpon>OTSReport_Template_CleannessA.cs</DependentUpon>
     </Compile>
+    <Compile Include="2-CommonFunction\CommonClass\UserSTDDbData.cs" />
     <Compile Include="2-CommonFunction\OTSRstMgrFunction\ResultFile.cs" />
     <Compile Include="2-CommonFunction\OTSRstMgrFunction\RptConfigFile.cs" />
     <Compile Include="3-ServiceCenter\COffLineClassifyLogic.cs" />