Change structures into class
This commit is contained in:
@@ -69,17 +69,17 @@ double KissCount::GetAccountAmount(wxString id, int month, int year)
|
||||
return _db->GetAccountAmount(id, month, year);
|
||||
}
|
||||
|
||||
void KissCount::UpdateOperation(struct operation op)
|
||||
void KissCount::UpdateOperation(Operation op)
|
||||
{
|
||||
_db->UpdateOperation(op);
|
||||
}
|
||||
|
||||
wxString KissCount::AddOperation(struct operation op)
|
||||
wxString KissCount::AddOperation(Operation op)
|
||||
{
|
||||
return _db->AddOperation(_user, op);
|
||||
}
|
||||
|
||||
void KissCount::DeleteOperation(struct operation op)
|
||||
void KissCount::DeleteOperation(Operation op)
|
||||
{
|
||||
_db->DeleteOperation(op);
|
||||
}
|
||||
@@ -102,15 +102,15 @@ void KissCount::SetAccountAmount(int month, int year, wxString accountId, double
|
||||
_db->SetAccountAmount(month, year, accountId, amount);
|
||||
}
|
||||
|
||||
void KissCount::AddAccount(struct account ac)
|
||||
void KissCount::AddAccount(Account ac)
|
||||
{
|
||||
ac.id = _db->AddAccount(_user, ac);
|
||||
_user->_accounts.push_back(ac);
|
||||
}
|
||||
|
||||
void KissCount::UpdateAccount(struct account ac)
|
||||
void KissCount::UpdateAccount(Account ac)
|
||||
{
|
||||
std::vector<struct account>::iterator it;
|
||||
std::vector<Account>::iterator it;
|
||||
int i;
|
||||
|
||||
_db->UpdateAccount(ac);
|
||||
@@ -119,9 +119,9 @@ void KissCount::UpdateAccount(struct account ac)
|
||||
_user->_accounts[i] = ac;
|
||||
}
|
||||
|
||||
void KissCount::DeleteAccount(struct account ac)
|
||||
void KissCount::DeleteAccount(Account ac)
|
||||
{
|
||||
std::vector<struct account>::iterator it;
|
||||
std::vector<Account>::iterator it;
|
||||
int i;
|
||||
|
||||
_db->DeleteAccount(ac);
|
||||
@@ -133,7 +133,7 @@ void KissCount::DeleteAccount(struct account ac)
|
||||
}
|
||||
}
|
||||
|
||||
wxString KissCount::AddCategory(struct category category)
|
||||
wxString KissCount::AddCategory(Category category)
|
||||
{
|
||||
wxString id;
|
||||
id = _db->AddCategory(_user, category);
|
||||
@@ -144,7 +144,7 @@ wxString KissCount::AddCategory(struct category category)
|
||||
return id;
|
||||
}
|
||||
|
||||
void KissCount::UpdateCategory(struct category category)
|
||||
void KissCount::UpdateCategory(Category category)
|
||||
{
|
||||
_db->UpdateCategory(category);
|
||||
|
||||
@@ -156,7 +156,7 @@ void KissCount::UpdateCategory(struct category category)
|
||||
}
|
||||
}
|
||||
|
||||
void KissCount::DeleteCategory(struct category category)
|
||||
void KissCount::DeleteCategory(Category category)
|
||||
{
|
||||
_db->DeleteCategory(_user, category);
|
||||
|
||||
@@ -175,13 +175,13 @@ std::map<int, std::vector<int> > KissCount::GetAllOperations()
|
||||
|
||||
void KissCount::GenerateMonth(int monthFrom, int yearFrom, int monthTo, int yearTo)
|
||||
{
|
||||
std::vector<operation>::iterator it;
|
||||
operation op;
|
||||
std::vector<Operation>::iterator it;
|
||||
Operation op;
|
||||
|
||||
_db->GenerateMonth(_user, monthFrom, yearFrom, monthTo, yearTo);
|
||||
|
||||
if (!_user->_operations[yearTo])
|
||||
_user->_operations[yearTo] = new std::map<unsigned int, std::vector<operation> >();
|
||||
_user->_operations[yearTo] = new std::map<unsigned int, std::vector<Operation> >();
|
||||
|
||||
if (monthFrom != -1 && yearFrom != -1)
|
||||
{
|
||||
@@ -221,7 +221,7 @@ void KissCount::ChangeName(wxString name)
|
||||
void KissCount::NewUser(wxString name)
|
||||
{
|
||||
wxDateTime curDate;
|
||||
struct account ac = {wxT(""), wxT("Account 1"), wxT(""), false, true};
|
||||
Account ac = {wxT(""), wxT("Account 1"), wxT(""), false, true};
|
||||
|
||||
_db->NewUser(name);
|
||||
if (_user) delete _user;
|
||||
|
||||
@@ -26,20 +26,20 @@ class KissCount
|
||||
|
||||
void LoadYear(int year, bool force=false);
|
||||
|
||||
wxString AddOperation(struct operation op);
|
||||
void UpdateOperation(struct operation op);
|
||||
void DeleteOperation(struct operation op);
|
||||
wxString AddOperation(Operation op);
|
||||
void UpdateOperation(Operation op);
|
||||
void DeleteOperation(Operation op);
|
||||
void DeleteOperations(int month, int year);
|
||||
|
||||
double GetAccountAmount(wxString id, int month, int year);
|
||||
void SetAccountAmount(int month, int year, wxString accountId, double value);
|
||||
void AddAccount(struct account ac);
|
||||
void UpdateAccount(struct account ac);
|
||||
void DeleteAccount(struct account ac);
|
||||
void AddAccount(Account ac);
|
||||
void UpdateAccount(Account ac);
|
||||
void DeleteAccount(Account ac);
|
||||
|
||||
wxString AddCategory(struct category category);
|
||||
void UpdateCategory(struct category category);
|
||||
void DeleteCategory(struct category category);
|
||||
wxString AddCategory(Category category);
|
||||
void UpdateCategory(Category category);
|
||||
void DeleteCategory(Category category);
|
||||
|
||||
std::map<int, std::vector<int> > GetAllOperations();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user