Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services
diff options
context:
space:
mode:
Commite79951e129ae4f0f6f51496c247edabce0c1d0c5 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 10:57:41 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 10:57:41 +0300
Filese37d73e4a05c5e2d403c0bc39de2e2057a129973 /src/Services
FMI-OOP-P1_TicketSystem-e79951e129ae4f0f6f51496c247edabce0c1d0c5.tar
FMI-OOP-P1_TicketSystem-e79951e129ae4f0f6f51496c247edabce0c1d0c5.tar.gz
FMI-OOP-P1_TicketSystem-e79951e129ae4f0f6f51496c247edabce0c1d0c5.zip
Parent58a0aded601479d7d1ba8a256e500e95f2bcb5bc (diff)
Autocommit at 07.05.2022 @ 10:57
2 files changed, 4 insertions, 2 deletions
-rw-r--r--src/Services/EventService.cpp4
-rw-r--r--src/Services/EventService.h2
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index fc62c64..a1ba34e 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -135,12 +135,14 @@ StatusCode EventService::buyTicket(const char* name, const Date& date, const Tic
return Success;
}
-String EventService::createSeatingString(const char* name, const Date& date) {
+String EventService::createSeatingString(const char* name, const Date& date, unsigned* seatsPerRow) {
unsigned eInd = indexOfEvent(name, date);
if (eInd == events.get_count())
return "";
unsigned rowCount = events[eInd].get_hall().get_rows(), seatsCount = events[eInd].get_hall().get_seatsPerRow();
+ *seatsPerRow = seatsCount;
+
String out;
for (unsigned row = 1; row <= rowCount; row++) {
for (unsigned seat = 1; seat <= seatsCount; seat++) {
diff --git a/src/Services/EventService.h b/src/Services/EventService.h
index 6e7b970..214d6ff 100644
--- a/src/Services/EventService.h
+++ b/src/Services/EventService.h
@@ -34,7 +34,7 @@ public:
StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat);
StatusCode buyTicket(const char* name, const Date& date, const Ticket& ticket);
- String createSeatingString(const char* name, const Date& date);
+ String createSeatingString(const char* name, const Date& date, unsigned* seatsPerRow = nullptr);
void queryMostVisited();
void queryInsufficientlyVisited();