Mercurial > hg > syntilista
changeset 179:a2f11e6665d6
Add some comments.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 02 Oct 2017 13:39:58 +0300 |
parents | 2155e05bf61c |
children | ee5479079238 |
files | src/main.cpp |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main.cpp Mon Sep 25 13:53:36 2017 +0300 +++ b/src/main.cpp Mon Oct 02 13:39:58 2017 +0300 @@ -1043,11 +1043,13 @@ // int SyntilistaMainWindow::addTransaction(qint64 id, double value, SLPersonInfo &info) { + // Sanity check: Check if the given person ID exists if (!slGetPersonInfo(id, info)) return -1; QSqlDatabase::database().transaction(); + // Add transaction entry QSqlQuery query; query.prepare("INSERT INTO transactions (person,value,added) VALUES (?,?,?)"); query.addBindValue(id); @@ -1060,6 +1062,7 @@ return -2; } + // Update person record timestamp query.prepare("UPDATE people SET updated=? WHERE id=?"); query.addBindValue(QDateTime::currentDateTimeUtc()); query.addBindValue(id);