【生产实习】某超市进销存信息管理系统

舍友说我这是夹带私货,明明没有

在这里插入图片描述

一些废话

学校安排去东软生产实习,更像是换个地方写C++大作业,带我们的崔老师很好,确实是学到了不少东西。所经历的过程越痛苦,走出来时获得越多,真的应了尼采的“凡是不能置我于死地的必将使我受益”。
就粘一些我写过的代码吧,队友写的我就不粘了,软工有很多文档,最后都是队友好心帮忙写的,也就不粘了

题目

某超市进销存管理系统

  • 项目功能需求:
    系统分为两个权限部分:管理员用户登录模块,普通用户登录模块。管理员用户登录模块包括:供应商管理,员工管理,商品管理,采购管理。普通用户登陆模块包括:个人信息,商品信息,采购信息。本项目实现以下功能:
    (管理员、采购、普通员工)

  • 管理员用户登录模块:
    A、供应商管理

    1. 批量录入供应商数据,手动输入供应商编号,供应商名称,供应商简称,地址,公司电话,邮件,联系人,联系人电话,备注(是否合作)。
    2. 查询并列出表中所有的供应商信息。
    3. 修改指定供应商的信息。
    4. 删除指定供应商数据。

    B、商品管理

    1. 批量录入商品数据,手动输入商品编号,商品名称,商品单价,供应商编号,商品简介,备注等。
    2. 查询并列出所有商品信息。
    3. 修改制定商品的商品信息。
    4. 删除指定商品数据。

    C、员工管理

    1. 批量录入员工数据,手动输入员工编号,员工姓名,员工密码,员工级别,员工电话,员工工资,备注(是否离职)等。
    2. 查询并列出所有员工信息。
    3. 修改指定员工信息。
    4. 删除指定员工数据。

    D、采购管理

    1. 录入采购主表数据,手动输入采购清单号,员工编号(外码),采购数量,采购总价,采购时间,备注。
    2. 录入采购明细数据,手动输入采购明细号,采购清单号(外码),商品编号(外码),采购数量,商品单价,商品总价,备注。
    3. 查询并列出所有采购主表和采购明细信息。
    4. 修改指定采购主表信息和采购明细信息。
    5. 删除指定采购主表信息和采购明细信息。
  • 普通用户登录模块。

    1. 查询自己的员工信息。
    2. 查询所有商品信息。
    3. 查询所有的采购信息。

主要注意一下通过外码实现动态查询。老师是建议用友元函数,但是我们最后时间来不及了,趁着测试样例不会很多,时间空间都没有管,实现得像作弊一样

代码

头文件就放一个供应商吧,其他的都差不多

#pragma once
#define len 11
#include <vector>
#include <string>
#define len 11
using namespace std;
class Sup {
public:
	int sup_id;                                                       //主键 id 
	char sup_name[len];
	char sup_abbr[len];//缩写
	char sup_addr[len];//地址
	char sup_tele[len];
	char sup_mail[len];
	char contact_name[len];
	char contact_tele[len];
	char sup_remark[len];
};
class Sups {                                                          
private:
	vector <Sup> sups;
public:                                                           
	friend class Admin;
	void AddSupMore();//批量输入                                   
	friend istream& operator>>(istream& in, Sups& s);
	void DeleteSup(int sup_id);//删除指定供应商数据                  
	void ResearchSup(int sup_id);//查询	                              
	void ReviseSupInfo(); //修改指定供应商的信息         
	void PrintSupInfo();//列出表中所有的供应商信息               
	void Save();
};

菜单部分

#include<iostream>
#include<string>
#include<windows.h>
#include<vector>
#include"buy.h"
#include"sup.h"
#include"goods.h"
#include"staff.h"
#define DANGER 3
using namespace std;

void MainMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts);
void AdminMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts);
void PurchaseMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts);

void SupMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice3,id;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	//Sups supss = {};
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to do about Sup?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.AddMore" << endl;
		cout << "\t2.AddOne" << endl;
		cout << "\t3.Research" << endl;
		cout << "\t4.Modify" << endl;
		cout << "\t5.Delete" << endl;
		cout << "\t6.Print" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice3;
		switch (choice3) {
		case 1:
			supss.AddSupMore();//批量输入
			supss.Save();
			break;
		case 2:
			cin >> supss;//手动输入 
			supss.Save();
			break;
		case 3:
			cout << "Enter your id:";
			cin >> id;
			supss.ResearchSup(id);//查询	
			break;
		case 4:
			supss.ReviseSupInfo(); //修改指定供应商的信息
			supss.Save();
			break;
		case 5:cout << "Enter your id:";
			cin >> id;
			supss.DeleteSup(id);//删除指定供应商数据
			cout<<"delete"<<endl;
			supss.Save();
			break;
		case 6:supss.PrintSupInfo();//输出所有
			break;
		case -1:
			exit(0);
			break;
		case -2:
			AdminMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		}
	}
	
}

void GoodsMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice4,id,supid;
	char button;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	//Goodss goodss = {};
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to do about Goods?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.AddMore" << endl;
		cout << "\t2.AddOne" << endl;
		cout << "\t3.Research" << endl;
		cout << "\t4.Modify" << endl;
		cout << "\t5.Delete" << endl;
		cout << "\t6.Print" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice4;
		switch (choice4) {
		case 1:goodss.AddGoodsMore();//批量输入
			goodss.Save();
			break;
		case 2:cin >> goodss;//手动输入 
			goodss.Save();
			break;
		case 3:cout << "Enter your id:";
			cin >> id;
			supid = goodss.ResearchGoods(id);//查询	
			goodss.Save();
			cout << "Maybe you want to know more about the supplyer of the goods."<<endl;
			cout << "Y or N ?"<<endl;
			cin >> button;
			if(button=='Y'||button=='y') supss.ResearchSup(supid);
			break;
		case 4:goodss.ReviseGoodsInfo(); //修改指定供应商的信息
			goodss.Save();
			break;
		case 5:cout << "Enter your id:";
			cin >> id;
			goodss.DeleteGoods(id);//删除指定供应商数据
			goodss.Save();
			break;
		case 6:goodss.PrintGoodsInfo();//输出所有
			goodss.Save();
			break;
		case -1:exit(0);
			break;
		case -2:AdminMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		}
	}

}

void OStaffMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice5,id;
	//Staffs staffs = {};
	//BuyHosts b={};
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to do about Staff?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.AddMore" << endl;
		cout << "\t2.AddOne" << endl;
		cout << "\t3.Research" << endl;
		cout << "\t4.Modify" << endl;
		cout << "\t5.Delete" << endl;
		cout << "\t6.Print" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice5;
		switch (choice5) {
		case 1:staffs.AddStaffMore();//批量输入
			staffs.Save();
			break;
		case 2:cin >> staffs;//手动输入
			staffs.Save(); 
			break;
		case 3:cout << "Enter your id:";
			cin >> id;
			staffs.ResearchStaff(id);//查询	
			staffs.Save();
			break;
		case 4:staffs.ReviseStaffInfo(); //修改指定供应商的信息
			staffs.Save();
			break;
		case 5:cout << "Enter your id:";
			cin >> id;
			staffs.DeleteStaff(id);//删除指定供应商数据
			staffs.Save();
			break;
		case 6:staffs.PrintStaffInfo();//输出所有
			staffs.Save();
			break;
		case -1:exit(0);
			break;
		case -2:AdminMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		}
	}
	
}

void BuyHostMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice7, id, staffid;
	char button;
	//BuyHosts buyhosts = {};
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to do about Buyhost?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.AddMore" << endl;
		cout << "\t2.AddOne" << endl;
		cout << "\t3.Research" << endl;
		cout << "\t4.Modify" << endl;
		cout << "\t5.Delete" << endl;
		cout << "\t6.Print" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice7;
		switch (choice7) {
		case 1:buyhosts.AddBuyHostMore();//批量输入
			buyhosts.Save();
			break;
		case 2:cin >> buyhosts;//手动输入 
			buyhosts.Save();
			break;
		case 3:cout << "Enter your id:";
			cin >> id;
			staffid = buyhosts.ResearchBuyHost(id);//查询
			buyhosts.Save();
			cout << "Maybe you want to know more about the buyer."<<endl;
			cout << "Y or N ?"<<endl;
			cin >> button;
			if(button=='Y'||button=='y') staffs.ResearchStaff(staffid);
			break;	
		case 4:buyhosts.ReviseBuyHostInfo(); //修改指定供应商的信息
			buyhosts.Save();
			break;
		case 5:cout << "Enter your id:";
			cin >> id;
			buyhosts.DeleteBuyHost(id);//删除指定供应商数据
			buyhosts.Save();
			break;
		case 6:buyhosts.PrintBuyHostInfo();//输出所有
			buyhosts.Save();
			break;
		case -1:exit(0);
			break;
		case -2:PurchaseMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		}
	}
	
}

void BuyPartMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice8, id;
	int *both;
	char button1, button2;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	//BuyParts buyparts = {};
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to do about Buypart?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.AddMore" << endl;
		cout << "\t2.AddOne" << endl;
		cout << "\t3.Research" << endl;
		cout << "\t4.Modify" << endl;
		cout << "\t5.Delete" << endl;
		cout << "\t6.Print" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice8;
		switch (choice8) {
		case 1:buyparts.AddBuyPartMore();//批量输入
			buyparts.Save();
			break;
		case 2:cin >> buyparts;//手动输入 
			buyparts.Save();
			break;
		case 3:cout << "Enter your id:";
			cin >> id;
			both = buyparts.ResearchBuyPart(id);//查询
			buyparts.Save();	
			cout << "Maybe you want to know more about the buyhost."<<endl;
			cout << "Y or N ?"<<endl;
			cin >> button1;
			if(button1=='Y'||button1=='y') buyhosts.ResearchBuyHost(both[0]);
			cout << "Maybe you want to know more about the goods."<<endl;
			cout << "Y or N ?"<<endl;
			cin >> button2;
			if(button2=='Y'||button2=='y') goodss.ResearchGoods(both[1]);
			break;
		case 4:buyparts.ReviseBuyPartInfo(); //修改指定供应商的信息
			buyparts.Save();
			break;
		case 5:cout << "Enter your id:";
			cin >> id;
			buyparts.DeleteBuyPart(id);//删除指定供应商数据
			buyparts.Save();
			break;
		case 6:buyparts.PrintBuyPartInfo();//输出所有
			buyparts.Save();
			break;
		case -1:exit(0);
			break;
		case -2:PurchaseMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		}
	}
	
}

void PurchaseMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice6;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to do about Purchasing?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.Operator on Buyhost" << endl;
		cout << "\t2.Operator on Buypart" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice6;
		switch (choice6) {
		case 1:BuyHostMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		case 2:BuyPartMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		case -1:exit(0);
			break;
		case -2:AdminMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		}
	}

}


void AdminMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int code=123456;
	int codein=0;
	int count = 0;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	while(1){
			cout<<endl;
		cout<<"admincode:";
		cin>>codein;
		if(codein==code){
			int choice1;
			while (1) {
				system("cls");
				SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
				cout << "What do you want to know?" << endl;
				cout << endl;
				SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
				cout << "\t1.Sup" << endl;
				cout << "\t2.Goods" << endl;
				cout << "\t3.Staff" << endl;
				cout << "\t4.Purchasing" << endl;
				cout << "\t-1.Exit" << endl;
				cout << "\t-2.Back" << endl;
				cout << "Your choice: " << endl;
				cin >> choice1;
				switch (choice1) {
				case 1:SupMenu(supss,goodss,staffs,buyhosts,buyparts);
					break;
				case 2:GoodsMenu(supss,goodss,staffs,buyhosts,buyparts);
					break;
				case 3:OStaffMenu(supss,goodss,staffs,buyhosts,buyparts);
					break;
				case 4:PurchaseMenu(supss,goodss,staffs,buyhosts,buyparts);
					break;
				case -1:exit(0);
					break;
				case -2:MainMenu(supss,goodss,staffs,buyhosts,buyparts);
					break;
				}
			}
		}
		else{
			count++;
			cout<<"WARNING::code wrong!!!"<<endl;
			Sleep(3);
			if(count != DANGER) continue;
			else{
				cout<<endl;
				SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED);
				cout << "ACCESSED MORE THAN SAFE TIMES"<<endl;
				SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
				Sleep(5);
				exit(0);
			}
		}
	}


void StaffMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	
	int choice2;
	int id;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	
	while (1) {
		system("cls");
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		cout << "What do you want to know?" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.Query your own information" << endl;
		cout << "\t2.Query all goods information" << endl;
		cout << "\t3.Query all Buyhost information" << endl;
		cout << "\t4.Query all Buypart information" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "\t-2.Back" << endl;
		cout << "Your choice: " << endl;
		cin >> choice2;
		switch (choice2) {
		case 1:cout << "Enter your id:";
			cin >> id;
			staffs.ResearchStaff(id);//查询
			break;
		case 2:cout << "Enter goods id:";
			cin >> id;
			goodss.ResearchGoods(id);//查询
			break;
		case 3:cout << "Enter Buyhost id:";
			cin >> id;
			buyhosts.ResearchBuyHost(id);//查询
			break;
		case 4:cout << "Enter buypart id:";
			cin >> id;
			buyparts.ResearchBuyPart(id);//查询
			break;
		case -1:exit(0);
			break;
		case -2:MainMenu(supss,goodss,staffs,buyhosts,buyparts);
		}
	}
	
}

void MainMenu(Sups supss,Goodss goodss,Staffs staffs,BuyHosts buyhosts,BuyParts buyparts) {
	int choice;
	HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);
	//HDC dskDC=GetWindowDC(desk);
	while (1) {
		system("cls");
		cout <<endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_BLUE);
		//fontRect.lfHeight=-50; 
		cout << "login mode:" << endl;
		cout << endl;
		SetConsoleTextAttribute(hout,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
		cout << "\t1.Admin" << endl;
		cout << "\t2.Staff" << endl;
		cout << "\t-1.Exit" << endl;
		cout << "Your choice:  " << endl;
		cin >> choice;
		switch (choice) {
		case 1:
			AdminMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		case 2:StaffMenu(supss,goodss,staffs,buyhosts,buyparts);
			break;
		case -1:exit(0);
		}
	}
}

int main() {
	Sups supss = {};
	Goodss goodss = {};
	Staffs staffs = {};
	BuyHosts buyhosts = {};
	BuyParts buyparts = {};
	MainMenu(supss,goodss,staffs,buyhosts,buyparts);
}

输入,这块也以供应商举例:

#include<iostream>
#include<string>
#include<vector>
#include"buy.h"
#include"sup.h"
#include"goods.h"
#include"staff.h"
#include<fstream>
using namespace std;
istream& operator>>(istream& in, Sups& x)
{
	Sup c;
	cout << "Supplyer ID:" << endl;
	in >> c.sup_id;
	cout << "Supplyer Name:" << endl;
	in >> c.sup_name;
	cout << "Supplyer Abbr:" << endl;
	in >> c.sup_abbr;
	cout << "Supplyer Address" << endl;
	in >> c.sup_addr;
	cout << "Supplyer Telephone Number:" << endl;
	in >> c.sup_tele;
	cout << "Supplyer Email:" << endl;
	in >> c.sup_mail;
	cout << "Contact Name:" << endl;
	in >> c.contact_name;
	cout << "Contact Telephone Number:" << endl;
	in >> c.contact_tele;
	cout << "Supplyer Remark:" << endl;
	in >> c.sup_remark;
	x.sups.push_back(c);
	return in;
}
void Sups::AddSupMore()//批量输入  
{
	Sup s;
	cout<<"have entered"<<endl;
	ifstream inFile("sup.lsp", ios::in | ios::binary);
	if (!inFile)	cout << "file open error" << endl;
	else cout<<"loading..."<<endl;
	int length = 0;
	while (inFile.read((char*)&s, sizeof(s)))	{
		length++;
		sups.push_back(s);
	}
	cout<<"have added "<<length<<" sup(s)."<<endl;
	cout<<endl<<"Then you want to ?"<<endl;
	cout<<"\t-1.Back"<<endl;
	cout<<"\t-2.Exit"<<endl;
	int choice;
	cin>>choice;
	switch(choice){
		case -1: break;
		case -2: exit(0);
	}
}

