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

📄 accountmanage.h.bak

📁 命令行模式下的简单宾馆管理系统..各种基本功能齐全..属于新人练习作品..hotel manager..
💻 BAK
字号:
/*
 * File: accountmanage.h
 * ----------------
 * This file declares the class AccountManage,
 * to manage the accounts.
 */

#ifndef ACCOUNTMANAGE_H
#define ACCOUNTMANAGE_H

#include "account.h"


/* 
 * Struct: AllAccountList
 * --------------------------
 * This Struct list contains all 
 * the accounts in the hotel.
 */
struct AllAccountList
{
	Account *curAccount;
	struct AllAccountList *next;
};


/*
 * Class: AccountManage
 * -------------------------
 * This class contains a list of all
 * accounts and operation functions.
 */
class AccountManage
{
public:
	AccountManage();		// constructor.
	//void SetNumOfAccount( int );
	int GetNumOfAccounts();
	void AddAccount( Account * );		// add an account to the allAccountList.
	bool DeleteAccount( Account * );	// delete an account to the allAccountList.
	
	// Find an account by his ID or name or creditCardNum or phoneNum..
	Account *GetAccount( int = -1, string  = "", string  = "", int = 0 );	//add
	struct AllAccountList *GetAllAccountList();
	void PrintAccountList( int );		// print all the account info briefly in the allAccountList.
	void PrintAccountInfo( Account * );	// print the account info in detail.
	void WriteToFile( ofstream *fout );///		// write the accounts info in the allAccountList to the data file.
	void ReadFromFile( ifstream *fin );///		// read the accounts info from the data file.
	void CleanAllAccount();		// free all accounts' info in memory,and empty the allAccountList.
	~AccountManage(); 		// destructor.
private:
	int numOfAccounts;
	struct AllAccountList *allAccountList;
};


/*
 * Function: NewAccount()
 * Usage: *Account=*NewAccount(ID);
 * ---------------------------
 * This function allow the user to create a new account
 * by entering all the account info,
 * and the account's ID will be set in default,
 * and returns the pointer of the new account.
 */
Account *NewAccount( int );

#endif

⌨️ 快捷键说明

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