diff options
-rw-r--r-- | Aktywator/ParyTournament.cs | 2 | ||||
-rw-r--r-- | Aktywator/RRBTournament.cs | 14 | ||||
-rw-r--r-- | Aktywator/Tournament.cs | 16 |
3 files changed, 18 insertions, 14 deletions
diff --git a/Aktywator/ParyTournament.cs b/Aktywator/ParyTournament.cs index f467119..4950c3d 100644 --- a/Aktywator/ParyTournament.cs +++ b/Aktywator/ParyTournament.cs @@ -31,7 +31,7 @@ namespace Aktywator 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"); + MySqlDataReader dbData = this.mysql.select("SELECT idp, CONCAT(imie, ' ', nazw) name FROM zawodnicy"); while (dbData.Read()) { int pairNo = dbData.GetInt32(0); diff --git a/Aktywator/RRBTournament.cs b/Aktywator/RRBTournament.cs index 4c8f281..48040ee 100644 --- a/Aktywator/RRBTournament.cs +++ b/Aktywator/RRBTournament.cs @@ -62,19 +62,7 @@ namespace Aktywator names.Add(pairNo, new List<string>()); foreach (XmlNode player in pair.SelectNodes("gracz/nazwisko")) { - if ("pauza".Equals(player.InnerText.Trim())) - { - names[pairNo].Add(" "); - } - else - { - string[] name = player.InnerText.Trim().Split(' '); - if (name.Length > 0) - { - name[0] = (name[0].Length > 0) ? name[0][0].ToString() : " "; - } - names[pairNo].Add(String.Join(" ", name)); - } + names[pairNo].Add(player.InnerText); } } diff --git a/Aktywator/Tournament.cs b/Aktywator/Tournament.cs index 85a2666..cbe9bf9 100644 --- a/Aktywator/Tournament.cs +++ b/Aktywator/Tournament.cs @@ -38,5 +38,21 @@ namespace Aktywator return new Dictionary<int, List<string>>(); } + virtual internal string shortenNameToBWS(string name) + { + if ("pauza".Equals(name.Trim())) + { + return " "; + } + else + { + string[] nameParts = name.Trim().Split(' '); + if (nameParts.Length > 0) + { + nameParts[0] = (nameParts[0].Length > 0) ? nameParts[0][0].ToString() : " "; + } + return String.Join(" ", nameParts); + } + } } } |