-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccreditation.cpp
99 lines (70 loc) · 1.93 KB
/
accreditation.cpp
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "accreditation.h"
// Appel des autres fenêtres
#include "ui_accreditation.h"
//#include "accred.h"
#include <QDialog>
#include <QMainWindow>
#include <QMessageBox>
#include <QFileDialog>
#include <QSlider>
#include <QLCDNumber>
#include <QDir>
#include <QComboBox>
#include <iostream>
#include <fstream>
using namespace std;
Accreditation::Accreditation(QWidget *parent) :
QDialog(parent),
ui(new Ui::Accreditation)
{
ui->setupUi(this);
}
Accreditation::~Accreditation()
{
delete ui;
}
void Accreditation::SetAdr(QString adresse)
{
adr = adresse;
}
void Accreditation::on_Annuler_Accred_clicked()
{
// retour sur la page arrière
close();
}
void Accreditation::on_Valider_Accred_clicked()
{
if(ui->code->text().isEmpty())
{
QMessageBox::information(this, "Erreur", "Veuillez vous identifier");
}
else
{
QString code;
//Accreditation();
code = ui->code->text();
//Accreditation mdp;
if (code.toStdString() == "AB-01-CD")
//if (code == "1")
{
numero_acces = 1; //ils ont tous les droits
QMessageBox::information(this, "Information", "Votre numéro d'accréditation est : 1 ");
//mdp.numero_acces;
close();
}
else if (code.toStdString() == "EF-02-GH")
//else if (code == "2")
{
numero_acces = 2;
QMessageBox::information(this, "Information", "Votre numéro d'accréditation est : 2");
//mdp.numero_acces;
close();
}
else
{
numero_acces = 0; //Aucun droit
QMessageBox::information(this, "Information", "Votre numéro d'accréditation est : 0, vous n'avez pas accès à la bibliothèque! Désolés! Essayez les traitements ou volez un numéro d'accréditation");
close();
}
}
}