Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services / EventService.cpp
diff options
context:
space:
mode:
Commit44760d813cec1af2adcce9ccd01fdc01d677c589 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 15:48:31 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 15:48:31 +0300
Filescc1720950c995802c0ebf31206b7741cf8afd115 /src/Services/EventService.cpp
FMI-OOP-P1_TicketSystem-44760d813cec1af2adcce9ccd01fdc01d677c589.tar
FMI-OOP-P1_TicketSystem-44760d813cec1af2adcce9ccd01fdc01d677c589.tar.gz
FMI-OOP-P1_TicketSystem-44760d813cec1af2adcce9ccd01fdc01d677c589.zip
Parent1a79bbdda10741f0908e4d22e57a3b3cb429dff9 (diff)
Autocommit at 07.05.2022 @ 15:48
1 files changed, 21 insertions, 0 deletions
-rw-r--r--src/Services/EventService.cpp21
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index 3eec0b5..3c3b668 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -157,3 +157,24 @@ String EventService::createSeatingString(const char* name, const Date& date, uns
out[seatsCount * rowCount] = '\0';
return out;
}
+
+bool cond_event_all(const Event& e1, const Event& e2) {
+ return true;
+}
+
+bool cond_event_name(const Event& e1, const Event& e2) {
+ return e1.get_name().compare(e2.get_name()) == 0;
+}
+
+bool cond_event_date(const Event& e1, const Event& e2) {
+ return e1.get_date().compare(e2.get_date()) == 0;
+}
+
+StatusCode EventService::reportReservations(const char* name, const Date& date) {
+ List<Reservation> result;
+ bool (*cond_name)(const Event&, const Event&) = cond_event_name;
+ bool (*cond_date)(const Event&, const Event&) = cond_event_date;
+
+ if (strcmp(name, "ALL") == 0) cond_name = cond_event_all;
+ if (date.compare(Date(0, 0, 0)) == 0) cond_date = cond_event_all;
+}