-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (44 loc) · 913 Bytes
/
main.cpp
File metadata and controls
48 lines (44 loc) · 913 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <QCoreApplication>
#include <iostream>
#include <QDate>
#include "employee.h"
#include "manager.h"
#include "sales.h"
#include "ui.h"
int main(int argc, char *argv[])
{
DBManager* dbManager;
UI ui;
ui.setDataBase(dbManager);
bool stillWorking = true;
try
{
dbManager = new DBManager();
}
catch (QString e)
{
ui.printMessage(e);
}
while(stillWorking)
{
try
{
int commandCode = ui.inputMainCommands();
switch(commandCode)
{
case 1: ui.recordWorker();
break;
case 2: ui.recordSubordinate();
break;
case 3: ui.printWorkerSalary();
break;
case 4: stillWorking = false;
}
}
catch (QString e)
{
ui.printMessage(e);
}
}
return 0;
}