From 43035181afaead502086f1d75c01c9b689b2019a Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Sat, 22 Aug 2020 19:16:02 -0400 Subject: [PATCH] Add in code that actually commits updated records. --- src/db/sqlservicerecord.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/db/sqlservicerecord.cpp b/src/db/sqlservicerecord.cpp index 2d4632d..d717974 100644 --- a/src/db/sqlservicerecord.cpp +++ b/src/db/sqlservicerecord.cpp @@ -116,7 +116,15 @@ QVariantMap SqlServiceRecord::getRecord(int index) void SqlServiceRecord::updateRecord(int index, QString serviceProvider, QString dateISO, int miles, QString notes) { - //TODO + QSqlRecord record = this->record(index); + record.setValue("serviceprovider", serviceProvider); + record.setValue("servicedate", dateISO); + record.setValue("miles", miles); + record.setValue("notes", notes); + + this->setRecord(index, record); + this->database().commit(); + this->select(); } -- GitLab