Fix some bugs and resize images

This commit is contained in:
2010-07-01 21:13:14 +02:00
parent 1d1164ef02
commit 7bdf6bd1e4
6 changed files with 26 additions and 13 deletions

View File

@@ -448,7 +448,25 @@ void Database::SetAccountAmount(int month, int year, wxString accountId, double
req += _(" AND year='") + wxString::Format(_("%d"), year) + _("'");
req += _(" AND month='") + wxString::Format(_("%d"), month) + _("'");
EXECUTE_SQL_UPDATE(req, );
try
{
if (!_db.ExecuteUpdate(req))
{
req = _("INSERT INTO account_amount ('account', 'year', 'month', 'amount') VALUES ('") ;
req += accountId + _("'");
req += _(" ,'") + wxString::Format(_("%d"), year) + _("'");
req += _(" ,'") + wxString::Format(_("%d"), month) + _("'");
req += _(" ,'") + DoubleToString(amount) + _("'");
req += _(")");
EXECUTE_SQL_UPDATE(req, );
}
}
catch (wxSQLite3Exception e)
{
std::cerr << req.mb_str() << "\n" ;
std::cerr << e.GetMessage().mb_str() << "\n" ;
return ;
}
}
wxString Database::AddAccount(User* user, struct Account ac)