FactDev  0.1
Models::Project Class Reference

The Project class : Project linked to a Customer. More...

#include <project.h>

Inheritance diagram for Models::Project:
Models::IModel

Public Member Functions

 Project ()
 Project::Project Construct a Project.
 
 Project (QString name)
 Project::project Construct a project with a name.
 
 Project (int id)
 Project::Project Construct a Project which is specified by an id More...
 
virtual ~Project ()
 ~Project Desctruct project object
 
void commit ()
 Project::commit Update project data in the database.
 
void hydrat (int id)
 Project::hydrat Insert project data which is specified by id in the database. More...
 
void remove ()
 Project::remove Remove the current project.
 
QVariantHash getDataMap ()
 getDataMap Get all data of model with a HashMap key/value More...
 
void lock ()
 lock Lock the current project and change endDate by today();
 
bool isLocked () const
 isLocked Return true if the project is locked : end Date of project is passed.
 
void unlock ()
 unlock Unlock the current project;
 
QString getName () const
 Project::getName Return the project name. More...
 
void setName (const QString &name)
 Project::setName Modify the project name More...
 
QString getDescription () const
 Project::getDescription Return a project description. More...
 
void setDescription (const QString &description)
 Project::setDescription Modify the project description More...
 
QDate getBeginDate () const
 Project::getBeginDate return the date of creation of the Project More...
 
void setBeginDate (QDate beginDate)
 Project::setBeginDate Modify beginDate of a Project More...
 
QDate getEndDate () const
 Project::getEndDate Return the endDate of the Project More...
 
void setEndDate (QDate endDate)
 Project::setEndDate Modify endDate of Project More...
 
double getCost () const
 Project::getCost Return the Project cost More...
 
double getDailyRate () const
 Project::getDailyRate Return the daily rate estimated for this project. More...
 
void setDailyRate (double dailyRate)
 Project::setDailyRate Modify the daily rate dailyRate of the current project. More...
 
QSharedPointer< CustomergetCustomer () const
 Project::getCustomer Return the reference to the customer linked to this project. More...
 
void setCustomer (QSharedPointer< Customer > customer)
 Project::setCustomer Modify the customer linked to this project. More...
 
bool operator== (const Project &p)
 Project::operator == Re-define the operator "==" to compare if the current project is the same to the other Project p Return TRUE if both projects are the same, else FALSE. More...
 
bool operator< (const Project &p) const
 Project::operator < defines the operator "< to compare two Project and to see if the fisrt is anterior to the second. More...
 
bool operator!= (const Project &p)
 Project::operator == Re-define the operator "!=" to compare if the current project is differnt to the other Project p Return TRUE if both projects are different, else FALSE. More...
 
- Public Member Functions inherited from Models::IModel
virtual ~IModel ()
 ~IModel Remove an instance of IModel
 
int getId () const
 IModel::getId Return the identify of the element of the database. More...
 
void setId (int id)
 IModel::setId Replace the current identify by id More...
 
bool isToRemoved () const
 toRemoved return if object must be removed. More...
 
void setToRemoved (bool toRemoved)
 setToRemoved Change the flag for removed object More...
 

Additional Inherited Members

- Protected Attributes inherited from Models::IModel
int _id
 Element identify.
 
bool _toRemoved
 Flag to know if the object must be removed.
 

Detailed Description

The Project class : Project linked to a Customer.

Author
Florent Berbie
See Also
IModel

Constructor & Destructor Documentation

Models::Project::Project ( int  id)

Project::Project Construct a Project which is specified by an id

Parameters
id

Member Function Documentation

QDate Models::Project::getBeginDate ( ) const

Project::getBeginDate return the date of creation of the Project

Returns
the begin date of the Project
double Models::Project::getCost ( ) const

Project::getCost Return the Project cost

Returns
the project cost
QSharedPointer< Customer > Models::Project::getCustomer ( ) const

Project::getCustomer Return the reference to the customer linked to this project.

Returns
customer linked to this project
double Models::Project::getDailyRate ( ) const

Project::getDailyRate Return the daily rate estimated for this project.

Returns
the daily rate linket to the current project
QVariantHash Models::Project::getDataMap ( )
virtual

getDataMap Get all data of model with a HashMap key/value

Returns
Model's data

Implements Models::IModel.

QString Models::Project::getDescription ( ) const

Project::getDescription Return a project description.

Returns
project description
QDate Models::Project::getEndDate ( ) const

Project::getEndDate Return the endDate of the Project

Returns
the end date of the project
QString Models::Project::getName ( ) const

Project::getName Return the project name.

Returns
project name
void Models::Project::hydrat ( int  id)
virtual

Project::hydrat Insert project data which is specified by id in the database.

Parameters
idProject identify

Implements Models::IModel.

bool Models::Project::operator!= ( const Project p)

Project::operator == Re-define the operator "!=" to compare if the current project is differnt to the other Project p Return TRUE if both projects are different, else FALSE.

Parameters
cProject to compare
Returns
boolean
bool Models::Project::operator< ( const Project p) const

Project::operator < defines the operator "< to compare two Project and to see if the fisrt is anterior to the second.

Parameters
bthe Project to compare with the current Project
Returns
true if the Project are different else false
bool Models::Project::operator== ( const Project p)

Project::operator == Re-define the operator "==" to compare if the current project is the same to the other Project p Return TRUE if both projects are the same, else FALSE.

Parameters
cProject to compare
Returns
boolean
void Models::Project::setBeginDate ( QDate  beginDate)

Project::setBeginDate Modify beginDate of a Project

Parameters
beginDatethe new date of creation of the project
void Models::Project::setCustomer ( QSharedPointer< Customer customer)

Project::setCustomer Modify the customer linked to this project.

Parameters
customerNew customer associated to this project
void Models::Project::setDailyRate ( double  dailyRate)

Project::setDailyRate Modify the daily rate dailyRate of the current project.

Parameters
dailyRateNew daily rate associated to the current project
void Models::Project::setDescription ( const QString &  description)

Project::setDescription Modify the project description

Parameters
descriptionNew project description
void Models::Project::setEndDate ( QDate  endDate)

Project::setEndDate Modify endDate of Project

Parameters
endDatethe new end date of the project
void Models::Project::setName ( const QString &  name)

Project::setName Modify the project name

Parameters
nameProject name

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