您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 物流信息管理系统(C语言源程序)
物流信息管理系统C语言源程序#includestdio.h#includestring.h#includestdlib.h#includeconio.hstructstuff//员工数据结构体{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;in;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;in;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;}elsestuffhead=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;}elsegoodshead=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■☆■■☆■);printf(\n■☆■■■■■■■■■■■■■■■■■■■■■■■☆■);printf(\n■☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆■);printf(\n■■■■■■■■■■■■■■■■■■■■■■■■■■■);printf(\n);printf(\n);}voidshow1(){printf(\n|-----------------------
本文标题:物流信息管理系统(C语言源程序)
链接地址:https://www.777doc.com/doc-4570984 .html