📄 shangpinmanage.h
字号:
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#include "hh.h" //定义表
#include "jiancebianhao.h" //检测编号
#include "dengji.h" //登记商品信息 1
#include "chaxunshuoyou.h" //查询所有商品信息 2
#include "charu.h" //插入商品信息 3
#include "shanchu.h" //删除商品信息 4
#include "chaxundingkucun.h" //查询给定库存的商品信息 5
#include "chaxundaxiaokucun.h" //查询大于或小于给定库存的商品信息 6
#include "chaxunduankucun.h" //查询给定数值段中库存最高的商品信息 7
#include "chaxundayudingjiage.h" //输出价格高于某个值的所有商品按价格排序输出 8
#include "chaxunxiaoyudingkucun.h" //输出库存小于某个值的所有商品信息并排序输出 9
#include "chaxunzhidingkucun.h" //任意指定对商品进行库存的排序 10
#include "chaxunzhidingjiage.h" //任意指定对商品进行价格排序 11
#include "savefile.h" // 保存所有商品信息 12
#include "openfile.h" // 打开所有商品信息 13
int ShangPinManage(char username[])
{
struct shangpin shangp[MAXLENTH];
int count=0;
int choice=-1;
while(1)
{
printf("\t\t 商品信息管理系统 当前用户-> %s",username);
printf("\n\t\t __________________________________________________");
/////////////////////////////////////////////////////// 商品信息管理
printf("\n\t\t ____________________________");
printf("\n\t\t 1 -> 登记商品信息");
printf("\n\t\t 2 -> 查询所有商品信息");
printf("\n\t\t 3 -> 插入一个商品信息");
printf("\n\t\t 4 -> 删除一个商品信息");
printf("\n\t\t ____________________________");
/////////////////////////////////////////////////////// 删除商品信息
printf("\n\t\t 5 -> 查询一个定库存的商品信息 ");
printf("\n\t\t 6 -> 查询大于或者小于给定库存的商品信息");
printf("\n\t\t 7 -> 查询给定库存段中库存最高的商品信息");
printf("\n\t\t ____________________________");
/////////////////////////////////////////////////////// 商品信息排序
printf("\n\t\t 8 -> 价格高于某值的所有商品信息按价格排序输出");
printf("\n\t\t 9 -> 库存不足某值的所有商品信息按库存排序输出");
printf("\n\t\t 10 -> 任意指定库存段对商品信息进行库存排序输出");
printf("\n\t\t 11 -> 任意指定价格段对商品信息进行价格排序输出");
printf("\n\t\t ____________________________");
/////////////////////////////////////////////////////// 商品信息永久保存
printf("\n\t\t 12 -> 保存所有商品信息");
printf("\n\t\t 13 -> 导入所有商品信息 ");
printf("\n\t\t 0 -> 退出管理");
printf("\n\t\t ____________________________");
printf("\n\t\t __________________________________________________");
printf("\n\t\t 请选择菜单号(0-10):");
scanf("%d",&choice);getchar();
////////////////////////
if(choice==1) ///// 1 -- 登记商品信息
{
count=0;
count=dengji(shangp,count);
system("cls");
}
else if(choice==2) ///// 2 -- 查询商品信息
{
chaxunshuoyou(shangp,count);
system("cls");
}
else if(choice==3) ///// 3 -- 插入商品信息
{
count=charu(shangp,count);
system("cls");
}
else if(choice==4) ///// 4 -- 删除商品信息
{
count=shanchu(shangp,count);
system("cls");
}
else if(choice==5) ///// 5 -- 查询给定库存的商品信息
{
chaxundingkucun(shangp,count);
system("cls");
}
else if(choice==6) ///// 6 -- 查询大于或小于给定库存的商品信息
{
chaxundaxiaokucun(shangp,count);
system("cls");
}
else if(choice==7) //// 7 -- 查询给定数值段中库存最高的商品信息
{
chaxunduankucun(shangp,count);
system("cls");
}
else if(choice==8) //// 8 -- 输出价格高于某个值的所有商品排序输出
{
chaxundayudingjiage(shangp,count);
system("cls");
}
else if(choice==9) //// 9 -- 输出库存不足某个值的所有商品信息并排序输出
{
chaxunxiaoyudingkucun(shangp,count);
system("cls");
}
else if(choice==10) //// 10 -- 任意指定对商品进行库存排序
{
chaxunzhidingkucun(shangp,count);
system("cls");
}
else if(choice==11) //// 11 -- 任意指定对商品进行价格排序
{
chaxunzhidingjiage(shangp,count);
system("cls");
}
else if(choice==12) //// 12 -- 保存所有商品信息
{
savefile(shangp,count);
system("cls");
}
else if(choice==13) //// 13 -- 任打开所有商品信息
{
count=0;
count=openfile(shangp,count);
system("cls");
}
else if(choice==0) //// 0 -- 退出系统
{
printf("\n\t\t 任意键退出...");
getchar();
exit(0);
}
else
{
printf("\n\t\t 您的选择有错,请重新选择!任意键继续...");
getchar();
system("cls");
}
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -