FactDev  0.1
Databases::ContributoryDatabase Class Reference

The ContributoryDatabase class Contributory (or Quote) table database. More...

#include <contributorydatabase.h>

Inheritance diagram for Databases::ContributoryDatabase:
Databases::Database

Public Member Functions

Models::ContributorygetContributory (const int idContributory)
 ContributoryDatabase::getCustomer get informations about the Contributory identified by pId More...
 
Models::ContributoriesList getContributoriesByBilling (const int billingId)
 ContributoryDatabase::getContributoriesByBilling get informations about the Contributory identified by Billing More...
 
int addContributory (const Models::Contributory &)
 ContributoryDatabase::addContributory Add the Contributory pContributory to the database. More...
 
void updateContributory (const Models::Contributory &)
 ContributoryDatabase::updateCustomer Update informations about the Contributory pCustomer
 
void removeContributory (const int pId)
 ContributoryDatabase::removeCustomer Remove the Contributory with the id pId More...
 
Models::ContributorygetContributory (QSqlQuery &q)
 getContributory Obtain a contributory without new query More...
 
Models::ContributoriesList getContributoriesByBillingAndProject (const int billingId, const int projectId)
 getContributory Get contributories list by project and billing 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 ContributoryDatabaseinstance () throw (DbException*)
 ContributoryDatabase::getInstance Return an instance of ContributoryDatabase More...
 
- Static Public Member Functions inherited from Databases::Database
static Databaseinstance (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
 

Detailed Description

The ContributoryDatabase class Contributory (or Quote) table database.

Author
See Also
Database
Contributory/Quote

Member Function Documentation

int Databases::ContributoryDatabase::addContributory ( const Models::Contributory pContributory)

ContributoryDatabase::addContributory Add the Contributory pContributory to the database.

Returns
Contributory id
Models::ContributoriesList Databases::ContributoryDatabase::getContributoriesByBilling ( const int  billingId)

ContributoryDatabase::getContributoriesByBilling get informations about the Contributory identified by Billing

Parameters
idBillingContributory id
Returns
the Contributory
Models::ContributoriesList Databases::ContributoryDatabase::getContributoriesByBillingAndProject ( const int  billingId,
const int  projectId 
)

getContributory Get contributories list by project and billing

Parameters
billingId
projectId
Returns
The contributories list by project and billing
Models::Contributory * Databases::ContributoryDatabase::getContributory ( const int  idContributory)

ContributoryDatabase::getCustomer get informations about the Contributory identified by pId

Parameters
idContributoryContributory id
Returns
the Contributory
Models::Contributory * Databases::ContributoryDatabase::getContributory ( QSqlQuery &  q)

getContributory Obtain a contributory without new query

Parameters
qThe query to use
Returns
The contributory linked to q
ContributoryDatabase * Databases::ContributoryDatabase::instance ( )
throw (DbException *
)
static

ContributoryDatabase::getInstance Return an instance of ContributoryDatabase

See Also
DbException
Returns
Instance of ContributoryDatabase
void Databases::ContributoryDatabase::removeContributory ( const int  pId)

ContributoryDatabase::removeCustomer Remove the Contributory with the id pId

Parameters
pIdContributory id

The documentation for this class was generated from the following files: