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

📄 deposit.cpp

📁 MFC写的银行储蓄系统
💻 CPP
字号:
// DEPOSIT.cpp : implementation file
//

#include "stdafx.h"
#include "银行储蓄系统.h"
#include "DEPOSIT.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDEPOSIT dialog


CDEPOSIT::CDEPOSIT(CWnd* pParent /*=NULL*/)
	: CDialog(CDEPOSIT::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDEPOSIT)
	m_accnumber = 0;
	m_balance = 0.0;
	m_depositmoney = 0.0;
	//}}AFX_DATA_INIT
}


void CDEPOSIT::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDEPOSIT)
	DDX_Text(pDX, IDC_EDIT1, m_accnumber);
	DDX_Text(pDX, IDC_EDIT2, m_balance);
	DDX_Text(pDX, IDC_EDIT3, m_depositmoney);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDEPOSIT, CDialog)
	//{{AFX_MSG_MAP(CDEPOSIT)
	ON_BN_CLICKED(IDC_DCOMPLETE_BUTTON, OnDcompleteButton)
	ON_BN_CLICKED(IDC_DEPOSIT_BUTTON, OnDepositButton)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDEPOSIT message handlers

void CDEPOSIT::OnDcompleteButton() 
{
	// TODO: Add your control notification handler code here

	OnOK();
}

BOOL CDEPOSIT::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	if(dtag==1)
	{
       m_accnumber=aS->AccountNo();
	   m_balance=aS->GetBalance();
	}
	else if(dtag==2)
	{
		 m_accnumber=aC->AccountNo();
	     m_balance=aC->GetBalance();
	}
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDEPOSIT::OnDepositButton() 
{
	// TODO: Add your control notification handler code here
    UpdateData(TRUE);
	if(m_depositmoney==0||m_depositmoney<0)
			MessageBox("存款金额错误,请确认");
	else
	{
     if(dtag==1)
	 {
		aS->Deposit(m_depositmoney);
		m_balance=aS->GetBalance();
		UpdateData(FALSE);
	 }
	 else if(dtag==2)
	 {
		aC->Deposit(m_depositmoney);
		m_balance=aC->GetBalance();
		UpdateData(FALSE);
	 }
	}
}

⌨️ 快捷键说明

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