-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.c
48 lines (42 loc) · 985 Bytes
/
Main.c
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
#include "Glob.h"
sqlite3 *db;
sqlite3_stmt *res;
int rc;
int currUser = NO_USER;
int working = 1;
char currLogin[100];
void (* adminQueriesFromBase[])(int) = {addClientFromBase, modifyClientFromBase, deleteClientFromBase, addAccountFromBase, modifyAccountFromBase, deleteAccountFromBase };
int main()
{
rc = sqlite3_open("./Uranus_Banking/Bank.db", &db);
if (rc)
{
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
return 1;
}
performPreparations();
while(working)
{
if (currUser == NO_USER)
{
showDefaultMenu();
}
else if (currUser == ADMIN)
{
showAdminMenu();
}
else if (currUser == OPER)
{
showOperMenu();
}
else if (currUser == CLIENT)
{
showClientMenu();
}
else
break;
}
sqlite3_finalize(res);
sqlite3_close(db);
return 0;
}