FactDev  0.1
contributorydatabase.h
1 #ifndef CONTRIBUTORYDATABASE_H
2 #define CONTRIBUTORYDATABASE_H
3 
4 #include "database.h"
5 #include "database/projectdatabase.h"
6 
7 #include "models/contributory.h"
8 #include "models/contributorieslist.h"
9 
10 #include "utils/log.h"
11 #include "utils/string.h"
12 
13 using namespace Exceptions;
14 using namespace Utils;
15 
16 namespace Databases {
17 
26 {
27 public:
34  static ContributoryDatabase* instance()throw(DbException*);
35 
42  Models::Contributory *getContributory(const int idContributory);
43 
50  Models::ContributoriesList getContributoriesByBilling(const int billingId);
51 
57  int addContributory(const Models::Contributory&);
58 
63  void updateContributory(const Models::Contributory&);
64 
70  void removeContributory(const int pId);
71 
77  Models::Contributory *getContributory(QSqlQuery &q);
78 
85  Models::ContributoriesList getContributoriesByBillingAndProject(
86  const int billingId, const int projectId);
87 
88 
89 private:
91  static ContributoryDatabase* _instance;
92 
97 
98 };
99 }
100 #endif // CONTRIBUTORYDATABASE_H
The DbException class for database exception : queries, db file, …
Definition: dbexception.h:18
The Database class Master class for all database access.
Definition: database.h:34
The ContributoryDatabase class Contributory (or Quote) table database.
Definition: contributorydatabase.h:25
The Unit enum Unity of work : hour or day.
Definition: contributory.h:18
The ContributoriesList class List of contributories.
Definition: contributorieslist.h:19