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

📄 cwithdrawal.cpp

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CCWITHDRAWAL dialog


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


void CCWITHDRAWAL::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCWITHDRAWAL)
	DDX_Control(pDX, IDC_COMBO1, m_model);
	DDX_Text(pDX, IDC_EDIT1, m_accnumber);
	DDX_Text(pDX, IDC_EDIT2, m_balance);
	DDX_Text(pDX, IDC_EDIT3, m_withdrawalmoney);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCWITHDRAWAL, CDialog)
	//{{AFX_MSG_MAP(CCWITHDRAWAL)
	ON_BN_CLICKED(IDC_CCOMPLETE_BUTTON, OnCcompleteButton)
	ON_BN_CLICKED(IDC_CWITHDRAWAL_BUTTON, OnCwithdrawalButton)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCWITHDRAWAL message handlers

BOOL CCWITHDRAWAL::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    m_accnumber=aCC->AccountNo();
	m_balance=aCC->GetBalance();
	m_model.AddString("电  汇(%7)");
	m_model.AddString("信  汇(%5)");
	m_model.AddString("其  它(%2)");
	m_model.SelectString(-1,"电  汇");
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCWITHDRAWAL::OnCcompleteButton() 
{
	// TODO: Add your control notification handler code here
	OnOK();
}

void CCWITHDRAWAL::OnCwithdrawalButton() 
{
	// TODO: Add your control notification handler code here
	int iModel;
	iModel=m_model.GetCurSel();
	UpdateData(TRUE);
	if(m_withdrawalmoney==0||m_withdrawalmoney<0)
		MessageBox("取款金额错误,请确认");
    else
	{
     if(iModel==0)
	 {
		aCC->SetRemit(remitCable);
	    aCC->Withdrawal(m_withdrawalmoney);
	    m_balance=aCC->GetBalance();
	 }
	 else if(iModel==1)
	 {
		aCC->SetRemit(remitother);
	    aCC->Withdrawal(m_withdrawalmoney);
	    m_balance=aCC->GetBalance();
	 }
	 else if(iModel==2)
	 {
	    aCC->SetRemit(remitPost);
	    aCC->Withdrawal(m_withdrawalmoney);
	    m_balance=aCC->GetBalance();
	 }
	}
	if(aCC->getError()==1) 
	{
		MessageBox("无足够余额");
		aCC->getError()=0;
	}
	UpdateData(FALSE);
}

⌨️ 快捷键说明

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