物流信息管理系统c语言源程序.docx

上传人:b****6 文档编号:6117040 上传时间:2023-01-03 格式:DOCX 页数:19 大小:17.78KB
下载 相关 举报
物流信息管理系统c语言源程序.docx_第1页
第1页 / 共19页
物流信息管理系统c语言源程序.docx_第2页
第2页 / 共19页
物流信息管理系统c语言源程序.docx_第3页
第3页 / 共19页
物流信息管理系统c语言源程序.docx_第4页
第4页 / 共19页
物流信息管理系统c语言源程序.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

物流信息管理系统c语言源程序.docx

《物流信息管理系统c语言源程序.docx》由会员分享,可在线阅读,更多相关《物流信息管理系统c语言源程序.docx(19页珍藏版)》请在冰豆网上搜索。

物流信息管理系统c语言源程序.docx

物流信息管理系统c语言源程序

物流信息管理系统C语言源程序

#include

#include

#include

#include

 

structstuff//员工数据结构体

{

charname[10];

charpassword[10];

charquanxian[2];

};

structgoods//货品数据结构体

{

charnumber[20];

charname[20];

intquantity;

charcost[20];

charvolume[20];

charweight[20];

};

typedefstructa

{

structstuffs;

structa*next;

}stuffnode;

typedefstructb

{

structgoodsg;

structb*next;

}goodsnode;

 

stuffnode*stuffhead=NULL;//全局结构体链表指针变量头指针

stuffnode*stuffp1=NULL;

goodsnode*goodshead=NULL;

goodsnode*goodsp1=NULL;

 

voidinitial_stuff()

