diff options
Autocommit at 06.05.2022 @ 09:21
3 files changed, 16 insertions, 1 deletions
| -rw-r--r-- | src/EventSystem/Event.h | 2 | ||||
| -rw-r--r-- | src/EventSystem/EventSystem.cpp | 12 | ||||
| -rw-r--r-- | src/EventSystem/EventSystem.h | 3 |
diff --git a/src/EventSystem/Event.h b/src/EventSystem/Event.h index 9dd1218..d927be9 100644 --- a/src/EventSystem/Event.h +++ b/src/EventSystem/Event.h @@ -22,6 +22,8 @@ public: Event(); Event(const Hall* hall, String name, Date date); + const OrderedList<Ticket>& get_tickets() const; + const OrderedList<Reservation>& get_reservations() const; const Hall& get_hall() const; const String& get_name() const; const Date& get_date() const; diff --git a/src/EventSystem/EventSystem.cpp b/src/EventSystem/EventSystem.cpp index c5fc0c1..4de7b70 100644 --- a/src/EventSystem/EventSystem.cpp +++ b/src/EventSystem/EventSystem.cpp @@ -118,3 +118,15 @@ StatusCode EventSystem::buyTicket(const char* name, const Date& date, const Tick // // return freeTickets; // } + +List<Ticket> EventSystem::queryTickets(const char* name, const Date& date) { + unsigned ind = indexOfEvent(name, date); + if (ind == events.get_count()) + return E_EventDoesNotExist; + + return events[ind].get_tickets(); +} + +List<Reservation> EventSystem::queryReservations(const char* name, const Date& date) { + +} diff --git a/src/EventSystem/EventSystem.h b/src/EventSystem/EventSystem.h index 4fd6745..7df7ecb 100644 --- a/src/EventSystem/EventSystem.h +++ b/src/EventSystem/EventSystem.h @@ -34,7 +34,8 @@ public: StatusCode buyTicket(const char* name, const Date& date, const Ticket& ticket, const char* password); // List<Ticket> queryFreeTickets(const char* name, const Date& date); - List<Reservation> queryReservations(unsigned eventIndex); + List<Ticket> queryTickets(const char* name, const Date& date); + List<Reservation> queryReservations(const char* name, const Date& date); void queryBoughtTickets(Date start, Date end, unsigned hall); void queryMostVisited(); void queryInsufficientlyVisited(); |
