summaryrefslogtreecommitdiff
path: root/Aktywator/TeamyTournament.cs
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-07-30 02:28:57 +0200
committeremkael <emkael@tlen.pl>2017-07-30 02:28:57 +0200
commit14f684cee81e45ebaea0dd0abb60c5039a7ed467 (patch)
tree2cd041e6f32f2158ceeaba2ba468597013b080b1 /Aktywator/TeamyTournament.cs
parentcfe97d223573c4792e5d42a4443c139fd8c87381 (diff)
Loading names from MySQL tournaments generalized as a dataset
Diffstat (limited to 'Aktywator/TeamyTournament.cs')
-rw-r--r--Aktywator/TeamyTournament.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Aktywator/TeamyTournament.cs b/Aktywator/TeamyTournament.cs
index 34908be..3b83c8b 100644
--- a/Aktywator/TeamyTournament.cs
+++ b/Aktywator/TeamyTournament.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
+using MySql.Data.MySqlClient;
namespace Aktywator
{
@@ -26,5 +27,20 @@ namespace Aktywator
return this.mysql.selectOne("SELECT teamcnt FROM admin;");
}
+ override internal Dictionary<int, List<string>> getNameList()
+ {
+ Dictionary<int, List<String>> teams = new Dictionary<int, List<string>>();
+ MySqlDataReader dbData = this.mysql.select("SELECT id, fullname NAME FROM teams");
+ while (dbData.Read())
+ {
+ List<string> names = new List<string>();
+ names.Add(dbData.IsDBNull(1) ? "" : dbData.GetString(1));
+ names.Add("");
+ teams.Add(dbData.GetInt32(0), names);
+ }
+ dbData.Close();
+ return teams;
+ }
+
}
}