-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuser.cpp
More file actions
26 lines (22 loc) · 969 Bytes
/
Copy pathuser.cpp
File metadata and controls
26 lines (22 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "user.h"
User::User()
{
this->setId(-1);
this->setRole("NOT_DEFINED");
}
User::User(QString _nom, QString _login, QString _password, QString _country, QString _birthdate, QString _email, QString _role, QString _statut) :
nom(_nom), login(_login), password(_password), country(_country), birthdate(_birthdate), email(_email), role(_role), statut(_statut)
{}
User::User(int _id, QString _nom, QString _login, QString _password, QString _country, QString _birthdate, QString _email, QString _role, QString _statut) :
id (_id), nom(_nom), login(_login), password(_password), country(_country), birthdate(_birthdate), email(_email), role(_role), statut(_statut)
{}
Role User::getEnumRole()
{
if (role.compare("GESTIONNAIRE") == 0)
return GESTIONNAIRE;
else if (role.compare("CLIENT") == 0)
return CLIENT;
else if (role.compare("ADMINISTRATEUR") == 0)
return ADMINISTRATEUR;
return INCONNU;
};