c++编写仓库管理系统_第1页
c++编写仓库管理系统_第2页
c++编写仓库管理系统_第3页
c++编写仓库管理系统_第4页
c++编写仓库管理系统_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、C+编写仓库管理系统 /functions.h #include #include #include #include #include #include using namespace std; void denglu(); void choice(); void zhuce(); char first_face(); void in_storage(); void select_time(); void out_storage(); void select_ele(); void select_name(); void select_kind(); void select_all(); v

2、oid call(); void denglu() string username1,passport1,name1; string username,passport; ifstream storeFile(userdate.txt); if(!storeFile) coutnnt 对不起,用户文件丢失。 。 nnt; system(pause); return; cout 用户登录: endl; coutusername; coutpassport; bool flag=false; while(storeFileusername1passport1name1) if(username1=

3、username system(cls); cout 登录成功! endl; cout欢迎您,name1A_Aendl; system(pause); else if(username1=username|passport1=passport) cout 用户名或密码错误! endl; denglu(); storeFile.close(); call(); choice(); void choice() char a; a=first_face(); while(1) switch(a) case 1:in_storage();break; case 2:out_storage();brea

4、k; case 3:select_ele();break; case 4:system(cls);coutt 谢谢您的使用 !nntt; exit(0); break; default:break; char first_face() system(cls);/ 系统清屏 cout= =endl; cout* *endl; cout* 仓库 管理系统 *endl; cout* *endl; cout* 1. 商品入库 *endl; cout* *endl; cout* 2. 商品出库 *endl; cout* *endl; cout* 3. 商品查询 *endl; cout* *endl; c

5、out* 4. 退出系统 *endl; *endl; =endl; cout* cout= return getch(); / 入库 void in_storage() system(cls);/ 系统清屏 string name;/ 商品名 double price;/ 价格 string storeNo;/ 仓库编号 string kinds;/ 商品大类 string shelfNo;/ 货架号 long count=0;/ 商品数量 string time;/ 入库时间 coutn; cout商品入库,请输入相关信息: coutendlname; coutendlprice; cout

6、endlcount; coutendlstoreNo; coutendlkinds; coutendlshelfNo; coutendltime; 商品名称: ; 商品价格: ; 商品数量: ; 仓库编号: ; 商品大类: ; 货架编号: ; 入库时间(例如: 2014.01.01 ): ofstream storeFile(store.txt, ios:app); storeFilesetiosflags(ios:left)setw(20)name setw(15)price setw(10)count setw(10) storeNo setw(20)kinds shelfNosetw(2

7、0)timeendl; storeFile.close(); coutnnt 该商品已经入库nnt; cout是否继续?1是 2否a; if(a=1)in_storage(); if(a=2) first_face(); choice(); system(pause);/ 系统暂停 / 出库 void out_storage() system(cls);/ 系统清屏 string name;/ 商品名 coutendlt 商品出库,输入出库商品信息: endl; coutname; ifstream storeFile(store.txt); if(!storeFile) ofstream s

8、toreFile1(store.txt); storeFile1.close(); coutnnt 库存为空nnt; cout是否继续? 1是 2否a; if(a=1)in_storage(); else if(a=2) first_face(); choice(); bool flag=false; string name1;/ 商品名 double price1;/ 价格 string storeNo1;/ 仓库编号 string kinds1;/ 商品大类 string shelfNo1;/ 货架号 long count1=0;/ 商品数量 ofstream tempFile(temp.

9、txt); while(storeFilename1price1count1storeNo1kinds1shelfNo1) if(name1=name) flag=true; else tempFilesetiosflags(ios:left)setw(20)name1 setw(15)price1 setw(10)count1 setw(10)storeNo1 setw(20)kinds1 shelfNo1endl; tempFile.close(); storeFile.close(); if(!flag) coutnnt 仓库中没有该商品! nnt; system(pause); ret

10、urn; ofstream storeFile1(store.txt); ifstream tempFile1(temp.txt); storeFile1tempFile1.rdbuf(); storeFile1.close(); tempFile1.close(); coutnt 这些商品已经出库,请仔细检查! cout是否继续? 1是2否a; if(a=1)out_storage(); if(a=2) first_face(); choice(); system(pause); / 查询 void select_ele() while (1) system(cls); coutnendl;

11、 coutt= tendl t 商 品 查 询 endl tendl t1.按商品名称查询endl tendl t2.按入库时间查询endl tendl t3.查看所有商品endl tendl !nnt; endl t4.按商品大类查询endl tendl t5. 返回 endl tendl t=endl; coutntt; char select=getch(); switch(select) case 1:select_name();break; case 2:select_time();break; case 3:select_all();break; case 4:select_kin

12、d();break; case 5:first_face();choice();break; default:break; / 按商品名称查询 void select_name() system(cls); coutendlt 按商品名查询: endl; coutname; string name1;/ 商品名 string time1; double price1;/ 价格 string storeNo1;/ 仓库编号 string kinds1;/ 商品大类 string shelfNo1;/ 货架号 long count1=0;/ 商品数量 ifstream storeFile(stor

13、e.txt); if(!storeFile) coutnnt对不起,你的库存为空nnt; system(pause); return; bool flag=false; coutn 商品名 价格 商品数量 仓库编号 商品大类 货架号 入库时间 name1price1count1storeNo1kinds1shelfNo1time1) if(name1=name) flag=true; coutsetiosflags(ios:left) name1 price1 count1 storeNo1 kinds1 shelfNo1 time1endl; storeFile.close(); if(!f

14、lag) coutnn对不起,库存中没有这个商品”; coutnendl; system(pause); void select_time()/ 按入库时间查询 system(cls); coutnt 按入库时间查询: endl ; couttime; string name1;/ 商品名 double price1;/ 价格 string storeNo1;/ 仓库编号 string kinds1;/ 商品大类 string shelfNo1;/ 货架号 string time1; long count1=0;/ 商品数量 ifstream storeFile(store.txt); if(

15、!storeFile) coutnnt对不起,你的库存为空nnt; system(pause); return; bool flag=false; coutn 商品名 setw(15)价格setw(10)商品数量 setw(10)仓库编 号 setw(10)商品大类 setw(15)货架号 nname1price1count1storeNo1kinds1shelfNo1time1) if (time1=time) flag=true; coutsetiosflags(ios:left)setw(15)name1 setw(10)price1 setw(10)count1 setw(10)sto

