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
|
#endif //MENU_H
|
||||||
|
|
||||||
//list of functions
|
//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 inv_control();
|
||||||
void tran_control();
|
void tran_control();
|
||||||
void user_control();
|
void user_control();
|
||||||
@ -48,7 +51,7 @@ void admin_menu(){
|
|||||||
user_control();
|
user_control();
|
||||||
break;
|
break;
|
||||||
case 4://role management
|
case 4://role management
|
||||||
// role_control();
|
role_control();
|
||||||
break;
|
break;
|
||||||
case 5://Exit
|
case 5://Exit
|
||||||
break;
|
break;
|
||||||
@ -1061,4 +1064,39 @@ struct user showUser(struct user db,int index){
|
|||||||
}
|
}
|
||||||
}while(choice != 0);
|
}while(choice != 0);
|
||||||
return db;
|
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