程设小组作业——计算机配件的进货/销售管理系统

start.h 整合及部分界面函数,使程序更加简洁

void inquire_name(plink head);
//////////////////////////////////////////////////
/*
开始函数:整合所有功能性函数,使得主函数看起来更加整洁
*/
void start(){
int option,roll,type;
system("color F0");
outputcsv_all();
//cmd_limit();
sale_stastics_start(head);
select:
printf(" _________________________________________ \n");
printf(" |Computer accessories purchase/sales management system|\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the system you want to enter: |\n");
printf(" | 1:Purchase record information |\n");
printf(" | 2:Wholesale sales information |\n");
printf(" | 3:Retail sales information |\n");
printf(" | 4:Exit system |\n");
printf(" |_________________________________________|\n");
select_opt:
printf(" Your option:");
scanf_s("%d", &option);
type_link=option;
if(option==4)//退出系统
{
animate_exit();
}
switch(option){
case 1:
animate();
read(option);
pri_menu://进货系统目录位置
printf(" _________________________________________ \n");
printf(" | Purchase record information |\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the action you want to take: |\n");
printf(" | 1:Inquire imformation |\n");
printf(" | 2:Modify information |\n");
printf(" | 3:Gift statistics |\n");
printf(" | 4:Return to main menu |\n");
printf(" | 5:Exit system |\n");
printf(" |_________________________________________|\n");
pri_menu_opt://进货系统目录选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
inqsys_pri://进货系统查询系统位置
printf(" _________________________________________ \n");
printf(" | Inquire system-Purchase record information |\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:By name |\n");
printf(" | 2:All |\n");
printf(" | 3:By time interval |\n");
printf(" | 4:Record had been deleted |\n");
printf(" | 5:Return to the previous menu |\n");
printf(" | 6:Return to menu |\n");
printf(" | 7:Exit system |\n");
printf(" |_________________________________________|\n");
inqsys_pri_opt://进货系统查询系统方式选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
inquire_name(head);
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_pri;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_pri_backopt;
}
case 2:
animate();
print_information(1,head);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
inqsys_pri_backopt:// 进货系统查询系统返回目录选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_pri;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_pri_backopt;
}
case 3:
animate();
system("cls");
time_print();
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_pri;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_pri_backopt;
}
case 4:
animate();
print_information_deleted(1,head);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_pri;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_pri_backopt;
}
case 5:
animate();
system("cls");
goto pri_menu;
case 6:
animate();
system("cls");
goto select;
case 7:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_pri_opt;
}
break;
case 2:
modify(1);//修改信息函数
break;
case 3:
animate();
read_gift();
print_information_gift(headg);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_pri;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_pri_backopt;
}
//销售记录函数(赠品)
break;
case 4:
animate();
system("cls");
goto select;
case 5:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto pri_menu_opt;
}
system("cls");
goto pri_menu;
case 2:
animate();
read(option);
wsi_menu://零售系统目录位置
printf(" _________________________________________ \n");
printf(" | Wholesale sales information |\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the action you want to take: |\n");
printf(" | 1:Inquire imformation |\n");
printf(" | 2:Modify information |\n");
printf(" | 3:Gift statistics |\n");
printf(" | 4:Return to main menu |\n");
printf(" | 5:Exit system |\n");
printf(" |_________________________________________|\n");
wsi_menu_opt://零售目录选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
inqsys_wsi:// 零售查询系统位置
printf(" _________________________________________ \n");
printf(" | Inquire system-Wholesale sales information |\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:By name |\n");
printf(" | 2:All |\n");
printf(" | 3:By time interval |\n");
printf(" | 4:Record had been deleted |\n");
printf(" | 5:Return to the previous menu |\n");
printf(" | 6:Return to menu |\n");
printf(" | 7:Exit system |\n");
printf(" |_________________________________________|\n");
inqsys_wsi_opt://零售查询系统选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
inquire_name(head);
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_wsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_wsi_backopt;
}
case 2:
animate();
print_information(2,head);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
inqsys_wsi_backopt://零售查询系统返回目录选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_wsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_wsi_backopt;
}
case 3:
animate();
system("cls");
time_print();
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_wsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_wsi_backopt;
}
case 4:
animate();
print_information_deleted(2,head);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_wsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_wsi_backopt;
}
case 5:
animate();
system("cls");
goto wsi_menu;
case 6:
animate();
system("cls");
goto select;
case 7:
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_wsi_opt;
}
break;
case 2:
modify(2);//修改信息函数
break;
case 3:
animate();
read_gift();
print_information_gift(headg);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_wsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_wsi_backopt;
}
//销售记录函数(赠品)
break;
case 4:
animate();
system("cls");
goto select;
case 5:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto wsi_menu_opt;
}
system("cls");
goto wsi_menu;
case 3:
animate();
read(option);
rsi_menu://批发系统目录位置
printf(" _________________________________________ \n");
printf(" | Retail sales information |\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the action you want to take: |\n");
printf(" | 1:Inquire imformation |\n");
printf(" | 2:Modify information |\n");
printf(" | 3:Gift statistics |\n");
printf(" | 4:Return to main menu |\n");
printf(" | 5:Exit system |\n");
printf(" |_________________________________________|\n");
rsi_menu_opt://批发系统目录选择界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
inqsys_rsi://批发系统查询系统位置
printf(" _________________________________________ \n");
printf(" | Inquire system-Retail sales information |\n");
printf(" |Current funds:%12.2f |\n",current_funds);
printf(" |_________________________________________|\n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:By name |\n");
printf(" | 2:All |\n");
printf(" | 3:By time interval |\n");
printf(" | 4:Record had been deleted |\n");
printf(" | 5:Return to the previous menu |\n");
printf(" | 6:Return to menu |\n");
printf(" | 7:Exit system |\n");
printf(" |_________________________________________|\n");
inqsys_rsi_opt://批发系统查询系统返回目录界面位置
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
inquire_name(head);
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_rsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_rsi_backopt;
}
case 2:
animate();
print_information(3,head);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
inqsys_rsi_backopt:
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_rsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_rsi_backopt;
}
case 3:
animate();
system("cls");
time_print();
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_rsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_rsi_backopt;
}
case 4:
animate();
print_information_deleted(3,head);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_rsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_rsi_backopt;
}
case 5:
animate();
system("cls");
goto rsi_menu;
case 6:
animate();
system("cls");
goto select;
case 7:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_rsi_opt;
}
break;
case 2:
modify(3);//修改信息函数
break;
case 3:
animate();
read_gift();
print_information_gift(headg);
printf("\n\n\n");
Sleep(1000);
printf(" _________________________________________ \n");
printf(" |Please select the method to be queried: |\n");
printf(" | 1:Return to the previous menu |\n");
printf(" | 2:Return to menu |\n");
printf(" | 3:Exit system |\n");
printf(" |_________________________________________|\n");
printf(" Your option:");
scanf("%d",&option);
switch(option){
case 1:
animate();
system("cls");
goto inqsys_rsi;
break;
case 2:
animate();
system("cls");
goto select;
break;
case 3:
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto inqsys_rsi_backopt;
}
//销售记录函数(赠品)
break;
case 4:
animate();
system("cls");
goto select;
case 5:
save(type_link);
animate_exit();
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto rsi_menu_opt;
}
system("cls");
goto rsi_menu;
default:
printf(" error:can't find option\n");
printf(" please check your option and input again\n");
goto select_opt;
}
goto select;
}

点赞

发表评论