{

FILE*fp;

stuffnode*p;

if((fp=fopen("stuff.txt","r"))==NULL)

{

printf("无任何员工信息,请新建!

\n\n");

}

else

{

fseek(fp,0,SEEK_END);

intn,i;

n=ftell(fp)/sizeof(structstuff);

rewind(fp);

for(i=0;i

{

p=(stuffnode*)malloc(sizeof(stuffnode));

fread(&p->s,sizeof(p->s),1,fp);//从文件FP中读取数据到P中

p->next=NULL;

if(stuffhead==NULL)

{

stuffhead=stuffp1=p;

}

else

{

stuffp1->next=p;

stuffp1=stuffp1->next;

}

}

fclose(fp);

}

}

 

voidinitial_goods()

{

FILE*fp;

goodsnode*p;

if((fp=fopen("goods.txt","r"))==NULL)

{

printf("无任何货品信息,请新建!

\n\n");

}

else

{

fseek(fp,0,SEEK_END);

intn,i;

n=ftell(fp)/sizeof(structgoods);

rewind(fp);

for(i=0;i

{

p=(goodsnode*)malloc(sizeof(goodsnode));

fread(&p->g,sizeof(p->g),1,fp);

p->next=NULL;

if(goodshead==NULL)

{

goodshead=goodsp1=p;

}

else

{

goodsp1->next=p;

goodsp1=goodsp1->next;

}

}

fclose(fp);

}

}

voidaddstuff()//增加员工

{

stuffnode*p;

p=(stuffnode*)malloc(sizeof(stuffnode));

printf("\n\n\n\n☆☆增加员工资料☆☆\n");

printf("\n请输入员工姓名\n\n");

scanf("%s",p->s.name);

printf("\n请输入员工密码\n\n");

scanf("%s",p->s.password);

printf("\n请输入员工权限(Y/N)\n\n");

scanf("%s",p->s.quanxian);

p->next=NULL;

if(stuffhead)

{

stuffp1->next=p;

stuffp1=stuffp1->next;

}

else

stuffhead=stuffp1=p;

printf("\n增加员工数据成功\n\n");

}

voiddeletestuff()//删除员工资料

{

stuffnode*p,*p1;

p=p1=stuffhead;

charflag[20];

printf("\n请输入要删除员工的名称。

\n");

scanf("%s",flag);

while(strcmp(p->s.name,flag)!

=0)

{

p1=p;

p=p->next;

};

printf("该员工数据即将删除:

\n");

printf("名称,密码,权限\n");

printf("%s%s%s\n",p->s.name,p->s.password,p->s.quanxian);

p1->next=p->next;

printf("\n删除完毕\n");

}

voidshowstuff()//员工资料显示

{

stuffnode*p=stuffhead;

if(p==NULL)

{

printf("员工信息为空!

\n\n");

}

else

{

printf("员工资料:

\n");

printf("名称密码权限\n");

while(p)

{

printf("%s%s%s\n",p->s.name,p->s.password,p->s.quanxian);

p=p->next;

}

}

}

voidaddgoods()//货品入库

{

goodsnode*p;

p=(goodsnode*)malloc(sizeof(goods));

printf("\n\n\n\n☆☆货品入库☆☆\n");

printf("\n\n请输入货品编号\n\n");

scanf("%s",p->g.number);

printf("\n请输入货品名称\n\n");

scanf("%s",p->g.name);

printf("\n请输入件数\n\n");

scanf("%d",&p->g.quantity);

printf("\n请输入保价费\n\n");

scanf("%s",p->g.cost);

printf("\n请输入货品体积\n\n");

scanf("%s",p->g.volume);

printf("\n请输入货品重量\n\n");

scanf("%s",p->g.weight);

p->next=NULL;

if(goodshead)

{

goodsp1->next=p;

goodsp1=goodsp1->next;

}

else

goodshead=goodsp1=p;

printf("\n货品成功入库\n\n");

}

voidoutputgoods()//货品出库

{

goodsnode*p,*p1;

p=p1=goodshead;

charflag[20];

printf("\n请输入出货货品的编号。

\n");

scanf("%s",flag);

while(strcmp(p->g.number,flag)!

=0)

{

p1=p;

p=p->next;

};

printf("\n出货货品为:

");

printf("\n|-------------------------------------------------------------|\n");

printf("|编号|品名|数量|保价(元)|体积(M3)|重量(KG)|");

printf("\n|-------------------------------------------------------------|\n");

printf("%s%s%d%s%s%s\n",

p->g.number,p->g.name,p->g.quantity,p->g.cost,p->g.volume,p->g.weight);

p1->next=p->next;

printf("成功出货!

\n");

}

voidquerygoods()//货品查询

{

goodsnode*p,*p1;

p=p1=goodshead;

charflag[20];

printf("\n请输入查询货品的编号。

\n");

scanf("%s",flag);

while(strcmp(p->g.number,flag)!

=0)

{

p1=p;

p=p->next;

};

printf("查询的货品信息为:

");

printf("\n|-------------------------------------------------------------|\n");

printf("|编号|品名|数量|保价(元)|体积(M3)|重量(KG)|");

printf("\n|-------------------------------------------------------------|\n");

printf("%s%s%d%s%s%s\n",

p->g.number,p->g.name,p->g.quantity,p->g.cost,p->g.volume,p->g.weight);

}

voidcheckgoods()//货品盘点,显示仓库所有货品

{

goodsnode*p=goodshead;

if(p==NULL)

printf("货品信息为空!

\n\n");

else

{

printf("仓库货品为:

");

printf("\n|-------------------------------------------------------------|\n");

printf("|编号|品名|数量|保价(元)|体积(M3)|重量(KG)|");

printf("\n|-------------------------------------------------------------|\n");

}

while(p)

{

printf("%s%s%d%s%s%s\n",

p->g.number,p->g.name,p->g.quantity,p->g.cost,p->g.volume,p->g.weight);

p=p->next;

}

 

}

voidsetquanxian()//员工权限设置

{

stuffnode*p,*p1;

p=p1=stuffhead;

charflag[20];

printf("\n请输入要设置权限的员工的名称。

\n");

scanf("%s",flag);

while(strcmp(p->s.name,flag)!

=0)

{

p1=p;

p=p->next;

};

printf("该员工权限即将变更:

\n");

printf("%s,%s,%s\n",p->s.name,p->s.password,p->s.quanxian);

p1->next=p->next;

printf("\n更改完毕\n");

}

voidmamgxinxi()//信息管理

{

}

voidsavestuff()

{

FILE*fp;

fp=fopen("stuff.txt","w");

stuffnode*p=stuffhead;

while(p)

{

fwrite(&p->s,sizeof(p->s),1,fp);

p=p->next;

}

fclose(fp);

}

voidsavegoods()

{

FILE*fp;

fp=fopen("goods.txt","w");

goodsnode*p=goodshead;

while(p)

{

fwrite(&p->g,sizeof(p->g),1,fp);

p=p->next;

}

fclose(fp);

}

 

voidshow()

{

printf("\n");

printf("\n■■■■■■■■■■■■■■■■■■■■■■■■■■■");

printf("\n■☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆■");

printf("\n■☆■■■■■■■■■■■■■■■■■■■■■■■☆■");

printf("\n■☆■欢迎使用■☆■");

printf("\n■☆■------------------------------------------■☆■");

printf("\n■☆■安捷达物流信息管理系统■☆■");

printf("\n■☆■------------------------------------------■☆■");

printf("\n■☆■.AJDexpress.■☆■");

printf("\n■☆■■■■■■■■■■■■■■■■■■■■■■■☆■");

printf("\n■☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆■");

printf("\n■■■■■■■■■■■■■■■■■■■■■■■■■■■");

printf("\n");

printf("\n");

}

voidshow1()

{

printf("\n|----------------------------------------|");

printf("\n|█主菜单█|");

printf("\n|----------------------------------------|");

printf("\n|A基础信息管理|");

printf("\n|----------------------------------------|");

printf("\n|B配送管理|");

printf("\n|----------------------------------------|");

printf("\n|C仓储管理|");

printf("\n|----------------------------------------|");

printf("\n|D系统管理|");

printf("\n|----------------------------------------|");

printf("\n|E退出程序|");

printf("\n|----------------------------------------|");

printf("\n|请您选择一个任务|");

printf("\n|----------------------------------------|\n\n\n");

}

 

voidshow2()

{

printf("\n|-----------------------------|");

printf("\n|☆基础信息管理菜单☆|");

printf("\n|-----------------------------|");

printf("\n|A增加员工|");

printf("\n|-----------------------------|");

printf("\n|B删除员工|");

printf("\n|-----------------------------|");

printf("\n|C显示员工|");

printf("\n|-----------------------------|");

printf("\n|D退出程序|");

printf("\n|-----------------------------|");

printf("\n|请您选择一个任务|");

printf("\n|-----------------------------|\n\n\n");

}

 

voidshow3()

{

printf("\n|-----------------------------|");

printf("\n|☆配送管理菜单☆|");

printf("\n|-----------------------------|");

printf("\n|A配送申请|");

printf("\n|-----------------------------|");

printf("\n|B配送查询|");

printf("\n|-----------------------------|");

printf("\n|C在途管理|");

printf("\n|-----------------------------|");

printf("\n|D退出程序|");

printf("\n|-----------------------------|");

printf("\n|请您选择一个任务|");

printf("\n|-----------------------------|\n\n\n");

}

voidshow4()

{

printf("\n|-----------------------------|");

printf("\n|☆仓储管理菜单☆|");

printf("\n|-----------------------------|");

printf("\n|A货品入库|");

printf("\n|-----------------------------|");

printf("\n|B货品出库|");

printf("\n|-----------------------------|");

printf("\n|C货品查询|");

printf("\n|-----------------------------|");

printf("\n|D货品盘点|");

printf("\n|-----------------------------|");

printf("\n|E退出程序|");

printf("\n|-----------------------------|");

printf("\n|请您选择一个任务|");

printf("\n|-----------------------------|\n\n\n");

}

voidshow5()

{

printf("\n|-----------------------------|");

printf("\n|☆系统管理菜单☆|");

printf("\n|-----------------------------|");

printf("\n|A权限设置|");

printf("\n|-----------------------------|");

printf("\n|B信息维护|");

printf("\n|-----------------------------|");

printf("\n|C退出程序|");

printf("\n|-----------------------------|");

printf("\n|请您选择一个任务|");

printf("\n|-----------------------------|\n\n\n");

}

voidmain()

{

show();

initial_stuff();

initial_goods();

charname1[10];

charpassword1[15];

printf("请输入用户名:

\n");

scanf("%s",name1);

printf("请输入用户密码:

\n");

scanf("%s",password1);

stuffnode*p2;

intquanxianflag=0;

p2=stuffhead;

while(p2->next!

=NULL)

{

if((strcmp(p2->s.name,name1)==0&&strcmp(p2->s.password,password1)==0)&&

((strcmp(p2->s.quanxian,"y")==0||strcmp(p2->s.quanxian,"Y")==0)))

{

quanxianflag=1;

break;

}

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 图表模板

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1