Money Manager EX
An easy to use, money management application built with wxWidgets
Model_Report.h
Go to the documentation of this file.
1 /*******************************************************
2  Copyright (C) 2013,2014 Guan Lisheng (guanlisheng@gmail.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  ********************************************************/
18 
19 #ifndef MODEL_REPORT_H
20 #define MODEL_REPORT_H
21 
22 #include "Model.h"
23 #include "db/DB_Table_Report_V1.h"
24 
25 class Model_Report : public Model<DB_Table_REPORT_V1>
26 {
27 public:
29 
30 public:
31  Model_Report();
32  ~Model_Report();
33 
34 public:
41  static Model_Report& instance(wxSQLite3Database* db);
42 
47  static Model_Report& instance();
48 
49 public:
50  bool get_objects_from_sql(const wxString& query, PrettyWriter<StringBuffer>& json_writer);
51  wxArrayString allGroupNames();
52  int get_html(const Data* r, wxString& out);
53  //wxString get_html(const Data& r);
54 
55 public:
56  Data* get(const wxString& name);
57  static bool PrepareSQL(wxString& sql, std::map <wxString, wxString>& rep_params);
58  static const std::vector<std::pair<wxString, wxString>> getParamNames();
59 
60 private:
61  struct Values
62  {
63  wxString label;
64  wxString type;
65  wxString def_value;
66  int ID;
67  wxString name;
68  };
69  static const std::vector<Values> SqlPlaceHolders();
70 };
71 
72 #endif //
Copyright: (c) 2013 - 2025 Guan Lisheng (guanlisheng@gmail.com) Copyright: (c) 2017 - 2018 Stefano Gi...
Data is a single record in the database table.
Definition: DB_Table_Report_V1.h:211
static bool PrepareSQL(wxString &sql, std::map< wxString, wxString > &rep_params)
Definition: Model_Report.cpp:188
Model_Report()
Definition: Model_Report.cpp:52
static const std::vector< std::pair< wxString, wxString > > getParamNames()
Definition: Model_Report.cpp:95
static Model_Report & instance()
Return the static instance address for Model_Report table Note: Assigning the address to a local vari...
Definition: Model_Report.cpp:61
~Model_Report()
Definition: Model_Report.cpp:56
Definition: Model_Report.h:25
bool get_objects_from_sql(const wxString &query, PrettyWriter< StringBuffer > &json_writer)
Definition: Model_Report.cpp:105
Definition: Model.h:139
virtual wxString query() const
Definition: DB_Table.h:61
wxString name() const
Name of the table.
Definition: DB_Table_Report_V1.h:443
int get_html(const Data *r, wxString &out)
Definition: Model_Report.cpp:235
wxArrayString allGroupNames()
Definition: Model_Report.cpp:173