|
@@ -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)
|
|
|
{
|