New: Event und Response Export Methode

Changed: EventRegistrationManager.cs
Co-Author: Konstantin Hintermayer
This commit is contained in:
2025-06-02 11:52:37 +02:00
parent f63681bce5
commit 4f7e846661

View File

@ -40,10 +40,19 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Manager
{ {
// TODO: Export event Responses as well. // TODO: Export event Responses as well.
string content = ""; string content = "";
List<Models.Event> EventRegistrations = _EventRepository.GetEvents(module.ModuleId).ToList(); List<object> exportData = new List<object>();
if (EventRegistrations != null) foreach (var events in _EventRepository.GetEvents(module.ModuleId))
{ {
content = JsonSerializer.Serialize(EventRegistrations); var responses = _ResponseRepository.GetResponses(events.EventId, module.ModuleId);
exportData.Add(new
{
Event = events,
Responses = responses.ToList()
});
};
if (exportData != null)
{
content = JsonSerializer.Serialize(exportData);
} }
return content; return content;
} }