Add FMS Condition Table, and half way create database

This commit is contained in:
2024-11-28 17:12:54 +07:00
parent f33ba0127f
commit fd4caf028b
3 changed files with 160 additions and 83 deletions

View File

@@ -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");