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
DocumentStrategyRaceStartList.cs
6
8{
13 {
14 private readonly IRaceService _raceService;
15
22 public DocumentStrategyRaceStartList(IRaceService raceService, IWorkspaceService workspaceService, IServiceProvider serviceProvider) : base(workspaceService, serviceProvider)
23 {
24 _raceService = raceService;
25 }
26
29
31 public override string TemplatePath => DocumentService.GetDocumentPathAbsolute(WorkspaceSettings.SETTING_DOCUMENT_CREATION_RACE_START_LIST_TEMPLATE_PATH, _workspaceService);
32
36 public override bool CreateMultiplePages => false;
37
42 public override Race[] GetItems()
43 {
44 if(_raceService.PersistedRacesVariant == null || _raceService.PersistedRacesVariant?.Races == null) { return null; }
45
46 // Return a list of all races but only with the active starts
47 List<Race> raceClones = new List<Race>();
48 foreach (Race originalRace in _raceService.PersistedRacesVariant?.Races)
49 {
50 Race newRace = new Race(originalRace, true);
51 newRace.Starts = new System.Collections.ObjectModel.ObservableCollection<PersonStart>(newRace.Starts.Where(s => s.IsActive));
52 raceClones.Add(newRace);
53 }
54 return raceClones.ToArray();
55 }
56 }
57}
DocumentStrategyBase(IWorkspaceService workspaceService, IServiceProvider serviceProvider)
Constructor for the document strategy base class.
override DocumentCreationTypes DocumentType
Gets the type of document this strategy creates.
override Race[] GetItems()
Return a list of all Race items of the RaceService.PersistedRacesVariant
DocumentStrategyRaceStartList(IRaceService raceService, IWorkspaceService workspaceService, IServiceProvider serviceProvider)
Constructor for the document strategy for a race start list.
override string TemplatePath
Gets the path to the template used for creating the document.
Class describing a start of a person.
Definition PersonStart.cs:9
Class that represents a single race.
Definition Race.cs:12
ObservableCollection< PersonStart > Starts
List with all starts of this Race
Definition Race.cs:90
Service used to create documents like certificates or start lists.
static string GetDocumentPathAbsolute(string documentCreationSettingKey, IWorkspaceService workspaceService)
Get the absolute path for the requested document creation setting.
Interface for a service used to manage Race and RacesVariant objects.
Interface for a service used to manage a workspace.
DocumentCreationTypes
Different types of documents that can be created.