diff options
Autocommit at 07.05.2022 @ 21:09
1 files changed, 14 insertions, 2 deletions
| -rw-r--r-- | src/Services/EventService.cpp | 16 |
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp index 0a77a41..0134a06 100644 --- a/src/Services/EventService.cpp +++ b/src/Services/EventService.cpp @@ -226,10 +226,22 @@ StatusCode EventService::reportBoughtTickets(int hallNumber, const Date& start, } -void EventService::load() { +StatusCode EventService::load() { + std::ifstream inFile("eventsDatabase.fmits"); + if (!inFile.is_open()) + return E_FileCouldNotBeOpened; + events.read(inFile); + inFile.close(); + return Success; } -void EventService::save() { +StatusCode EventService::save() { + std::ofstream outFile("eventsDatabase.fmits"); + if (!outFile.is_open()) + return E_FileCouldNotBeOpened; + events.write(outFile); + outFile.close(); + return Success; } |
