comments done!

This commit is contained in:
Holger Börchers 2018-12-29 15:18:16 +01:00
parent cdc82d5686
commit 17d1bcc9f2

View File

@ -684,6 +684,9 @@ reservation* get_reservation_for_customer(customer* const current_customer)
return reservations_of_customer[index - 1]; return reservations_of_customer[index - 1];
} }
/**
* \brief Puts the motorcycle out to the customer.
*/
void rent_a_motorcycle() void rent_a_motorcycle()
{ {
system("cls"); system("cls");
@ -709,7 +712,11 @@ void rent_a_motorcycle()
system("pause"); system("pause");
} }
string current_date_time() /**
* \brief Gets current date and time.
* \return Date & Time formatted as: DD.MM.YYYY HH:MM:SS
*/
string get_current_date_time()
{ {
auto t = time(nullptr); auto t = time(nullptr);
struct tm buf{}; struct tm buf{};
@ -724,11 +731,15 @@ string current_date_time()
return date + " " + time; return date + " " + time;
} }
/**
* \brief Exports the current reservations list into a file.
* If file already exists, it will be appended.
*/
void export_reservations() void export_reservations()
{ {
ofstream f; ofstream f;
f.open("reservierungen.txt", ios::app); f.open("reservierungen.txt", ios::app);
f << "Export (" << current_date_time() << ")" << endl; f << "Export (" << get_current_date_time() << ")" << endl;
f << "Id;Motorcycle;Start;End;Name;First_Name;Cancelled" << endl; f << "Id;Motorcycle;Start;End;Name;First_Name;Cancelled" << endl;
for (auto reservation : reservations) for (auto reservation : reservations)
{ {