Add some address line
This commit is contained in:
parent
5b39b46ec8
commit
97dc792773
16
Customer.cpp
16
Customer.cpp
@ -2,24 +2,27 @@
|
|||||||
|
|
||||||
|
|
||||||
// constructors
|
// constructors
|
||||||
Customer::Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role_)
|
Customer::Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role_, string address_)
|
||||||
: id{auto_increment_db() + 1},
|
: id{auto_increment_db() + 1},
|
||||||
name{name_},
|
name{name_},
|
||||||
password{hash_password(password_)},
|
password{hash_password(password_)},
|
||||||
vehicle{vehicle_},
|
vehicle{vehicle_},
|
||||||
telephone{telephone_},
|
telephone{telephone_},
|
||||||
role{role_} {
|
role{role_},
|
||||||
|
address{address_} {
|
||||||
save_db();
|
save_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
Customer::Customer(int id_, string name_, string password_, Vehicle_type vehicle_,
|
Customer::Customer(int id_, string name_, string password_, Vehicle_type vehicle_,
|
||||||
vector<Park_time> instances, string telephone_)
|
vector<Park_time> instances, string telephone_, int role_, string address_)
|
||||||
: id{id_},
|
: id{id_},
|
||||||
name{name_},
|
name{name_},
|
||||||
password{password_},
|
password{password_},
|
||||||
vehicle{vehicle_},
|
vehicle{vehicle_},
|
||||||
park_instances{instances},
|
park_instances{instances},
|
||||||
telephone{telephone_} {}
|
telephone{telephone_} ,
|
||||||
|
role{role_},
|
||||||
|
address{address_} {}
|
||||||
|
|
||||||
// clock in/out methods
|
// clock in/out methods
|
||||||
// ====================================================================================
|
// ====================================================================================
|
||||||
@ -72,13 +75,14 @@ void Customer::save_db() {
|
|||||||
void Customer::update_db() {
|
void Customer::update_db() {
|
||||||
string statement =
|
string statement =
|
||||||
"UPDATE Customer SET name = '', password = '', "
|
"UPDATE Customer SET name = '', password = '', "
|
||||||
"vehicle = '', telephone = '', role = '' where id = '';";
|
"vehicle = '', telephone = '', role = '', address='' where id = '' ;";
|
||||||
statement.insert(89, to_string(id));
|
statement.insert(110, to_string(id));
|
||||||
statement.insert(84, to_string(role));
|
statement.insert(84, to_string(role));
|
||||||
statement.insert(73, telephone);
|
statement.insert(73, telephone);
|
||||||
statement.insert(57, to_string(int(vehicle)));
|
statement.insert(57, to_string(int(vehicle)));
|
||||||
statement.insert(43, password);
|
statement.insert(43, password);
|
||||||
statement.insert(28, name);
|
statement.insert(28, name);
|
||||||
|
statement.insert(96, address);
|
||||||
// cout << statement;
|
// cout << statement;
|
||||||
data::db.exec(statement);
|
data::db.exec(statement);
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,11 @@ class Customer {
|
|||||||
string password;
|
string password;
|
||||||
Vehicle_type vehicle;
|
Vehicle_type vehicle;
|
||||||
string telephone;
|
string telephone;
|
||||||
|
string address;
|
||||||
int role;
|
int role;
|
||||||
Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role);
|
Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role_, string address_);
|
||||||
Customer(int id_, string name_, string password_, Vehicle_type vehicle_,
|
Customer(int id_, string name_, string password_, Vehicle_type vehicle_,
|
||||||
vector<Park_time> instances, string telephone_);
|
vector<Park_time> instances, string telephone_, int role_, string address_);
|
||||||
void clock_in(int s_id);
|
void clock_in(int s_id);
|
||||||
void clock_out(int s_id);
|
void clock_out(int s_id);
|
||||||
bool parked();
|
bool parked();
|
||||||
|
Loading…
Reference in New Issue
Block a user