Accounts events caught
This commit is contained in:
@@ -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, );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user