Selaa lähdekoodia

标准库组分类保存

CXS 3 vuotta sitten
vanhempi
commit
5d259a4141

+ 1 - 1
OTSCPP/OTSRptCalculate/DTL/DBConst.cpp

@@ -45,7 +45,7 @@ namespace OTSSQLITE
 	const CString g_sMineralElementsTableName("MineralElements");
 
 	//
-	const CString g_sMineralGroupTableName("MineralGroups");
+	const CString g_sMineralGroupTableName("STDGroups");
 
 	// MergedParticlesTable
 	const CString g_sMergedParticlesTableName("MergedParticles");

+ 1 - 1
OTSCPP/OTSSQLiteDll/DBConst.cpp

@@ -45,5 +45,5 @@ namespace OTSSQLITE
 	const CString g_sMineralElementsTableName("MineralElements");
 
 	//
-	const CString g_sMineralGroupTableName("MineralGroups");
+	const CString g_sMineralGroupTableName("STDGroups");
 }

+ 1 - 1
OTSPartA_STDEditor/Attributes.cs

@@ -209,7 +209,7 @@ namespace OTSPartA_STDEditor
             Grid_Attributes[8, 1].Value = m_MainForm.STDDictionary[STDId].Formula;
             Grid_Attributes[9, 1].Value = m_MainForm.STDDictionary[STDId].Element;
 
-            m_MainForm.AddMineralGroupsToAttribute();
+            m_MainForm.AddSTDGroupsToAttribute();
             Grid_Attributes[10, 1].Value = m_MainForm.GroupIdDictionaryFromId[int.Parse(m_MainForm.STDDictionary[STDId].GroupId)];
 
             //SourceGrid.Position po = new SourceGrid.Position(1, 0);

+ 3 - 4
OTSPartA_STDEditor/Form_ConstantsEditor2.cs

@@ -514,7 +514,6 @@ namespace OTSPartA_STDEditor
                     return false;
                 }
             }
-
             #region 化学式和元素暂无限制
             //if (m_Attributes.Grid_Attributes[7, 1].Value.ToString())
             //{
@@ -1276,13 +1275,13 @@ namespace OTSPartA_STDEditor
         }
 
 
-        public void AddMineralGroupsToAttribute()
+        public void AddSTDGroupsToAttribute()
         {
             try
             {
                 System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + STDDBAddress + "'");
                 m_dbConnection.Open();
-                System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select name,id from MineralGroups order by iorder", m_dbConnection);
+                System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select name,id from STDGroups order by iorder", m_dbConnection);
                 DataSet ds = new DataSet();
                 m_dataAdapter.Fill(ds);
                 DataTable dt = ds.Tables[0];
@@ -1323,7 +1322,7 @@ namespace OTSPartA_STDEditor
             DialogResult dialogResult = form_GroupId.ShowDialog();
             if (dialogResult == DialogResult.Yes)
             {
-                AddMineralGroupsToAttribute();
+                AddSTDGroupsToAttribute();
             }
         }
 

+ 12 - 13
OTSPartA_STDEditor/Form_GroupId.cs

@@ -18,7 +18,7 @@ namespace OTSPartA_STDEditor
         System.Collections.Hashtable table_GroupId;
 
         string MineralGroupDBAddress = Application.StartupPath + "\\Config\\SysData\\" + "OTSCleanlinesSTD.db";
-        Dictionary<int,MineralGroups> MineralGroupDictionary = new Dictionary<int, MineralGroups>();
+        Dictionary<int,STDGroups> MineralGroupDictionary = new Dictionary<int, STDGroups>();
 
         /// <summary>
         ///数据库修改状态
@@ -36,7 +36,7 @@ namespace OTSPartA_STDEditor
             {
                 System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + DBaddress + "'");
                 m_dbConnection.Open();
-                System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from MineralGroups order by iorder", m_dbConnection);
+                System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from STDGroups order by iorder", m_dbConnection);
                 DataSet ds = new DataSet();
                 m_dataAdapter.Fill(ds);
                 DataTable dt = ds.Tables[0];