保存,以供应商为例:


#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include"sup.h"
#include"staff.h"
#include"goods.h"
#include"buy.h"
#include <string>
using namespace std;

bool supcomp(const Sup &a, const Sup &b){
	return a.sup_id < b.sup_id;
}
void Sups::Save(){
	Sup s;
	//int length=sups.size();
	//cout<<length<<endl;
	vector<Sup>::iterator it;
	sort(sups.begin(),sups.end(),supcomp);
	ofstream outFile("sup.lsp",ios::out | ios::binary);
	for(it = sups.begin();it != sups.end();it++){
		s = *it;
		outFile.write((char*)&s,sizeof(s));
	}
	outFile.close();	
}

删除,也是举个例子:


void Sups::DeleteSup(int id){
	vector<Sup>::iterator it;
	int flag = 0;
	
	cout << "Sure to delete ?"<<endl;
	cout << "y or n?"<<endl;
	char button;
	cin >> button;
	if(button == 'Y'|| button == 'y') ;
	else return;
	
	for(it = sups.begin();it != sups.end();it++){
		if(it->sup_id == id){
			sups.erase(it);
			flag = 1;
			break;
		}
	} 
	if(flag == 0) cout<<"Not Found"<<endl;
	else cout<<"delete have done!"<<endl;
	cout<<endl<<"Then you want to ?"<<endl;
	cout<<"\t1.Continue"<<endl;
	cout<<"\t-1.Back"<<endl;
	cout<<"\t-2.Exit"<<endl;
	int choice;
	int hid;
	cin>>choice;
	switch(choice){
		case 1:
			cout << "Enter your id:";	
			cin >> hid;
			DeleteSup(hid);
		case -1: cout<<"111111"<<endl;break;
		case -2: exit(0);
	}	
}

其他的其实也差不多,完整代码可以私戳我

商品:商品编号、商品名称、商品单价、生产日期、保质期、商品重量、商品规格 供应商:应商名称、供应商地址、供应商帐号、供应商传真、供应商电话、交货日期、订单号 进销存:库存号、现有库存、最高库存、最低库存、盈亏数量、联系人 (1)针对商店进销存管理系统,分别对采购部门、销售部门和库存保管部门进行详细的调研和分析,总结出如下的需求信息:商品按类管理,所以需要有一商品类型信息。如果一个商品类型存在商品,或存在下级商品类型,则该类型不可删除。需要记录供应商品信息。在涉及商品数量的地方,需要知道商品的库存地方。商品销售信息单中要包含登记商品销售数量、单价等信息。在进货信息中要包含商品供应商等信息。商品报损要有报损原因。进货、销售、报损操作要有相应信息管理员。只有管理员登录之后才可以使用系统。默认的管理员不可以删除。进货、销售、库存、报损信息都要可以添加、修改、删除、分类查找。当进行进货、销售和报损操作后,能相应更新库存。 (2)经上述系统功能分析和需求总结,考虑到将来功能的扩展,设计如下的数据项和数据结构:商品类型信息,包括数据项有:商品信息,包括的数据项有:商品编号、商品名称、商品的的生产日期、库存量等。商供应商信息,包括供应商号、供应商名称、联系电话等。进货信息,包括进货商品号、数量、规格、单价等。销售信息,包括销售商品、数量、单价等。报损信息,包括报损商品、数量、原因、登记时间等。员工信息,包括员工号、姓名、职称等
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值