plan stuff;ready up stuff for role_control
This commit is contained in:
parent
0d05bb4aa4
commit
0600cb86b3
40
admin_user.h
40
admin_user.h
@ -16,6 +16,9 @@
|
||||
#endif //MENU_H
|
||||
|
||||
//list of functions
|
||||
//TODO: split all controller functions into their own files
|
||||
//TODO: reformat all output to be formatted and unifed
|
||||
//TODO: create a list base function to unified all variants of list functions
|
||||
void inv_control();
|
||||
void tran_control();
|
||||
void user_control();
|
||||
@ -48,7 +51,7 @@ void admin_menu(){
|
||||
user_control();
|
||||
break;
|
||||
case 4://role management
|
||||
// role_control();
|
||||
role_control();
|
||||
break;
|
||||
case 5://Exit
|
||||
break;
|
||||
@ -1061,4 +1064,39 @@ struct user showUser(struct user db,int index){
|
||||
}
|
||||
}while(choice != 0);
|
||||
return db;
|
||||
}
|
||||
|
||||
//role control
|
||||
void add_role(struct user db);
|
||||
void edit_role(struct user db);
|
||||
void role_control(){
|
||||
int choice = -1;
|
||||
struct user db = read_db_user();
|
||||
do{
|
||||
system("cls");
|
||||
welcome_message();
|
||||
printf("Role control\n");
|
||||
printf("0 exit\n");
|
||||
printf("1 add role\n");
|
||||
printf("2 list role\n");
|
||||
printf("Enter choice: ");
|
||||
fflush(stdin);
|
||||
scanf("%d", &choice);
|
||||
switch (choice){
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
add_role(db);
|
||||
break;
|
||||
case 2:
|
||||
list_role(db);
|
||||
break;
|
||||
default:
|
||||
printf("Invalid choice\n");
|
||||
printf("press any key to continue\n");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
break;
|
||||
}
|
||||
}while(choice != 0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user