-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreports.cpp
More file actions
110 lines (100 loc) · 3.19 KB
/
reports.cpp
File metadata and controls
110 lines (100 loc) · 3.19 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
#include "reports.h"
#include "ui_reports.h"
#include "statsdialog.h"
#include "viewreportdialog.h"
#include <QPushButton>
Reports::Reports(QWidget *parent) :
QDialog(parent),
ui(new Ui::Reports)
{
ui->setupUi(this);
setItemValues();
addItemsToList();
}
Reports::~Reports()
{
delete ui;
}
/*
* Creates a list of useful information that can be seen immediately by the user.
*/
void Reports::addItemsToList()
{
ui->reportsListWidget->addItem("Number of Reservations Today: "
+ QString::number(getReservationsToday()));
ui->reportsListWidget->addItem("Number of Reservations This Month: "
+ QString::number(getReservationsMonth()));
ui->reportsListWidget->addItem("Capacity Now: "
+ QString::number(getCapacityNow()));
ui->reportsListWidget->addItem("Yearly Capacity: "
+ QString::number(getYearlyCapacity()));
ui->reportsListWidget->addItem("Total Amount of Reservations: "
+ QString::number(getReservationsYear()));
}
/*
* Initialzes all of the the list values
* */
void Reports::setItemValues()
{
setReservationsToday(5);
setReservationsMonth(0);
setReservationsYear(0);
setCapacityNow(0);
setYearlyCapacity(0);
setRoomsOccupied(0);
setRoomsAvailable(0);
}
/*
* When the "Check Ins" button is clicked, show its corresponding dialog.
* */
void Reports::on_st_CheckInsButton_clicked()
{
ci_dialog = new StatsDialog(1, this);
ci_dialog->show();
}
/*
* When the "Check Outs" button is clicked, show its corresponding dialog.
* */
void Reports::on_st_checkOutButton_clicked()
{
co_dialog = new StatsDialog(2, this);
co_dialog->show();
}
/*
* When the "Reservations" button is clicked, show its corresponding dialog.
* */
void Reports::on_st_reservationButton_clicked()
{
re_dialog = new StatsDialog(3, this);
re_dialog->show();
}
/*
* When the "Room Accomodations" button is clicked, show its corresponding dialog.
* */
void Reports::on_st_roomAccom_clicked()
{
ro_dialog = new StatsDialog(4, this);
ro_dialog->show();
}
void Reports::on_re_ResReport_clicked()
{
resrep = new ViewReportDialog();
resrep->show();
}
/*
* Accessor and mutator methods
* */
void Reports::setReservationsToday(int num) { reservationsToday = num; }
void Reports::setReservationsMonth(int num) { reservationsMonth = num; }
void Reports::setReservationsYear(int num) { reservationsYear = num; }
void Reports::setCapacityNow(int num) { capacityNow = num; }
void Reports::setYearlyCapacity(int num) { yearlyCapacity = num; }
void Reports::setRoomsOccupied(int num) { roomsOccupied = num; }
void Reports::setRoomsAvailable(int num) { roomsAvailable = num; }
int Reports::getReservationsToday() { return reservationsToday; }
int Reports::getReservationsMonth() { return reservationsMonth; }
int Reports::getReservationsYear() { return reservationsYear; }
int Reports::getCapacityNow() { return capacityNow; }
int Reports::getYearlyCapacity() { return yearlyCapacity; }
int Reports::getRoomsOccupied() { return roomsOccupied; }
int Reports::getRoomsAvailable() { return roomsAvailable; }