📄 exaccount.cpp
字号:
// Exaccount.cpp: implementation of the Exaccount class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "atm.h"
#include "Exaccount.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Exaccount *Exaccount::pFirstE=NULL; //链表为空
Exaccount::Exaccount(CString accNo, CString paswrd)
:Account(accNo,paswrd,false,false)
{
if(pFirstE==NULL)
pFirstE=this; //空链表中建立一新帐户
else
{
Exaccount *ps=pFirstE;
for (;ps->pNextE;ps=ps->pNextE);
ps->pNextE=this; //在最后插入本节点
}
pNextE=NULL;
}
/*CurrentAcnt * CurrentAcnt::searchAccount(CString paswd)
{
CurrentAcnt *pc=pFirstC;
if(pc==NULL)
{
return NULL;
}
for (;pc;pc=pc->pNextC)
{
if ((pc->checkPassword(paswd)))
{
return pc;
}
}
return NULL;
}*/
Exaccount *Exaccount::searchtranAccount(CString accountno)
{
Exaccount *pc=pFirstE;
if(pc==NULL)
{
return NULL;
}
for (;pc;pc=pc->pNextE)
{
if ((pc->GetacntNo()==accountno))
{
return pc;
}
}
return NULL;
}
double Exaccount::AcntBalan()
{
return balance;
}
void Exaccount::loadFile(ostream & out)
{
Account::loadFile(out);
}
bool Exaccount::storageE()
{
ofstream out("外行帐户.txt");
if(pFirstE==NULL)
return 1;
Exaccount *pc=pFirstE;
for (;pc;pc=pc->pNextE)
{
out << *pc ;
}
out.close();
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -