Website Summary Files Commits Branches @commit @diff @stats
path: root / src / VenueConsoleUI.cpp
diff options
context:
space:
mode:
Commitd112289d0d86e66286641a4a1cd450c7db97f5b7 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 11:36:51 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 11:36:51 +0300
Files03e28581681ec33ace5b950b1480e9b60da978db /src/VenueConsoleUI.cpp
FMI-OOP-P1_TicketSystem-d112289d0d86e66286641a4a1cd450c7db97f5b7.tar
FMI-OOP-P1_TicketSystem-d112289d0d86e66286641a4a1cd450c7db97f5b7.tar.gz
FMI-OOP-P1_TicketSystem-d112289d0d86e66286641a4a1cd450c7db97f5b7.zip
Parentad6d253e3eca1178d988a71ff03af994ef70aecf (diff)
Autocommit at 06.05.2022 @ 11:36
1 files changed, 4 insertions, 4 deletions
-rw-r--r--src/VenueConsoleUI.cpp8
diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp
index fdac1bc..af02425 100644
--- a/src/VenueConsoleUI.cpp
+++ b/src/VenueConsoleUI.cpp
@@ -51,8 +51,8 @@ void command_freeSeats() {
unsigned tableSize = hall->get_rowCount() * hall->get_seatsPerRow();
char tableData[tableSize + 1];
- for (unsigned ind = 0, row = 1; row < hall->get_rowCount(); row++) {
- for (unsigned seat = 1; seat < hall->get_seatsPerRow(); seat++, ind++) {
+ for (unsigned ind = 0, row = 1; row <= hall->get_rowCount(); row++) {
+ for (unsigned seat = 1; seat <= hall->get_seatsPerRow(); seat++, ind++) {
if (tickets.contain(Ticket(row, seat)))
tableData[ind] = 'B';
else if (reservations.contain(Ticket(row, seat)))
@@ -71,12 +71,12 @@ void command_reserveTicket() {
inputLineBox("Enter event name: ", name, MAX_LINE_WIDTH);
Date date;
inputBox("Enter event date: ", &date);
+ Ticket tic;
+ inputBox("Enter row and seat: ", &tic);
char password[PASSWORD_LEN];
inputBox("Enter password [Max 8 characters]: ", &password);
char note[NOTE_LEN];
inputBox("Enter note [Max 32 characters]: ", &note);
- Ticket tic;
- inputBox("Enter row and seat: ", &tic);
handleStatusCode(v->get_es().reserveTicket(name, date, password, note, tic), ticketManagementMenu);
}