summaryrefslogtreecommitdiff
path: root/Aktywator/Bws.cs
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-11-26 17:39:59 +0100
committeremkael <emkael@tlen.pl>2016-11-26 17:39:59 +0100
commit8b1f024231571b16940aab83c1a131bf9a1eb5d5 (patch)
treeb80cd6bd497b435653a8c5e31290bd8df8e630bf /Aktywator/Bws.cs
parent9651a1a48d6343787e608b2c9daa70eb541fffdb (diff)
* hand record clearing, per section
Diffstat (limited to 'Aktywator/Bws.cs')
-rw-r--r--Aktywator/Bws.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs
index 3331ae0..dee1112 100644
--- a/Aktywator/Bws.cs
+++ b/Aktywator/Bws.cs
@@ -496,12 +496,29 @@ namespace Aktywator
else return 0;
}
+ private void clearRecords(string section)
+ {
+ sql.query("DELETE FROM HandRecord WHERE `Section` = " + section);
+ sql.query("DELETE FROM HandEvaluation WHERE `Section` = " + section);
+ }
+
+ public void clearHandRecords()
+ {
+ string sections = this.sectionsForHandRecords();
+ if (sections != null)
+ {
+ foreach (string section in this.sectionsForHandRecords().Split(','))
+ {
+ this.clearRecords(section.Trim());
+ }
+ }
+ }
+
public void loadHandRecords(PBN pbn)
{
- sql.query("DELETE FROM HandRecord");
- sql.query("DELETE FROM HandEvaluation");
foreach (string section in this.getSections().Split(','))
{
+ this.clearRecords(section);
for (int i = this.lowBoard(section.Trim()); i <= this.highBoard(section.Trim()); i++)
if (pbn.handRecords[i] != null)
{