summaryrefslogtreecommitdiff
path: root/Aktywator/Bws.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Aktywator/Bws.cs')
-rw-r--r--Aktywator/Bws.cs45
1 files changed, 26 insertions, 19 deletions
diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs
index 15219f9..9121eb1 100644
--- a/Aktywator/Bws.cs
+++ b/Aktywator/Bws.cs
@@ -390,13 +390,14 @@ namespace Aktywator
{
}
+ this._ensureHandRecordStructure();
+
try
{
- sql.query("CREATE TABLE HandRecord (`Section` integer, `Board` integer, "
- + "NorthSpades text(13),NorthHearts text(13),NorthDiamonds text(13),NorthClubs text(13),"
- + "EastSpades text(13),EastHearts text(13),EastDiamonds text(13),EastClubs text(13),"
- + "SouthSpades text(13),SouthHearts text(13),SouthDiamonds text(13),SouthClubs text(13),"
- + "WestSpades text(13),WestHearts text(13),WestDiamonds text(13),WestClubs text(13)"
+ sql.query("CREATE TABLE PlayData ("
+ + "`ID` autoincrement, `Section` integer, `Table` integer, `Round` integer, `Board` integer,"
+ + "`Counter` integer, `Direction` text(2), `Card` text(10), `DateLog` datetime,"
+ + "`TimeLog` datetime, `Erased` bit"
+ ");");
}
catch (OleDbException)
@@ -404,23 +405,26 @@ namespace Aktywator
}
try
{
- sql.query("CREATE TABLE HandEvaluation (`Section` integer, `Board` integer, "
- + "NorthSpades integer,NorthHearts integer,NorthDiamonds integer,NorthClubs integer,NorthNotrump integer,"
- + "EastSpades integer,EastHearts integer,EastDiamonds integer,EastClubs integer,EastNotrump integer,"
- + "SouthSpades integer,SouthHearts integer,SouthDiamonds integer,SouthClubs integer,SouthNotrump integer,"
- + "WestSpades integer,WestHearts integer,WestDiamonds integer,WestClubs integer,WestNotrump integer,"
- + "NorthHcp integer,EastHcp integer,SouthHcp integer,WestHcp integer"
+ sql.query("CREATE TABLE BiddingData ("
+ + "`ID` autoincrement, `Section` integer, `Table` integer, `Round` integer, `Board` integer,"
+ + "`Counter` integer, `Direction` text(2), `Bid` text(10), `DateLog` datetime,"
+ + "`TimeLog` datetime, `Erased` bit"
+ ");");
}
catch (OleDbException)
{
}
+ }
+
+ private void _ensureHandRecordStructure()
+ {
try
{
- sql.query("CREATE TABLE PlayData ("
- + "`ID` autoincrement, `Section` integer, `Table` integer, `Round` integer, `Board` integer,"
- + "`Counter` integer, `Direction` text(2), `Card` text(10), `DateLog` datetime,"
- + "`TimeLog` datetime, `Erased` bit"
+ sql.query("CREATE TABLE HandRecord (`Section` integer, `Board` integer, "
+ + "NorthSpades text(13),NorthHearts text(13),NorthDiamonds text(13),NorthClubs text(13),"
+ + "EastSpades text(13),EastHearts text(13),EastDiamonds text(13),EastClubs text(13),"
+ + "SouthSpades text(13),SouthHearts text(13),SouthDiamonds text(13),SouthClubs text(13),"
+ + "WestSpades text(13),WestHearts text(13),WestDiamonds text(13),WestClubs text(13)"
+ ");");
}
catch (OleDbException)
@@ -428,10 +432,12 @@ namespace Aktywator
}
try
{
- sql.query("CREATE TABLE BiddingData ("
- + "`ID` autoincrement, `Section` integer, `Table` integer, `Round` integer, `Board` integer,"
- + "`Counter` integer, `Direction` text(2), `Bid` text(10), `DateLog` datetime,"
- + "`TimeLog` datetime, `Erased` bit"
+ sql.query("CREATE TABLE HandEvaluation (`Section` integer, `Board` integer, "
+ + "NorthSpades integer,NorthHearts integer,NorthDiamonds integer,NorthClubs integer,NorthNotrump integer,"
+ + "EastSpades integer,EastHearts integer,EastDiamonds integer,EastClubs integer,EastNotrump integer,"
+ + "SouthSpades integer,SouthHearts integer,SouthDiamonds integer,SouthClubs integer,SouthNotrump integer,"
+ + "WestSpades integer,WestHearts integer,WestDiamonds integer,WestClubs integer,WestNotrump integer,"
+ + "NorthHcp integer,EastHcp integer,SouthHcp integer,WestHcp integer"
+ ");");
}
catch (OleDbException)
@@ -938,6 +944,7 @@ namespace Aktywator
public bool detectDifferentRecordsInSections()
{
+ this._ensureHandRecordStructure();
if (!this._differentRecordsDetected)
{
this._differentRecordsInSections = false;