Add FMS Condition Table, and half way create database
This commit is contained in:
24
Database.cs
24
Database.cs
@@ -22,6 +22,7 @@ namespace FAtoPA
|
||||
CreateFSMTable();
|
||||
CreateModbusTable();
|
||||
CreateVXTable();
|
||||
CreateConditionTable();
|
||||
}
|
||||
|
||||
private bool CreateFSMTable()
|
||||
@@ -169,7 +170,7 @@ namespace FAtoPA
|
||||
}
|
||||
}
|
||||
|
||||
private bool CreateModbusTable()
|
||||
private bool CreateModbusTable()
|
||||
{
|
||||
//Debug.WriteLine("About to execute CreateModbusTable");
|
||||
using (var connection = new SQLiteConnection(connectionString))
|
||||
@@ -312,6 +313,27 @@ namespace FAtoPA
|
||||
}
|
||||
}
|
||||
|
||||
private bool CreateConditionTable()
|
||||
{
|
||||
using (var connection = new SQLiteConnection(connectionString))
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.Open();
|
||||
var conFMSCmd = connection.CreateCommand();
|
||||
conFMSCmd.CommandText = "CREATE TABLE IF NOT EXISTS ConditionTable (No INTEGER AUTO INCREMENT, Condition TEXT, PASStatus TEXT)";
|
||||
conFMSCmd.ExecuteNonQuery();
|
||||
Debug.WriteLine("CreateConditionTable success");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("Error CreateConditionTable, Exception : " + ex.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool CreateVXTable()
|
||||
{
|
||||
//Debug.WriteLine("About to execute CreateVXTable");
|
||||
|
||||
Reference in New Issue
Block a user