Website Summary Files Commits Branches @commit @diff @stats
path: root / src / VenueConsoleUI.cpp
diff options
context:
space:
mode:
Commit9033a1d5f00607672c53168c1aa42bbe8b84384a (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 13:48:30 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 13:48:30 +0300
Files728cfb6228a66f03f87762a9ec256458f6d1f94f /src/VenueConsoleUI.cpp
FMI-OOP-P1_TicketSystem-9033a1d5f00607672c53168c1aa42bbe8b84384a.tar
FMI-OOP-P1_TicketSystem-9033a1d5f00607672c53168c1aa42bbe8b84384a.tar.gz
FMI-OOP-P1_TicketSystem-9033a1d5f00607672c53168c1aa42bbe8b84384a.zip
Parent65499bb801ce663a2bc45a3508fa32246090d0e7 (diff)
Autocommit at 05.05.2022 @ 13:48
1 files changed, 11 insertions, 1 deletions
-rw-r--r--src/VenueConsoleUI.cpp12
diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp
index 49654e1..46161bd 100644
--- a/src/VenueConsoleUI.cpp
+++ b/src/VenueConsoleUI.cpp
@@ -1,17 +1,27 @@
#include "VenueConsoleUI.h"
#include "String/String.h"
+#include "DateTime/DateTime.h"
#include "ConsoleInterface/Menu.h"
#include "ConsoleInterface/Toolbox.hpp"
Venue v;
void command_newEvent() {
+ printTitle("Creating new event");
+
unsigned hallIndex;
inputBox("Enter hall index: ", &hallIndex);
+ if (!v.hallExists(hallIndex)) {
+ printError("Invalid hall index!");
+ return;
+ }
+
char name[MAX_LINE_WIDTH];
inputLineBox("Enter event name: ", name, MAX_LINE_WIDTH);
+ DateTime dt;
+ inputBox("Enter event date and time: ", &dt);
- v.es.createEvent();
+ v.get_es().createEvent(v.get_halls()[hallIndex], name, dt);
}
void runUI(Venue& venue) {