can save to db
This commit is contained in:
11
Customer.cpp
11
Customer.cpp
@ -10,6 +10,7 @@ Customer::Customer(string name_, Verhicle_type verhicle_):
|
||||
save_db();
|
||||
}
|
||||
|
||||
|
||||
Customer::Customer(int id_, string name_, string card_code_, Verhicle_type verhicle_, vector<Park_time> instances)
|
||||
: name{name_},
|
||||
card_code{card_code_},
|
||||
@ -20,19 +21,20 @@ Customer::Customer(int id_, string name_, string card_code_, Verhicle_type verhi
|
||||
}
|
||||
|
||||
|
||||
|
||||
// clock methods ====================================================================================
|
||||
// clock in/out methods ====================================================================================
|
||||
/*
|
||||
creert een park_time object met start time= nu, en voegt t toe aan een vector.
|
||||
Create a p_time object with start=now and adds to vector
|
||||
*/
|
||||
void Customer::clock_in(int s_id) {
|
||||
Park_time pt{id, s_id};
|
||||
park_instances.push_back(pt);
|
||||
}
|
||||
|
||||
// edit de laatste park_time obj in de vector zodat de end_time = now.
|
||||
// edit last p_time object so end=now
|
||||
void Customer::clock_out(int s_id) { park_instances[park_instances.size() - 1].clock_out(id, s_id); }
|
||||
|
||||
|
||||
|
||||
// report gen
|
||||
void Customer::gen_monthly() {
|
||||
std::cout << "NAME: " << name << " card code: " << card_code << "\n";
|
||||
@ -44,6 +46,7 @@ void Customer::gen_monthly() {
|
||||
std::cout << "-------------------------------------------------\n\n";
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
// functions that interact with the database
|
||||
|
||||
|
Reference in New Issue
Block a user