Add in code that actually commits updated records.
This commit is contained in:
@@ -116,7 +116,15 @@ QVariantMap SqlServiceRecord::getRecord(int index)
|
|||||||
|
|
||||||
void SqlServiceRecord::updateRecord(int index, QString serviceProvider, QString dateISO, int miles, QString notes)
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user