Accounts events caught

This commit is contained in:
2010-06-12 15:59:27 +02:00
parent 8d2d985e2e
commit c353c02d5b
7 changed files with 33 additions and 3 deletions

View File

@@ -318,3 +318,15 @@ void Database::DeleteOperation(struct operation op)
EXECUTE_SQL_UPDATE(req, );
}
void Database::SetAccountAmount(int month, int year, wxString accountId, double amount)
{
wxString req;
req = _("UPDATE account_amount SET ") ;
req += _("amount='") + wxString::Format(_("%.2lf"), amount) + _("'");
req += _(" WHERE id='") + accountId + _("'");
req += _(" AND year='") + wxString::Format(_("%d"), year) + _("'");
req += _(" AND month='") + wxString::Format(_("%d"), month) + _("'");
EXECUTE_SQL_UPDATE(req, );
}

View File

@@ -28,6 +28,7 @@ class Database
void UpdateOperation(struct operation op);
void AddOperation(User* user, struct operation op);
void DeleteOperation(struct operation op);
void SetAccountAmount(int month, int year, wxString accountId, double amount);
private:
wxSQLite3Database _db;