-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersonalBudget.cpp
More file actions
79 lines (62 loc) · 2.01 KB
/
Copy pathPersonalBudget.cpp
File metadata and controls
79 lines (62 loc) · 2.01 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
#include "PersonalBudget.h"
#include "SupportMethods.h"
#include "User.h"
using namespace std;
char PersonalBudget :: chooseOptionFromMainMenu() {
char choose;
system("cls");
cout << " >>> MAIN MENU <<<" << endl;
cout << "---------------------------" << endl;
cout << "1. Registration" << endl;
cout << "2. Login" << endl;
cout << "9. End " << endl;
cout << "---------------------------" << endl;
cout << "Your choice: ";
choose = SupportMethods :: getCharacter();
return choose;
}
void PersonalBudget :: userRegistration() {
userManager.userRegistration();
}
void PersonalBudget :: showAllUsers() {
userManager.showAllUsers();
}
bool PersonalBudget :: ifUserIsLogged() {
return userManager.ifUserIsLogged();
}
void PersonalBudget :: userLogIn() {
userManager.userLogIn();
if (userManager.ifUserIsLogged()) {
itemManager = new ItemManager (FILE_NAME_WITH_INCOMES, FILE_NAME_WITH_EXPENSES, userManager.getIdLoggedUser()); //Jesli uzytkownik jest zalogowany, tworzony jest nowy obiekt klasy ItemManager. Ten obiekt przyjmuje dwa argumenty:
}
}
void PersonalBudget :: logOffUser() {
userManager.logOffUser();
delete itemManager;
itemManager = NULL;
}
char PersonalBudget :: chooseOptionFromUserMenu() {
return userManager.chooseOptionFromUserMenu();
}
void PersonalBudget :: addIncome() {
if (userManager.ifUserIsLogged()) {
itemManager->addIncome();
}
}
void PersonalBudget :: changePasswordLoggedUser() {
userManager.changePasswordLoggedUser();
}
void PersonalBudget :: addExpense() {
if (userManager.ifUserIsLogged()) {
itemManager->addExpense();
}
}
void PersonalBudget :: displayBalanceForCurrentMonth() {
return itemManager -> displayBalanceForCurrentMonth();
}
void PersonalBudget :: displayBalanceForPreviousMonth() {
return itemManager -> displayBalanceForPreviousMonth();
}
void PersonalBudget :: displayBalanceForSelectedPeriod(){
return itemManager -> displayBalanceForSelectedPeriod();
}