A lot of good job done
This commit is contained in:
@@ -74,9 +74,9 @@ void KissCount::UpdateOperation(struct operation op)
|
||||
_db->UpdateOperation(op);
|
||||
}
|
||||
|
||||
void KissCount::AddOperation(struct operation op)
|
||||
wxString KissCount::AddOperation(struct operation op)
|
||||
{
|
||||
_db->AddOperation(_user, op);
|
||||
return _db->AddOperation(_user, op);
|
||||
}
|
||||
|
||||
void KissCount::DeleteOperation(struct operation op)
|
||||
@@ -89,18 +89,30 @@ void KissCount::SetAccountAmount(int month, int year, wxString accountId, double
|
||||
_db->SetAccountAmount(month, year, accountId, amount);
|
||||
}
|
||||
|
||||
void KissCount::InsertAccount(struct Account ac)
|
||||
void KissCount::AddAccount(struct Account ac)
|
||||
{
|
||||
_db->InsertAccount(_user, ac);
|
||||
ac.id = _db->AddAccount(_user, ac);
|
||||
_user->_accounts.push_back(ac);
|
||||
}
|
||||
|
||||
void KissCount::UpdateAccount(struct Account ac)
|
||||
{
|
||||
std::vector<Account>::iterator it;
|
||||
int i;
|
||||
|
||||
_db->UpdateAccount(ac);
|
||||
for (i=0, it=_user->_accounts.begin(); it !=_user->_accounts.end(); it++, i++)
|
||||
if (it->id == ac.id)
|
||||
_user->_accounts[i] = ac;
|
||||
}
|
||||
|
||||
void KissCount::DeleteAccount(struct Account ac)
|
||||
{
|
||||
std::vector<Account>::iterator it;
|
||||
int i;
|
||||
|
||||
_db->DeleteAccount(ac);
|
||||
_user->_accounts.erase(ac.id);
|
||||
for (i=0, it=_user->_accounts.begin(); it !=_user->_accounts.end(); it++, i++)
|
||||
if (it->id == ac.id)
|
||||
_user->_accounts.erase(_user->_accounts.begin()+i);
|
||||
}
|
||||
|
@@ -22,10 +22,10 @@ class KissCount
|
||||
User* GetUser();
|
||||
double GetAccountAmount(wxString id, int month, int year);
|
||||
void UpdateOperation(struct operation op);
|
||||
void AddOperation(struct operation op);
|
||||
wxString AddOperation(struct operation op);
|
||||
void DeleteOperation(struct operation op);
|
||||
void SetAccountAmount(int month, int year, wxString accountId, double value);
|
||||
void InsertAccount(struct Account ac);
|
||||
void AddAccount(struct Account ac);
|
||||
void UpdateAccount(struct Account ac);
|
||||
void DeleteAccount(struct Account ac);
|
||||
|
||||
|
Reference in New Issue
Block a user