武汉理工大学计算机基础与编程实验—网吧计费管理系统(含扩展超级管理员功能)

billing_file.h

#ifndef BILLING_FILE_H
#define BILLING_FILE_H //避免头文件被重复包含
#include"model.h"

int saveBilling(const Billing* pBilling,const char *pPath);
int addBilling(const char *pName,Billing *pBilling);
int readBilling(BillingNode *pBilling,const char *pPath);
int getBillingCount(const char *pPath);
int updateBilling(const Billing* pBilling, const char* pPath, int nIndex);
#endif

billing_service.h

#ifndef BILLING_SERVICE_H
#define BILLING_SERVICE_H
#include"model.h"
void initBillingList();
void releaseBillingList();
int getBilling();
BillingNode *GetBillList();
Billing* queryBilling(const char * pNmae,int* pIndex);
#endif

card_file.h

#ifndef CARD_SERVICE_H
#define CARD_SERVICE_H //避免头文件被重复包含
#include"model.h"
//文本读写操作
int saveCard(const Card* pCard, const char* pPath);
int readCard(Card* pCard, const char* pPath);
int updateCard(const Card* pCard, const char* pPath, int nIndex);
Card praseCard(char* pBuf);
int getCardCount(const char* pPath);
//二进制读写操作
int saveCard_binary(const Card* pCard, const char* pPath);
int readCard_binary(Card* pCard, const char* pPath);
int getCardCount_binary(const char* pPath);
int updateCard_binary(const Card* pCard, const char* pPath, int nIndex);
#endif

card_service.h

#ifndef CARD_SERVICE_H
#define CARD_SERVICE_H //避免头文件被重复包含
#include"model.h"
int Addcard(Card card);
int getCard();
void ReleaseCardList();
int InitCardList();
int queryCard(const char* pName,Card **pcard);
Card *QueryCards(const char* pName, int* pIndex);
Card* AllCards(int* length);
int  checkCard(const char* pName, const char* pPwd,int  *pInfo,Card **p);


int AllMoney(Money *m);
#endif

global.h

#ifndef GLOBAL_H
#define GLOBAL_H

#define FALSE 0
#define TRUE 1
#define UNUSE 2
#define ENOUGHMONEY 3


#define CARDPATH "data\\card.txt"
#define CARDPATHBINARY "data\\card.ams"
#define BILLINGPATH "data\\billing.ams"
#define MONEYPATH "data\\money.ams"
#define CHARGEPATH "data\\charge.txt"

#endif

menu.h

#ifndef MENU_H
#define MENU_H  //避免头文件被重复包含
void ExitSystem();
void addCard();
void outputMenu(); //函数声明
void mainMenu();
void manageMenu();
void logon();
void settle();
void addMoney();
void refundMoney();
void annul();
void collectInfo();


int delete_card();
void update_charge();
#endif

model.h

#ifndef MODEL_H
#define MODEL_H //避免头文件被重复包含

#include< time.h>
typedef struct Card
{
     
	char Number[18];  //账号
	char Password[8]; //密码
	int  Status;      //卡状态(0为未上机,1为正上机,2为卡已注销,3为卡已失效)
	time_t  Start;       //开卡时间
	time_t  End;         //卡的截止时间
	float   fTotalUse;     //累计金额
	time_t    LastTime;        //最后的时间
	int       UseCount;  //总计使用次数
	float     Balance;      //余额
	int       Delete;            //删除标识:0为未删除,1为已删除
}Card;
typedef struct CardNode
{
     
	Card data; //数据域
	struct CardNode* next;//指针域
}CardNode, * lpCardNode;
//消费信息结构体
typedef struct Billing {
     

	char aCardName[18];  //卡号
	time_t tStart;       //上机时间
	time_t tEnd;         //下机时间
	float fAmount;       //消费金额
	int nStatus;         //消费状态,0-未结算,1-已结算
	int nDel;            //删除标识,0-未删除,1-已删除
}Billing;
typedef struct LogonInfo {
     
	char aCardName[18];   //上机卡号
	time_t tLogon;        //上机时间
	float fBalance;       //上机时卡的余额;
}LogonInfo;
typedef struct BillingNode {
     
	Billing  data;
	struct BillingNode *next;
}BillingNode,*lpBillingNode;
typedef struct SettleInfo {
     
	char aCardName[18];
	time_t tStart;
	time_t tEnd;
	float fAmount;
	float fBalance;
}SettleInfo;
//充值退费结构体
typedef struct Money {
     
	char cardname[18];
	time_t tTime;
	int nStatus;//充值状态  0 充值  1退费
	float fMoney;
	int nDel;//删除标志  0未删除  1删除
}Money;
typedef struct MoneyInfo
{
     
	char cardname[18];
	float fMoney;
	float fBalance;
}MoneyInfo;
#endif

monry_file.h

#ifndef MONEY_FILE_H
#define MONEY_FILE_H
#include"model.h"
int saveMoney(const Money *pmoney, const char * path);
int getMoneyCount_binary(const char* pPath);

#endif

service.h

#ifndef SERVICE_H
#define SERVICE_H
#include"model.h"
int doLogon(const char *pName,const char *pPwd,LogonInfo *pInfo);
int addCardInfo(Card card);
int queryCardInfo(const char *pName,Card **pcard);
void releaseList();
int doSettle(const char *pName,const char *pPwd,SettleInfo *pInfo);
int doAddMoney(const char *pName, const char *pPwd, MoneyInfo *moneyinfo);
int doRefoundMoney(const char *pName, const char *pPwd, MoneyInfo *moneyinfo);
double getAmount(time_t tStart);
int annulCard(Card *p);
int moneyRecord();
int CardRecord();
int billRecord();
#endif


tool.h

#include
void timeToString(time_t t, char* pBuf);
time_t stringToTime(char *pTime);

文件链接放在这里了,3个小积分,直接白嫖100分
整个文件点这里下载

你可能感兴趣的:(c++,程序人生,恰饭,经验分享)