Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services / EventService.cpp
diff options
context:
space:
mode:
1 files changed, 4 insertions, 1 deletions
-rw-r--r--src/Services/EventService.cpp5
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index c3124cc..b7d54e1 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -39,7 +39,10 @@ EventService::EventService(const HallService* hs, const Event* events, unsigned
}
StatusCode EventService::createEvent(int hallNumber, const String& name, const Date& date) {
- if (indexOfEvent(date) < events.get_count())
+ unsigned hInd = hs->get_halls().findIndex(Hall(hallNumber));
+ if (hInd == hs->get_halls().get_count())
+ return E_HallDoesntExist;
+ if (true)
return E_EventWillOverlap;
events.insert(Event(*hall, name, date));