system.cpp

来自「这是一个银行系统的管理软件」· C++ 代码 · 共 65 行

CPP
65
字号
/**********************************************************************************
*                                                                                 *
*  Henry Banking System ATM Module                                                *
*  Copyright (c) 2004 by Henry. All rights reserved.                              *
*                                                                                 *
*  Permission to use, copy, modify, and distribute this software for any purpose  *
*  is hereby granted without fee, provided that this copyright and permissions    *
*  notice appear in all copies and derivatives, and that no charge may be made    *
*  for the software and its documentation except to cover cost of distribution.   *
*                                                                                 *
*  This software is provided "as is" without express or implied warranty.         *
*                                                                                 *
**********************************************************************************/

/*
*  Description:
*
*    Generate menu in a CUI way.
*
*  Notes:
*
*    This code has been written to conform to standard C++ and STL. It has been
*    compiled successfully using Visual C++ 7.0.
*/


#include <string>
#include <vector>
#include "banking.h"
#include "common.h"

namespace banking
{
	System::System()
	{
		DataSet temp("database/System.txt");
		record = temp;
	}

	size_t System::getCurrentCardNo()
	{
		return(string2long(record.dataRow[0]));
	}

	size_t System::generateNewCardNo()
	{
		size_t cardNo = getCurrentCardNo() + 1;
		record.dataRow[0] = long2string(cardNo);
		record.update();
		return cardNo;
	}

	size_t System::getCurrentDealingId()
	{
		return(string2long(record.dataRow[1]));
	}

	size_t System::generateNewDealingId()
	{
		size_t dealingId = getCurrentDealingId() + 1;
		record.dataRow[1] = long2string(dealingId);
		record.update();
		return dealingId;
	}
}

⌨️ 快捷键说明

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