@@ -47,7 +47,7 @@ namespace OTSPartA_STDEditor
                     {
                         foreach (DataRow item in dt.Rows)
                         {
-                            MineralGroups new_STDdata = new MineralGroups();
+                            STDGroups new_STDdata = new STDGroups();
                             new_STDdata.name = item["name"].ToString();
                             new_STDdata.color = item["color"].ToString();
                             new_STDdata.iorder = int.Parse(item["iorder"].ToString());
@@ -105,7 +105,7 @@ namespace OTSPartA_STDEditor
         protected bool WhetherExistsInDBById(System.Data.SQLite.SQLiteConnection m_dbConnection, int id)
         {
             bool selResult = false;
-            System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from MineralGroups where id=" + id.ToString() + "", m_dbConnection);
+            System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from STDGroups where id=" + id.ToString() + "", m_dbConnection);
             DataSet ds = new DataSet();
             m_dataAdapter.Fill(ds);
             DataTable dt = ds.Tables[0];
@@ -124,7 +124,7 @@ namespace OTSPartA_STDEditor
             System.Data.SQLite.SQLiteCommand cmm = m_dbConnection.CreateCommand();
             try
             {
-               string insertstr = "Insert into MineralGroups(id,name,color,iorder)";
+               string insertstr = "Insert into STDGroups(id,name,color,iorder)";
                string aa = "values(" + id + ",'" + name + "','" + color + "'," + iorder+ ")";
                cmm.CommandText = insertstr + aa;
                cmm.ExecuteNonQuery();
@@ -141,7 +141,7 @@ namespace OTSPartA_STDEditor
             System.Data.SQLite.SQLiteCommand cmm = m_dbConnection.CreateCommand();
             try
             {
-                string insertstr = "update MineralGroups set name='" + name + "',color='"+ color + "',iorder=" + iorder+ " where id=" + id + ";";
+                string insertstr = "update STDGroups set name='" + name + "',color='"+ color + "',iorder=" + iorder+ " where id=" + id + ";";
                 cmm.CommandText = insertstr;
                 cmm.ExecuteNonQuery();
                 return true;
@@ -157,7 +157,7 @@ namespace OTSPartA_STDEditor
             System.Data.SQLite.SQLiteCommand cmm = m_dbConnection.CreateCommand();
             try
             {
-                string insertstr = "delete from MineralGroups where id=" + id + ";";
+                string insertstr = "delete from STDGroups where id=" + id + ";";
                 cmm.CommandText = insertstr;
                 cmm.ExecuteNonQuery();
                 return true;
@@ -177,7 +177,7 @@ namespace OTSPartA_STDEditor
             System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + DBAddress + "'");
             m_dbConnection.Open();
 
-            foreach (KeyValuePair<int, MineralGroups> kv in MineralGroupDictionary)
+            foreach (KeyValuePair<int, STDGroups> kv in MineralGroupDictionary)
             {
                 int infoState = kv.Value.InfoState;
                 if (infoState == (int)DBInfoState.Modify)
@@ -253,7 +253,7 @@ namespace OTSPartA_STDEditor
 
 
                 int i = 1;
-                foreach (KeyValuePair<int, MineralGroups> kv in MineralGroupDictionary)
+                foreach (KeyValuePair<int, STDGroups> kv in MineralGroupDictionary)
                 {
                     Grid_FroupId[i, 0] = new SourceGrid.Cells.Cell(kv.Value.name, typeof(string));
                     Grid_FroupId[i, 1] = new SourceGrid.Cells.Cell("", typeof(string));
@@ -282,14 +282,13 @@ namespace OTSPartA_STDEditor
         }
         public int AddMineralGroupDictionaryItem()
         {
-            MineralGroups new_MineralGroup = new MineralGroups();//定义一个TreeNode节点对象
+            STDGroups new_MineralGroup = new STDGroups();//定义一个TreeNode节点对象
             new_MineralGroup.name = "New Group";
             new_MineralGroup.color = Attributes.colorRGBtoHx16(Color.Gray.R, Color.Gray.G, Color.Gray.B);
             new_MineralGroup.InfoState = (int)DBInfoState.Modify;
 
-            int Id = 1;
-
-            foreach (KeyValuePair<int, MineralGroups> kv in MineralGroupDictionary)
+            int Id = 100;
+            foreach (KeyValuePair<int, STDGroups> kv in MineralGroupDictionary)
             {
                 if (Id < kv.Key)
                 {

+ 1 - 1
OTSPartA_STDEditor/OTSPartA_STDEditor.csproj

@@ -132,7 +132,7 @@
     <Compile Include="Form_PeriodicTable.Designer.cs">
       <DependentUpon>Form_PeriodicTable.cs</DependentUpon>
     </Compile>
-    <Compile Include="MineralGroups.cs" />
+    <Compile Include="STDGroups.cs" />
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>

+ 1 - 1
OTSPartA_STDEditor/MineralGroups.cs → OTSPartA_STDEditor/STDGroups.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace OTSPartA_STDEditor
 {
-    class MineralGroups
+    class STDGroups
     {
         //int s_id = 0;
         string s_name = "";