-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemailinboxwindow.cpp
64 lines (50 loc) · 2.37 KB
/
emailinboxwindow.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
#include "emailinboxwindow.h"
#include "ui_emailinboxwindow.h"
EmailInboxWindow::EmailInboxWindow(QWidget *parent) : QDialog(parent),
ui(new Ui::EmailInboxWindow)
{
ui->setupUi(this);
this->p = new Patient;
this->appointmentsLog = new QVector<Appointment>;
this->cancelledAppointmentsLog = new QVector<Appointment>;
this->arrDoc = new QVector<Doctor>;
this->emergencyVisitLog = new QVector<EmergencyVisit>;
this->roomLog = new QVector<Room>;
this->homeVisitLog = new QVector<HomeVisit>;
ui->emailInbox->setText("");
ui->emailInbox->setText("Refresh required.");
}
EmailInboxWindow::~EmailInboxWindow()
{
delete ui;
}
void EmailInboxWindow::on_refreshButton_clicked()
{
int counter = 1;
ui->emailInbox->setText("");
if (this->appointmentsLog->size() == 0 && this->emergencyVisitLog->size() == 0 && this->roomLog->size() == 0 && this->homeVisitLog->size() == 0)
{
ui->emailInbox->setText("Inbox is empty.");
return;
}
for (int i = 0; i < this->emergencyVisitLog->size(); i++)
{
ui->emailInbox->setText(ui->emailInbox->text() + "\nEmail #" + QString::number(counter++) + "\tEmergency Visit #" + QString::number((i + 1)) + " " + this->emergencyVisitLog->at(i).showVisit());
}
for (int i = 0; i < this->appointmentsLog->size(); i++)
{
ui->emailInbox->setText(ui->emailInbox->text() + "\nEmail #" + QString::number(counter++) + "\tAppointment #" + QString::number((i + 1)) + " " + this->appointmentsLog->at(i).showAppointment());
}
for (int i = 0; i < this->cancelledAppointmentsLog->size(); i++)
{
ui->emailInbox->setText(ui->emailInbox->text() + "\nEmail #" + QString::number(counter++) + "\tCancelled Appointment #" + QString::number((i + 1)) + " " + this->cancelledAppointmentsLog->at(i).showAppointment());
}
for (int i = 0; i < this->roomLog->size(); i++)
{
ui->emailInbox->setText(ui->emailInbox->text() + "\nEmail #" + QString::number(counter++) + "\tRoom #" + QString::number((i + 1)) + " " + this->roomLog->at(i).showRoom());
}
for (int i = 0; i < this->homeVisitLog->size(); i++)
{
ui->emailInbox->setText(ui->emailInbox->text() + "\nEmail #" + QString::number(counter++) + "\tHome Visit #" + QString::number((i + 1)) + " " + this->homeVisitLog->at(i).showHomeVisit());
}
}