diff --git a/src/Motorradvermietung.cpp b/src/Motorradvermietung.cpp index da52a65..434229a 100644 --- a/src/Motorradvermietung.cpp +++ b/src/Motorradvermietung.cpp @@ -1,9 +1,7 @@ #include #include #include -#include #include -#include using namespace std; @@ -301,7 +299,7 @@ date get_validated_date(const string&& question) { auto date_as_string = ask_question(question + " (tt.mm.jjjj)"); - unsigned short day = 0, month = 0, year = 0; + auto day = 0, month = 0, year = 0; const auto res = sscanf_s(date_as_string.c_str(), "%2d.%2d.%4d", &day, &month, @@ -309,7 +307,11 @@ date get_validated_date(const string&& question) if (res == 3 && (month >= 1 && month <= 12) && (day >= 1 && day <= 31) && (year >= 1900 && month <= 2200)) { - return date{day, month, year}; + return date{ + static_cast(day), + static_cast(month), + static_cast(year) + }; } cout << "Fehlerhafte Eingabe." << endl; } @@ -352,14 +354,15 @@ bool validate_reservation(reservation* const reservation) { for (auto r : reservations) { - if(r->get_motorcycle() == reservation->get_motorcycle()) + if (r->get_motorcycle() == reservation->get_motorcycle()) { - if(reservation->get_start_date().get_sum() > r->get_end_date().get_sum()) + if (reservation->get_start_date().get_sum() > r->get_end_date().get_sum()) { //TODO } } } + return true; } void create_reservation() diff --git a/src/Motorradvermietung.vcxproj b/src/Motorradvermietung.vcxproj index d718f89..25b6a29 100644 --- a/src/Motorradvermietung.vcxproj +++ b/src/Motorradvermietung.vcxproj @@ -107,11 +107,15 @@ _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true pch.h + true Console true + + true +