Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services
diff options
context:
space:
mode:
2 files changed, 5 insertions, 2 deletions
-rw-r--r--src/Services/EventService.cpp5
-rw-r--r--src/Services/HallService.h2
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));
diff --git a/src/Services/HallService.h b/src/Services/HallService.h
index 88df0a3..4fdea1e 100644
--- a/src/Services/HallService.h
+++ b/src/Services/HallService.h
@@ -10,7 +10,7 @@ class HallService {
public:
HallService(const Hall* halls, unsigned hallCount);
- bool hallExists();
+ const OrderedList<Hall>& get_halls() const;
};
#endif