diff options
Diffstat (limited to 'Aktywator/ParyTournament.cs')
-rw-r--r-- | Aktywator/ParyTournament.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Aktywator/ParyTournament.cs b/Aktywator/ParyTournament.cs index 8d80d9f..a5d9ff2 100644 --- a/Aktywator/ParyTournament.cs +++ b/Aktywator/ParyTournament.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using MySql.Data.MySqlClient; namespace Aktywator { @@ -26,5 +27,29 @@ namespace Aktywator return this.mysql.selectOne("SELECT COUNT(*) FROM sektory;"); } + override internal Dictionary<int, List<string>> getNameList() + { + Dictionary<int, List<String>> pairs = new Dictionary<int, List<string>>(); + MySqlDataReader dbData = this.mysql.select("SELECT idp, CONCAT(SUBSTR(imie,1,1),'.',nazw) name FROM zawodnicy"); + while (dbData.Read()) + { + int pairNo = dbData.GetInt32(0); + if (!pairs.ContainsKey(pairNo)) + { + pairs.Add(pairNo, new List<string>()); + } + pairs[pairNo].Add(dbData.IsDBNull(1) ? "" : dbData.GetString(1)); + } + foreach (KeyValuePair<int, List<string>> pair in pairs) + { + while (pair.Value.Count < 2) + { + pair.Value.Add(""); + } + } + dbData.Close(); + return pairs; + } + } } |