16、reNo1 setw(15)kinds1 shelfNo1endl; storeFile.close(); if(!flag) coutnn 对不起,仓库中没有这类商品! ; coutnendl; system(pause); void select_all()/ 查看所有商品 system(cls); string name1;/ 商品名 string time1;/ 入库时间 double price1;/ 价格 string storeNo1;/ 仓库编号 string kinds1;/ 商品大类 string shelfNo1;/ 货架号 long count1=0;/ 商品数量 if

17、stream storeFile(store.txt); if(!storeFile) coutnnt对不起,你的库存为空nnt; system(pause); return; bool flag=false; coutn 商品名 价格 商品数量 仓库编号 商品大类 货架号 入库时间 name1price1count1storeNo1kinds1shelfNo1time1) flag=true; coutsetiosflags(ios:left) name1 price1 count1 storeNo1 kinds1 shelfNo1 time1endl; storeFile.close();

18、 system(pause); / 按大类查询 void select_kind() system(cls); coutnt 按商品大类查询: endl ; coutkinds; string name1;/ 商品名 double price1;/ 价格 string storeNo1;/ 仓库编号 string kinds1;/ 商品大类 string shelfNo1;/ 货架号 string time1;/ 入库时间 long count1=0;/ 商品数量 ifstream storeFile(store.txt); if(!storeFile) coutnnt对不起,你的库存为空nn

19、t; system(pause); return; bool flag=false; coutn 商品名 价格 商品数量 仓库编号 商品大类 货架号 入库时间 name1price1count1storeNo1kinds1shelfNo1time1) if (kinds1=kinds) flag=true; coutsetiosflags(ios:left)setw(15)name1 setw(10)price1 setw(10)count1 setw(10)storeNo1 setw(15)kinds1 shelfNo1 setw(15)time1endl; storeFile.close(

20、); if(!flag) coutnn对不起,库存中没有这类商品; coutnendl; system(pause); void zhuce() system(cls);/ 系统清屏 string username,passport,passport1,name,miyao,jiami; coutusername; coutpassport; coutpassport1; if(passport=passport1) coutname; else if(passport!=passport1) cout 两次输入的密码不一致,请重新输入!endl; while(passport!=passpo

21、rt1) coutpassport; coutpassport1; coutname; ofstream storeFile(userdate.txt, ios:app); storeFilesetiosflags(ios:left)setw(15)username setw(15)passport setw(10)nameendl; storeFile.close(); system(cls); cout 账户创建成功!欢迎您, nameendl; system(pause); system(cls); first_face(); choice(); void call()/ 提醒功能 system(cls); ifstream storeFile(sto

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论