summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-09-19 19:35:01 +0200
committeremkael <emkael@tlen.pl>2017-09-19 19:35:01 +0200
commita9f5093df64222395f6b0de21e6afee954c7a9a2 (patch)
treeb0b5687d5bd319529ff1d4c0a518caea066fae62
parent57f308f755a8b5107a801e1d0808d1541b3b7968 (diff)
Writing and sanitizing additional info for Teamy tournaments
-rw-r--r--Aktywator/Bws.cs12
-rw-r--r--Aktywator/TeamyTournament.cs4
-rw-r--r--Aktywator/Tournament.cs3
3 files changed, 12 insertions, 7 deletions
diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs
index 763b11d..580b08f 100644
--- a/Aktywator/Bws.cs
+++ b/Aktywator/Bws.cs
@@ -453,8 +453,10 @@ namespace Aktywator
count += 2;
if (tournament.type == Tournament.TYPE_TEAMY)
{
- countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "E", names[ns][0]);
- countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "W", names[ns][1]);
+ countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "E",
+ names.ContainsKey(ns + TeamNamesSettings.OpenClosedDiff) ? names[ns + TeamNamesSettings.OpenClosedDiff][0] : names[ns][0]);
+ countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "W",
+ names.ContainsKey(ns + TeamNamesSettings.OpenClosedDiff) ? names[ns + TeamNamesSettings.OpenClosedDiff][1] : names[ns][1]);
count += 2;
}
}
@@ -480,8 +482,10 @@ namespace Aktywator
count += 2;
if (tournament.type == Tournament.TYPE_TEAMY)
{
- countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "N", names[ew][0]);
- countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "S", names[ew][1]);
+ countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "N",
+ names.ContainsKey(ns + TeamNamesSettings.OpenClosedDiff) ? names[ew + TeamNamesSettings.OpenClosedDiff][0] : names[ew][0]);
+ countNew += updateName(section, (int.Parse(table) + SKOK_STOLOW).ToString(), "S",
+ names.ContainsKey(ns + TeamNamesSettings.OpenClosedDiff) ? names[ew + TeamNamesSettings.OpenClosedDiff][1] : names[ew][1]);
count += 2;
}
}
diff --git a/Aktywator/TeamyTournament.cs b/Aktywator/TeamyTournament.cs
index bd6b619..990583f 100644
--- a/Aktywator/TeamyTournament.cs
+++ b/Aktywator/TeamyTournament.cs
@@ -31,12 +31,12 @@ namespace Aktywator
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");
+ MySqlDataReader dbData = this.mysql.select(MainForm.teamNames.getQuery());
while (dbData.Read())
{
List<string> names = new List<string>();
names.Add(dbData.IsDBNull(1) ? " " : dbData.GetString(1));
- names.Add(" ");
+ names.Add(dbData.IsDBNull(2) ? " " : dbData.GetString(2));
teams.Add(dbData.GetInt32(0), names);
}
dbData.Close();
diff --git a/Aktywator/Tournament.cs b/Aktywator/Tournament.cs
index 33ecd26..fd6fec1 100644
--- a/Aktywator/Tournament.cs
+++ b/Aktywator/Tournament.cs
@@ -120,7 +120,7 @@ namespace Aktywator
}
else
{
- if (this._type != Tournament.TYPE_TEAMY)
+ if (this._type != Tournament.TYPE_TEAMY || MainForm.teamNames.arePlayerNamesDisplayed())
{
string[] nameParts = name.Trim().Split(' ');
if (nameParts.Length > 0)
@@ -152,5 +152,6 @@ namespace Aktywator
return dict;
}
+
}
}