FactDev
0.1
|
The CustomerDatabase class Customer table database. More...
#include <customerdatabase.h>
Public Member Functions | |
WdgModels::CustomersTableModel * | getCustomersTable (QString filter="") throw (DbException*) |
CustomerDatabase::getCustomersTable Return an item model of customers for QTableView. More... | |
QStandardItemModel * | getTree (QString filter="") throw (DbException*) |
CustomerDatabase::getTree Return an item model of customers for QTree. More... | |
QSharedPointer< Models::Customer > | getCustomer (const int pId) |
CustomerDatabase::getCustomer get informations about the customer identified by pId More... | |
int | addCustomer (const Models::Customer &) |
CustomerDatabase::addCustomer Add the customer pCustomer to the database. More... | |
void | updateCustomer (Customer &) |
CustomerDatabase::updateCustomer Update informations about the customer pCustomer | |
void | removeCustomer (const int pId) |
CustomerDatabase::removeCustomer Remove the customer with the id pId More... | |
int | getNbCustomers () |
CustomerDatabase::getNbCustomers Return the number of customers existing. More... | |
QStandardItem * | getItemRoot () |
CustomerDatabase::getItemRoot Return the first item for the QStandardItemModel. More... | |
QStandardItem * | getItemCustomer (QSqlQuery q1) |
CustomerDatabase::getItemCustomer Return the customer item for the QStandardItemModel. More... | |
QStandardItem * | getItemProject (QSqlQuery q2) |
CustomerDatabase::getItemProject Return the project item for the QStandardItemModel. More... | |
QSharedPointer< Models::Customer > | getCustomer (QSqlQuery &q) |
CustomerDatabase::getCustomer Add the element of the q request and return their. More... | |
void | updateCustomer (QSqlQuery &q, Customer &pCustomer) |
CustomerDatabase::updateCustomer Update customer data according to the request q More... | |
QPixmap | getCustomerImage (const int pId) |
CustomerDatabase::getCustomerImage Return a Customer image. More... | |
void | setCustomerImage (Customer &pCustomer) |
CustomerDatabase::setCustomerImage Change the image of the customer pCustomer More... | |
QList< Customer > | getCustomers () |
CustomerDatabase::getCustomers Return all the customers. 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 CustomerDatabase * | instance () throw (DbException*) |
CustomerDatabase::instance Return an instance of CustomerDatabase 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 CustomerDatabase class Customer table database.
int Databases::CustomerDatabase::addCustomer | ( | const Models::Customer & | pCustomer | ) |
CustomerDatabase::addCustomer Add the customer pCustomer to the database.
QSharedPointer< Models::Customer > Databases::CustomerDatabase::getCustomer | ( | const int | pId | ) |
CustomerDatabase::getCustomer get informations about the customer identified by pId
pId | customer id |
QSharedPointer< Models::Customer > Databases::CustomerDatabase::getCustomer | ( | QSqlQuery & | q | ) |
CustomerDatabase::getCustomer Add the element of the q request and return their.
q | SQL request |
QPixmap Databases::CustomerDatabase::getCustomerImage | ( | const int | pId | ) |
CustomerDatabase::getCustomerImage Return a Customer image.
pId | Customer id |
QList< Customer > Databases::CustomerDatabase::getCustomers | ( | ) |
CustomerDatabase::getCustomers Return all the customers.
WdgModels::CustomersTableModel * Databases::CustomerDatabase::getCustomersTable | ( | QString | filter = "" | ) | |
throw | ( | DbException * | |||
) |
CustomerDatabase::getCustomersTable Return an item model of customers for QTableView.
filter | Select only customers who are specified by filter |
DbException |
QStandardItem * Databases::CustomerDatabase::getItemCustomer | ( | QSqlQuery | q1 | ) |
CustomerDatabase::getItemCustomer Return the customer item for the QStandardItemModel.
q1 | the row of the sql query for customers |
QStandardItem * Databases::CustomerDatabase::getItemProject | ( | QSqlQuery | q2 | ) |
CustomerDatabase::getItemProject Return the project item for the QStandardItemModel.
q2 | the row of the sql query for projects |
QStandardItem * Databases::CustomerDatabase::getItemRoot | ( | ) |
CustomerDatabase::getItemRoot Return the first item for the QStandardItemModel.
int Databases::CustomerDatabase::getNbCustomers | ( | ) |
CustomerDatabase::getNbCustomers Return the number of customers existing.
QStandardItemModel * Databases::CustomerDatabase::getTree | ( | QString | filter = "" | ) | |
throw | ( | DbException * | |||
) |
CustomerDatabase::getTree Return an item model of customers for QTree.
filter | Select only customers who are specified by filter |
DbException |
|
static |
CustomerDatabase::instance Return an instance of CustomerDatabase
void Databases::CustomerDatabase::removeCustomer | ( | const int | pId | ) |
CustomerDatabase::removeCustomer Remove the customer with the id pId
pId | customer id |
void Databases::CustomerDatabase::setCustomerImage | ( | Models::Customer & | pCustomer | ) |
CustomerDatabase::setCustomerImage Change the image of the customer pCustomer
pCustomer | Customer |
void Databases::CustomerDatabase::updateCustomer | ( | QSqlQuery & | q, |
Customer & | pCustomer | ||
) |
CustomerDatabase::updateCustomer Update customer data according to the request q
q | SQL request |