From 5738d7e27fa1da52cbe50a2e26a0bd3a7749335e Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 26 Nov 2016 17:41:19 +0100 Subject: * reading boards only for selected sections (and accummulating count) --- Aktywator/Bws.cs | 7 +++++-- Aktywator/MainForm.cs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'Aktywator') diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs index 606de96..335bc11 100644 --- a/Aktywator/Bws.cs +++ b/Aktywator/Bws.cs @@ -514,9 +514,10 @@ namespace Aktywator } } - public void loadHandRecords(PBN pbn) + public int loadHandRecords(PBN pbn) { - foreach (string section in this.getSections().Split(',')) + int count = 0; + foreach (string section in this.getSelectedSections()) { this.clearRecords(section); for (int i = this.lowBoard(section.Trim()); i <= this.highBoard(section.Trim()); i++) @@ -570,8 +571,10 @@ namespace Aktywator ddStr.Append(")"); sql.query(ddStr.ToString()); } + count++; } } + return count; } } } diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs index 1326777..8979d6b 100644 --- a/Aktywator/MainForm.cs +++ b/Aktywator/MainForm.cs @@ -277,8 +277,8 @@ namespace Aktywator try { PBN pbn = new PBN(openPBN.FileName, bws.lowBoard(), bws.highBoard()); - bws.loadHandRecords(pbn); - MessageBox.Show("Wczytanych rozkładów: " + pbn.count, "Rozkłady wczytane!", MessageBoxButtons.OK, MessageBoxIcon.Information); + int count = bws.loadHandRecords(pbn); + MessageBox.Show("Wczytanych rozkładów: " + count, "Rozkłady wczytane!", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { -- cgit v1.2.3