-
Notifications
You must be signed in to change notification settings - Fork 1
/
cao_panel.cpp
90 lines (70 loc) · 1.75 KB
/
cao_panel.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
#include "cao_panel.h"
#include "ui_cao_panel.h"
Cao_panel::Cao_panel(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Cao_panel)
{
ui->setupUi(this);
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("data.sqlite3");
db.open();
// set a "cursor"
query = QSqlQuery(db);
//Name And Address Of the Institution as saved in databse
if(!query.exec("SELECT institution_name, institution_address FROM users WHERE access = 1")) qDebug() << "Error while Extracting name and address";
query.first();
ui->inst_name->setText(query.value(0).toString());
}
Cao_panel::~Cao_panel()
{
delete ui;
}
void Cao_panel::on_pushButton_addstaff_clicked()
{
hide();
astaff = new addStaff;
astaff -> showMaximized();
}
void Cao_panel::on_pushButton_modifystaff_clicked()
{
hide();
modStaff = new modifyStaff;
modStaff -> showMaximized();
}
void Cao_panel::on_pushButton_viewstaff_clicked()
{
hide();
viewstaff = new viewstfrecord;
viewstaff -> showMaximized();
}
void Cao_panel::on_pushButton_deletestaff_clicked()
{
hide();
delStaff = new deleteStaff;
delStaff -> show();
}
void Cao_panel::on_pushButton_exitstaff_clicked()
{
close();
}
void Cao_panel::on_pushButton_changepasswordstaff_clicked()
{
change_pass = new changepassword;
change_pass -> showMaximized();
}
void Cao_panel::on_pushButton_clicked()
{
abt_us = new About;
abt_us -> show();
}
void Cao_panel::on_viewstafftable_clicked()
{
hide();
vstafftable = new viewstftable;
vstafftable -> showMaximized();
}
void Cao_panel::on_pushButton_19_clicked()
{
abt = new About ;
abt -> show();
}