⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 C语言做的超市进销存源代码文件
💻 CPP
字号:
#include"employee.h"
#include"super_marker.h"
#include"customer.h"
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void inline clear()
{
	system("PAUSE");
	system("cls");
	cout<<"                     ***********************"<<endl;
	cout<<"                     *                     *"<<endl;
	cout<<"                     *     ——  超市      *"<<endl;
	cout<<"                     *                     *"<<endl;
	cout<<"                     *    "<<__DATE__<<"      *"<<endl;
	cout<<"                     *     "<<__TIME__<<"        *"<<endl;
	cout<<"                     ***********************"<<endl;	
}
void  inline get_choice(int& choice)
{
	while(1)
	{
		cin>>choice;
		if(cin.fail())
		{
			cin.clear(ios::goodbit);
			fflush(stdin);
			cout<<"选择出错啦!重试!"<<endl;
			
		}
		else break;
	}
}
int main()
{
	int account;
	int choice;
	Employee e;Customer c;Market m;
	clear();
A:	account=e.landing();
	while(1)
	{

		if(account==0)
		{
			cout<<" \n\n              *******进入管理操作********"<<endl;
			cout<<(char)3<<"1--查看员工资料"<<endl;
			cout<<(char)5<<"2--修改密码"<<endl;
			cout<<(char)3<<"3--注册雇员"<<endl;
			cout<<(char)6<<"4--查看货物"<<endl;
			cout<<(char)1<<"5--修改货物价格"<<endl;
			cout<<(char)36<<"6--进货"<<endl;
			cout<<(char)4<<"7--注销"<<endl;
			get_choice(choice);
			switch(choice)
			{
			case 1:e.view_record();break;
			case 2:e.change_password();break;
			case 3:e.new_employee();break;
			case 4:m.view_good();break;
			case 5:m.set_price();break;
			case 6:m.stock();break;
			case 7:
				account=99;
				clear();
				cout<<"注销成功……"<<endl;          
				cout<<"         1--重新登陆"<<endl;
				cout<<"         2--退出"<<endl;
				cin>>choice;
				switch(choice)
				{
				case 1:goto A;break;
				case 2:goto B;break;
				default:cout<<"“输入错误,请重试!!”"<<endl;
				}
				break;
			default:cout<<"“输入错误,请重试!!”"<<endl;
			}
		}
		else
		{
		cout<<endl<<(char)1<<"1--(修改密码)"<<endl			
			<<(char)4<<"2--(注销帐号)"<<endl
			<<(char)5<<"3--(超市进货)"<<endl
			<<(char)6<<"4--(查看货物)"<<endl
			<<(char)36<<"5--(顾客交易)"<<endl;
		
			get_choice(choice);
			switch(choice)
			{
			case 1:e.change_password();break;
			case 2:
				account=99;
				system("cls");

				cout<<"注销成功……"<<endl;
				clear();
				cout<<"1--重新登陆"<<endl;
				cout<<"2--退出"<<endl;
				cin>>choice;
				switch(choice)
				{
				case 1:goto A;break;
				case 2:goto B;break;
				default:cout<<"“输入错误,请重试!!”"<<endl;
				}
				break;
			case 3:				
				m.stock();
				clear();
				break;
			case 4:m.view_good();break;		
			case 5:
				clear();
				c.buy(m);
				c.check(m,account);
				break;
			default:cout<<"“输入错误,请重试!!”"<<endl;
			}
		}
	}
B:		system("cls");
		cout<<"                     ***********************"<<endl;
		cout<<"                     *                     *"<<endl;
		cout<<"                     *      LEE 超市       *"<<endl;
		cout<<"                     *        打烊         *"<<endl;
		cout<<"                     *    "<<__DATE__<<"      *"<<endl;
		cout<<"                     *     "<<__TIME__<<"        *"<<endl;
		cout<<"                     ***********************"<<endl;	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -