|
FactDev
0.1
|
The ProjectDatabase class Project table database. More...
#include <projectdatabase.h>
Public Member Functions | |
| Models::Project * | getProject (const int pId) |
| ProjectDatabase::getProject Get informations about the project identified by 'pId'. More... | |
| Models::Project * | getProject (QSqlQuery &q) |
| ProjectDatabase::getProject. More... | |
| int | addProject (const Models::Project &) |
| ProjectDatabase:addProject Add the project 'pProject' to the database. More... | |
| void | updateProject (const Models::Project &) |
| ProjectDatabase:updateProject Update informations about the project. | |
| void | removeProject (const int pId) |
| removeProject Remove the project with the id 'pId' More... | |
| int | getNbProjects () |
| ProjectDatabase:getNbProjects Return the number of projects existing. More... | |
| int | getNbProjects (const int customerId) |
| Get the number of projects. More... | |
| QMap< int, Models::Project > | getProjectsOfCustomer (QSharedPointer< Models::Customer > c, const bool projectLocked=true) |
| getProjectsOfCustomer Return all projects of a customer More... | |
| QList< Models::Project > | getProjects (const int customerId) |
| getProjects Return all projects of a customer More... | |
| WdgModels::ProjectsTableModel * | getProjectsTable (const int pId) throw (DbException*) |
| getProjectsTable Return all projects of a customer in QStandardItemModel More... | |
| QSharedPointer< Project > | updateProject (QSqlQuery &q) |
| getProject Obtain a project without new query More... | |
| QList< Project * > | getAllProjects () |
| Project::getAllProjects Return the list of projects. More... | |
| double | getCostProjects (QList< Project * > projects) |
| ProjectDatabase::getCostProjects compute the cost of the project list given in parameter. More... | |
Public Member Functions inherited from Databases::Database | |
| QString | lastError (const QSqlQuery &q) const |
| Database::lastError Return an error message on the last error occured during the SQL request q More... | |
| void | testCases () |
| Database::testCases Realise a test cases. | |
| void | executeFile (QString pName) |
| Database::executerFichier Exeute a specified file named pName More... | |
| void | openTransaction () |
| Database::openTransaction Open new transaction. | |
| void | closeTransaction () |
| Database::closeTransaction Close current transaction. | |
| void | close () |
| Database::close Close database access. | |
| void | open () |
| Database::open Open database. | |
| ~Database () | |
| Database::~Database Suppression object, and close database access. | |
| void | setDatabase (QSqlDatabase sql) |
| Database::setDatabase Set database. More... | |
| void | updateBillingNumber () |
| Database::updateBillingNumber Update the billing number. | |
| void | cleanDatabase () |
| Database::clearDatabase Drop alls tables of Database WARNING: We can't restore data after. | |
| void | changeDatabase (Databases::DbType dbType) |
| changeDatabase Change the current database : mysql to sqlite or sqlite to mysql More... | |
Static Public Member Functions | |
| static ProjectDatabase * | instance () throw (DbException*) |
| ProjectDatabase::getInstance Return an instance of ProjectDatabase. More... | |
Static Public Member Functions inherited from Databases::Database | |
| static Database * | instance (bool tests=false) throw (DbException*) |
| Database::getInstance Return an instance of Database. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Databases::Database | |
| Database (bool tests=false) throw (DbException*) | |
| Database::Database Database is a singleton. | |
| QVariant | value (const QSqlQuery &q, const QString &champ) const |
| Database::valeur Value of database field. More... | |
Protected Attributes inherited from Databases::Database | |
| QSettings * | _settings |
| settings | |
| QSqlDatabase | mDatabase |
| contains Database | |
| QList< Database * > | _instances |
| List of instances. | |
Static Protected Attributes inherited from Databases::Database | |
| static Database * | _instance = 0 |
| Instance. | |
| static bool | _dbInstance = 0 |
| an instance of db is open | |
| static bool | isOpen = false |
| Database is open. | |
| static bool | _isMysql = false |
The ProjectDatabase class Project table database.
| int Databases::ProjectDatabase::addProject | ( | const Models::Project & | pProject | ) |
ProjectDatabase:addProject Add the project 'pProject' to the database.
| QList< Project * > Databases::ProjectDatabase::getAllProjects | ( | ) |
Project::getAllProjects Return the list of projects.
| double Databases::ProjectDatabase::getCostProjects | ( | QList< Project * > | projects | ) |
ProjectDatabase::getCostProjects compute the cost of the project list given in parameter.
| projects | the list of projects |
| int Databases::ProjectDatabase::getNbProjects | ( | ) |
ProjectDatabase:getNbProjects Return the number of projects existing.
| int Databases::ProjectDatabase::getNbProjects | ( | const int | customerId | ) |
Get the number of projects.
| customerId | If customerId isn't specified if it's not valid, get all projects else get the specified customer projects |
| Models::Project * Databases::ProjectDatabase::getProject | ( | const int | pId | ) |
ProjectDatabase::getProject Get informations about the project identified by 'pId'.
| pId | project |
| Models::Project * Databases::ProjectDatabase::getProject | ( | QSqlQuery & | q | ) |
| QList< Project > Databases::ProjectDatabase::getProjects | ( | const int | customerId | ) |
getProjects Return all projects of a customer
| customerId | The customer id |
| QMap< int, Models::Project > Databases::ProjectDatabase::getProjectsOfCustomer | ( | QSharedPointer< Models::Customer > | c, |
| const bool | projectLocked = true |
||
| ) |
getProjectsOfCustomer Return all projects of a customer
| c | The customer |
| WdgModels::ProjectsTableModel * Databases::ProjectDatabase::getProjectsTable | ( | const int | pId | ) | |
| throw | ( | DbException * | |||
| ) | |||||
getProjectsTable Return all projects of a customer in QStandardItemModel
| filter | Select only projects who are specified by filter |
|
static | |||||||||||||
ProjectDatabase::getInstance Return an instance of ProjectDatabase.
| void Databases::ProjectDatabase::removeProject | ( | const int | pId | ) |
removeProject Remove the project with the id 'pId'
| pId | project id |
| QSharedPointer< Models::Project > Databases::ProjectDatabase::updateProject | ( | QSqlQuery & | q | ) |
getProject Obtain a project without new query
| q | The query to use |