设为首页 加入收藏

TOP

C++实现公司设备管理系统(六)
2023-07-23 13:25:21 】 浏览:138
Tags:司设备 管理系
out<<H5; flag = false; } if (flag) { cout <<endl <<"系统中没有管理员信息!!!!!" <<endl <<endl; } else { cout <<endl <<"所有管理员信息已经全部显示出来!!!!!" <<endl <<endl; } system("pause"); } //修改信息 void machine::alter() { ofstream outData("e:\\temp.txt", ios::out); ifstream inData("e:\\pbook.txt", ios::in); if (!inData) { cout <<endl <<"对不起!!!!找不到文件!!!!" <<endl; system("pause"); return; } string sign; cout <<endl <<"你要修改设备的编号 :"; cin >>sign; bool flag = true; string str; while (inData>>num) { getline(inData, str); if (sign==num) { cout <<endl <<"你想修改的设备信息:" <<endl <<endl; cout<<H<<H1<<H2; cout<<setw(10)<<num<<str<<endl; cout<<H2; cout <<endl <<"请根据下面提示修改信息 : " <<endl; cout<<"编号 : " ; cin >>num; cout <<"类别 : "; cin >>category; cout <<"名称 : "; cin >>name; cout <<"价格 : "; cin >>price; cout <<"库存数量 : "; cin >>quantity; save_new(); flag = false; break; } outData<<setiosflags(ios::left)<<num<<setw(10)<<str<<endl; } if (flag) { cout <<endl <<"对不起!!!没有找到这个设备!!!!" <<endl <<endl; } else { while(getline(inData, str)) { outData <<str <<endl; } outData.close(); inData.close(); ofstream out("e:\\pbook.txt", ios::out); ifstream in("e:\\temp.txt", ios::in); if (!out||!in) { cout <<endl <<"对不起不能打开文件!!!" <<endl <<endl; system("pause"); return; } while (getline(in, str)) { out <<str <<endl; } out.close(); in.close(); cout <<endl <<"这个设备的信息已经修改!!!" <<endl <<endl; } system("pause"); } void vip::alter() { ofstream outData("e:\\temp1.txt", ios::out); ifstream inData("e:\\Document.txt", ios::in); if (!inData) { cout <<endl <<"对不起!!!!找不到文件!!!!" <<endl; system("pause"); return; } string sign; cout <<endl <<"你要修改管理员的帐号 :"; cin >>sign; bool flag = true; string str; while (inData>>id) { getline(inData, str); if (sign==id) { cout <<endl <<"你想修改的管理员信息:" <<endl <<endl; cout<<H3<<H4<<H5; cout<<setw(10)<<id<<str<<endl; cout<<H5; cout <<endl <<"请根据下面提示修改信息 : " <<endl; cout<<"帐号 : " ; cin >>id; cout <<"密码 : "; cin >>password; save_new(); flag = false; break; } outData<<setiosflags(ios::left)<<id<<setw(10)<<str<<endl; } if (flag) { cout <<endl <<"对不起!!!没有找到这个管理员信息!!!!" <<endl <<endl; } else { while(getline(inData, str)) { outData <<str <<endl; } outData.close(); inData.close(); ofstream out("e:\\Document.txt", ios::out); i
首页 上一页 3 4 5 6 7 下一页 尾页 6/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C++子类的构造函数 下一篇C++数值计算——矩阵类的实现(一..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目