-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.h
76 lines (66 loc) · 1.85 KB
/
admin.h
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
#pragma once
#include "BST_Tree.h"
#include "Hashtable.h"
void admin()
{
BST_Tree t;
Hashtable h;
int condition = 0;
while (condition != 6)
{
cout << "Welcome admin" << endl;
cout << "Choose the action you want to do" << endl;
cout << "Press 1 to add account" << endl;
cout << "Press 2 to delete account" << endl;
cout << "Press 3 to check all accounts" << endl;
cout << "Press 4 to view password of account" << endl;
cout << "Press 5 to edit account details" << endl;
cout << "Press 6 to exit" << endl;
cin >> condition;
if (condition == 1)
{
string n = "", a = "";
int acc, p, b;
cout << "Enter name: " << endl;
cin >> n;
cout << "Enter address: " << endl;
cin >> a;
cout << "Enter account number: " << endl;
cin >> acc;
cout << "Enter password: " << endl;
cin >> p;
cout << "Enter balance: " << endl;
cin >> b;
t.add_Account(n, a, acc, p, b);
}
if (condition == 2)
{
int acc = 0;
cout << "Enter account number: " << endl;
cin >> acc;
t.load_Server();
t.Root = t.delete_Account(t.Root, acc);
cout << "Account deleted" << endl;
h.delete_password(acc);
cout << "Password deleted" << endl;
t.update_Server(t.Root);
cout << "Server updated" << endl;
}
if (condition == 3)
{
t.load_Server();
t.printoinfo(t.Root);
}
if (condition == 4)
{
h.displayPasswords();
}
if (condition == 5)
{
}
if (condition == 6)
{
condition = 6;
}
}
}