From 9ca23d4696d38a501bb59e3279f692c780ded20f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 6 May 2022 09:21:09 +0300 Subject: Autocommit at 06.05.2022 @ 09:21 --- src/EventSystem/Event.h | 2 ++ src/EventSystem/EventSystem.cpp | 12 ++++++++++++ src/EventSystem/EventSystem.h | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/EventSystem') 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& get_tickets() const; + const OrderedList& 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 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 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 queryFreeTickets(const char* name, const Date& date); - List queryReservations(unsigned eventIndex); + List queryTickets(const char* name, const Date& date); + List queryReservations(const char* name, const Date& date); void queryBoughtTickets(Date start, Date end, unsigned hall); void queryMostVisited(); void queryInsufficientlyVisited(); -- cgit v1.3.1-26-gb76a