From 1c840a04f5af77fc57df16526e88171314e6fd78 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 21 Jul 2019 21:54:19 -0300 Subject: [PATCH] Revert "Add some address line" This reverts commit 97dc792773ea8814aec2422f606230466e91acda. --- Customer.cpp | 16 ++++++---------- headers/Customer.h | 5 ++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Customer.cpp b/Customer.cpp index 66d4fba..450b425 100644 --- a/Customer.cpp +++ b/Customer.cpp @@ -2,27 +2,24 @@ // constructors -Customer::Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role_, string address_) +Customer::Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role_) : id{auto_increment_db() + 1}, name{name_}, password{hash_password(password_)}, vehicle{vehicle_}, telephone{telephone_}, - role{role_}, - address{address_} { + role{role_} { save_db(); } Customer::Customer(int id_, string name_, string password_, Vehicle_type vehicle_, - vector instances, string telephone_, int role_, string address_) + vector instances, string telephone_) : id{id_}, name{name_}, password{password_}, vehicle{vehicle_}, park_instances{instances}, - telephone{telephone_} , - role{role_}, - address{address_} {} + telephone{telephone_} {} // clock in/out methods // ==================================================================================== @@ -75,14 +72,13 @@ void Customer::save_db() { void Customer::update_db() { string statement = "UPDATE Customer SET name = '', password = '', " - "vehicle = '', telephone = '', role = '', address='' where id = '' ;"; - statement.insert(110, to_string(id)); + "vehicle = '', telephone = '', role = '' where id = '';"; + statement.insert(89, to_string(id)); statement.insert(84, to_string(role)); statement.insert(73, telephone); statement.insert(57, to_string(int(vehicle))); statement.insert(43, password); statement.insert(28, name); - statement.insert(96, address); // cout << statement; data::db.exec(statement); } diff --git a/headers/Customer.h b/headers/Customer.h index eb7b6f0..3933fd7 100644 --- a/headers/Customer.h +++ b/headers/Customer.h @@ -40,11 +40,10 @@ class Customer { string password; Vehicle_type vehicle; string telephone; - string address; int role; - Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role_, string address_); + Customer(string name_, string password_, Vehicle_type vehicle_, string telephone_, int role); Customer(int id_, string name_, string password_, Vehicle_type vehicle_, - vector instances, string telephone_, int role_, string address_); + vector instances, string telephone_); void clock_in(int s_id); void clock_out(int s_id); bool parked();