From a9f5093df64222395f6b0de21e6afee954c7a9a2 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 19 Sep 2017 19:35:01 +0200 Subject: Writing and sanitizing additional info for Teamy tournaments --- Aktywator/Bws.cs | 12 ++++++++---- Aktywator/TeamyTournament.cs | 4 ++-- Aktywator/Tournament.cs | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'Aktywator') 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> getNameList() { Dictionary> teams = new Dictionary>(); - MySqlDataReader dbData = this.mysql.select("SELECT id, fullname NAME FROM teams"); + MySqlDataReader dbData = this.mysql.select(MainForm.teamNames.getQuery()); while (dbData.Read()) { List names = new List(); 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; } + } } -- cgit v1.2.3