Category management in place
This commit is contained in:
@@ -116,3 +116,30 @@ void KissCount::DeleteAccount(struct Account ac)
|
||||
if (it->id == ac.id)
|
||||
_user->_accounts.erase(_user->_accounts.begin()+i);
|
||||
}
|
||||
|
||||
void KissCount::AddCategory(wxString name, wxColour colour)
|
||||
{
|
||||
wxString color;
|
||||
color = _("#") ;
|
||||
color += wxString::Format(_("%02X"), colour.Red());
|
||||
color += wxString::Format(_("%02X"), colour.Green());
|
||||
color += wxString::Format(_("%02X"), colour.Blue());
|
||||
|
||||
_db->AddCategory(_user, name, color);
|
||||
}
|
||||
|
||||
void KissCount::UpdateCategory(wxString oldName, wxString name, wxColour colour)
|
||||
{
|
||||
wxString color;
|
||||
color = _("#") ;
|
||||
color += wxString::Format(_("%02X"), colour.Red());
|
||||
color += wxString::Format(_("%02X"), colour.Green());
|
||||
color += wxString::Format(_("%02X"), colour.Blue());
|
||||
|
||||
_db->UpdateCategory(_user, oldName, name, color);
|
||||
}
|
||||
|
||||
void KissCount::DeleteCategory(wxString name)
|
||||
{
|
||||
_db->DeleteCategory(_user, name);
|
||||
}
|
||||
|
@@ -18,17 +18,24 @@ class KissCount
|
||||
std::list<wxString> GetUsers();
|
||||
bool IsValidUser(wxString user, wxString password);
|
||||
void LoadUser(wxString user);
|
||||
void LoadYear(int year, bool force=false);
|
||||
User* GetUser();
|
||||
double GetAccountAmount(wxString id, int month, int year);
|
||||
void UpdateOperation(struct operation op);
|
||||
|
||||
void LoadYear(int year, bool force=false);
|
||||
|
||||
wxString AddOperation(struct operation op);
|
||||
void UpdateOperation(struct operation op);
|
||||
void DeleteOperation(struct operation op);
|
||||
|
||||
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 AddCategory(wxString name, wxColour colour);
|
||||
void UpdateCategory(wxString oldName, wxString name, wxColour colour);
|
||||
void DeleteCategory(wxString name);
|
||||
|
||||
private:
|
||||
wxUI* _wxUI;
|
||||
Database* _db;
|
||||
|
Reference in New Issue
Block a user