heavily simplified imports and using directives

This commit is contained in:
TinyAtoms
2019-06-29 23:22:58 -03:00
parent 97ed3150ec
commit 085cd5af08
8 changed files with 44 additions and 43 deletions

View File

@ -4,13 +4,17 @@
// constructors
Park_spot::Park_spot(){
parked = nullptr;
id = auto_increment_db() + 1;
taken = false;
Park_spot::Park_spot()
: parked{nullptr},
id{auto_increment_db()+1},
taken{false} {
save_db();
}
Park_spot::~Park_spot(){
update_db();
}
// clock in en out, calls de juist(in/out) van de customer aan de hand van internal state van taken
@ -62,8 +66,7 @@ void Park_spot::save_db() {
void Park_spot::delete_db() {
string statement = "delete from Park_spot where id= ;";
statement.insert(statement.length() - 2, std::to_string(id));
// std::cout << statement;
statement.insert(statement.length() - 2, to_string(id));
SQLite::Transaction transaction(data::db);
data::db.exec(statement);
transaction.commit();