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
DocumentStrategyOverviewList.cs
6
8{
13 {
14 private readonly IPersonService _personService;
15
22 public DocumentStrategyOverviewList(IPersonService personService, IWorkspaceService workspaceService, IServiceProvider serviceProvider) : base(workspaceService, serviceProvider)
23 {
24 _personService = personService;
25 }
26
29
31 public override string TemplatePath => DocumentService.GetDocumentPathAbsolute(WorkspaceSettings.SETTING_DOCUMENT_CREATION_OVERVIEW_LIST_TEMPLATE_PATH, _workspaceService);
32
36 public override bool CreateMultiplePages => false;
37
39 public override Enum ItemOrdering { get; set; } = ItemOrderingsOverviewList.None;
40
42 public override IEnumerable<Enum> AvailableItemOrderings => Enum.GetValues(typeof(ItemOrderingsOverviewList)).Cast<Enum>();
43
48 public override PersonStart[] GetItems()
49 {
50 List<PersonStart> starts = _personService.GetAllPersonStarts().Where(s => s.IsActive).ToList();
51 switch (ItemOrdering)
52 {
53 case ItemOrderingsOverviewList.ByNameAscending: starts = starts.OrderBy(s => s.PersonObj?.Name).ToList(); break;
54 case ItemOrderingsOverviewList.ByNameDescending: starts = starts.OrderByDescending(s => s.PersonObj?.Name).ToList(); break;
55 case ItemOrderingsOverviewList.ByFirstNameAscending: starts = starts.OrderBy(s => s.PersonObj?.FirstName).ToList(); break;
56 case ItemOrderingsOverviewList.ByFirstNameDescending: starts = starts.OrderByDescending(s => s.PersonObj?.FirstName).ToList(); break;
57 default: break;
58 }
59 return starts.ToArray();
60 }
61
62 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
63
68 {
69 None,
70 ByNameAscending,
71 ByNameDescending,
72 ByFirstNameAscending,
73 ByFirstNameDescending
74 }
75 }
76
77}
DocumentStrategyBase(IWorkspaceService workspaceService, IServiceProvider serviceProvider)
Constructor for the document strategy base class.
override string TemplatePath
Gets the path to the template used for creating the document.
DocumentStrategyOverviewList(IPersonService personService, IWorkspaceService workspaceService, IServiceProvider serviceProvider)
Constructor for the document strategy for an overview list.
override DocumentCreationTypes DocumentType
Gets the type of document this strategy creates.
override IEnumerable< Enum > AvailableItemOrderings
Array with all available orderings for the items.If no ordering is supported, this will be null.
override Enum ItemOrdering
Current ordering for the items.If no ordering is supported, this will be null.
Class describing a start of a person.
Definition PersonStart.cs:9
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 get and store a list of Person objects.
Interface for a service used to manage a workspace.
DocumentCreationTypes
Different types of documents that can be created.