Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
AnalyticsModuleGenderStarts.cs
5
7{
12 {
13 private IPersonService _personService;
14
20 {
21 _personService = personService;
22 }
23
26
30 public int MaleStartsCount => _personService.GetAllPersonStarts(onlyValidStarts:true).Count(s => s.PersonObj?.Gender == Genders.Male);
31
35 public double MaleStartsPercentage => (MaleStartsCount / (double)_personService.GetAllPersonStarts(onlyValidStarts:true).Count()) * 100;
36
40 public int FemaleStartsCount => _personService.GetAllPersonStarts(onlyValidStarts:true).Count(s => s.PersonObj?.Gender == Genders.Female);
41
45 public double FemaleStartsPercentage => (FemaleStartsCount / (double)_personService.GetAllPersonStarts(onlyValidStarts:true).Count()) * 100;
46
49 {
50 DocXPlaceholderHelper.TextPlaceholders textPlaceholder = new DocXPlaceholderHelper.TextPlaceholders();
51 foreach (string placeholder in Placeholders.Placeholders_AnalyticsGenderStartsMaleCount) { textPlaceholder.Add(placeholder, MaleStartsCount.ToString()); }
52 foreach (string placeholder in Placeholders.Placeholders_AnalyticsGenderStartsMalePercentage) { textPlaceholder.Add(placeholder, MaleStartsPercentage.ToString("N1")); }
53 foreach (string placeholder in Placeholders.Placeholders_AnalyticsGenderStartsFemaleCount) { textPlaceholder.Add(placeholder, FemaleStartsCount.ToString()); }
54 foreach (string placeholder in Placeholders.Placeholders_AnalyticsGenderStartsFemalePercentage) { textPlaceholder.Add(placeholder, FemaleStartsPercentage.ToString("N1")); }
55 return textPlaceholder;
56 }
57
59 public List<string> SupportedDocumentPlaceholderKeys => new List<string>()
60 {
61 Placeholders.PLACEHOLDER_KEY_ANALYTICS_GENDER_STARTS_MALE_COUNT,
62 Placeholders.PLACEHOLDER_KEY_ANALYTICS_GENDER_STARTS_MALE_PERCENTAGE,
63 Placeholders.PLACEHOLDER_KEY_ANALYTICS_GENDER_STARTS_FEMALE_COUNT,
64 Placeholders.PLACEHOLDER_KEY_ANALYTICS_GENDER_STARTS_FEMALE_PERCENTAGE
65 };
66 }
67}
List< string > SupportedDocumentPlaceholderKeys
List of all document placeholder keys that are supported by this analytics module....
bool AnalyticsAvailable
Flag indicating if the analytics module has data.
DocXPlaceholderHelper.TextPlaceholders CollectDocumentPlaceholderContents()
Collect the values for all document placeholders that are supported by this IAnalyticsModule....
AnalyticsModuleGenderStarts(IPersonService personService)
Constructor for the AnalyticsModuleGenderStarts
Interface for a service used to get and store a list of Person objects.
Genders
Available genders for a person.
Definition Genders.cs:7