summaryrefslogtreecommitdiff
path: root/Aktywator
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-08-23 17:17:49 +0200
committeremkael <emkael@tlen.pl>2017-08-23 17:17:49 +0200
commit6ad488f28bfd74c39be0c420a671b7c33f9250d6 (patch)
tree382fc063bae9894bb8b8cc52f2fb9d6c2c1edf1f /Aktywator
parent903f2af3cabb5dfff04136a20fe375b95d629a02 (diff)
Name shortening independent from torunament source
Diffstat (limited to 'Aktywator')
-rw-r--r--Aktywator/ParyTournament.cs2
-rw-r--r--Aktywator/RRBTournament.cs14
-rw-r--r--Aktywator/Tournament.cs16
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);
+ }
+ }
}
}