1 Commits

Author SHA1 Message Date
3b45ae4d02 Cosmetic changes 2019-07-22 10:17:36 -03:00
5 changed files with 399 additions and 403 deletions

View File

@ -13,14 +13,13 @@ Customer::Customer(string name_, string password_, Vehicle_type vehicle_, string
}
Customer::Customer(int id_, string name_, string password_, Vehicle_type vehicle_,
vector<Park_time> instances, string telephone_, int role_)
vector<Park_time> instances, string telephone_)
: id{id_},
name{name_},
password{password_},
vehicle{vehicle_},
park_instances{instances},
telephone{telephone_},
role{role_} {}
telephone{telephone_} {}
// clock in/out methods
// ====================================================================================

View File

@ -277,7 +277,7 @@
cout << "\nWhat's the password? ";
std::getline(cin, password);
Customer newcustomer{name, password, Vehicle_type(vtype), telephone, role};
cout << "\nNew customer sucessfully created with ID:" << newcustomer.id << "\n";
cout << "\nNew customer sucessfully created\n";
if (confirm())
newcustomer.update_db();
}
@ -294,10 +294,10 @@
std::getline(cin, telephone);
cout << "\nWhat's the password?";
std::getline(cin, password);
Customer newadmin{name, password, Vehicle_type(vtype), telephone, role};
cout << "\nNew customer sucessfully created with ID=" << newadmin.id << "\n";
Customer newcustomer{name, password, Vehicle_type(vtype), telephone, role};
cout << "\nNew customer sucessfully created\n";
if (confirm())
newadmin.update_db();
newcustomer.update_db();
}
void new_parkspot(vector<Park_spot>& spots) {

View File

@ -41,10 +41,9 @@ vector<Customer> query_customer_with_name(string name) {
string password = query.getColumn(2);
int vehicle = query.getColumn(3); // cast to vehicle
string telephone = query.getColumn(4);
int role = query.getColumn(5);
vector<Park_time> park_instances = query_parktimes_for_customer(id);
result.push_back(
Customer{id, name_, password, Vehicle_type(vehicle), park_instances, telephone, role});
Customer{id, name_, password, Vehicle_type(vehicle), park_instances, telephone});
}
return result;
}
@ -64,10 +63,8 @@ Customer query_customer_with_id(int id) {
string password = query.getColumn(2);
int vehicle = query.getColumn(3); // cast to vehicle
string telephone = query.getColumn(4);
int role = query.getColumn(5);
vector<Park_time> park_instances = query_parktimes_for_customer(id);
Customer result{id, name, password, Vehicle_type(vehicle), park_instances, telephone, role};
Customer result{id, name, password, Vehicle_type(vehicle), park_instances, telephone};
return result;
}
}

View File

@ -41,9 +41,9 @@ class Customer {
Vehicle_type vehicle;
string telephone;
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);
Customer(int id_, string name_, string password_, Vehicle_type vehicle_,
vector<Park_time> instances, string telephone_, int role_);
vector<Park_time> instances, string telephone_);
void clock_in(int s_id);
void clock_out(int s_id);
bool parked();

BIN
test.db3

Binary file not shown.