-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
80 lines (69 loc) · 1.94 KB
/
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
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
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "manager.h"
#include "employee.h"
//#include "infomation.h"
int main(void){
Inf* a[20];
int index = 0;
int menu;
int kind_menu;
printf("Enter 1 if you are an employee or 2 if you are a manager\n");
printf("Enter : ");
scanf("%d", &kind_menu);
if(kind_menu == 1){ // employee
index = loadData_Employee(a, index);
while(1){
menu = selectMenu_Employee();
if (menu == 0) break;
switch (menu) {
case 1:
index += addlist_Employee(a, index);
break;
case 2:
readlist_Employee(a, index);
break;
case 3:
index -= deletelist_Employee(a, index);
break;
case 4:
updatelist_Employee(a, index);
break;
case 5:
saveData_Employee(a, index);
break;
default:
printf("Error!\n");
break;
}
}
}
else if(kind_menu == 2){ // manager
index = loadData_Manager(a, index);
while(1){
menu = selectmenu_Manager();
if(menu == 0) break;
switch(menu){
case 1:
approve_Manager(a, index);
break;
case 2:
readList_Manager(a, index);
break;
case 3:
index -= deletelist_Manager(a, index);
break;
case 4:
saveData_Manager(a, index);
break;
default:
printf("Error!\n");
break;
}
}
}
else
printf("Error!");
return 0;
}