eFinancialPlanner  V1.0 (proof of concept)
Personal Financial Planning based on Maslowian Portfolio Theory
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
frequency.class.cpp
Go to the documentation of this file.
2 {
3  public:
4 
5  string frequency_id;
6  float multiplier;
7 
8  bool set_freq(string the_freq);
9  string get_freq_label();
10 };
11 
12 
18 bool cls_frequency::set_freq(string the_freq)
19 {
20  string s;
21  s = "SELECT COUNT(*) AS EXIST_NBR from " + oConfig.tbl_prefix + "_frequencies WHERE frequency_id = '" + the_freq + "';";
22  db.res = db.stmt->executeQuery(s);
23  while (db.res->next())
24  {
25  if (db.res->getString("EXIST_NBR") == "1")
26  {
27  this->frequency_id = the_freq;
28  return true;
29  }
30  else
31  {
32  return false;
33  }
34  }
35  return false; // table not found ;-)
36 }
37 
38 
45 {
46  string s;
47  s = "SELECT * FROM " + oConfig.tbl_prefix + "_frequencies WHERE frequency_id = '" + this->frequency_id + "';";
48  db.res = db.stmt->executeQuery(s);
49  while (db.res->next())
50  {
51  return db.res->getString("frequency_name");
52  }
53  return "";
54 }
string get_freq_label()
sql::ResultSet * res
bool set_freq(string the_freq)
sql::Statement * stmt
const string tbl_prefix
tables start with "" + oConfig.tbl_prefix + "_" if the prefix is eg. "tbl" then we have "tbl_invesotr...
db_helper db
Definition: efp.cpp:183
config oConfig
mysql connection mysql connector from dev.mysql.com
Definition: efp.cpp:149