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

📄 operationdlg.cpp

📁 用interbus作为中间件的工具模拟银行自动取款机ATM.
💻 CPP
字号:
// OperationDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ATM.h"
#include "OperationDlg.h"
#include "RequeryDlg.h"
#include "ATMDlg.h"
#include "WithdrawDlg.h"
#include "DepositDlg.h"
#include "AlterPAWDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// COperationDlg dialog


COperationDlg::COperationDlg(CWnd* pParent /*=NULL*/)
	: CDialog(COperationDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(COperationDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_pDlg = (CATMDlg*) pParent;
}


void COperationDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COperationDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(COperationDlg, CDialog)
	//{{AFX_MSG_MAP(COperationDlg)
	ON_BN_CLICKED(IDC_QUIT, OnQuit)
	ON_BN_CLICKED(IDC_REQUERY, OnRequery)
	ON_BN_CLICKED(IDC_DEPOSIT, OnDeposit)
	ON_BN_CLICKED(IDC_WITHDRAW, OnWithdraw)
	ON_BN_CLICKED(IDC_ALTER_PAW, OnAlterPassword)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COperationDlg message handlers

void COperationDlg::OnQuit() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnOK();
	
}

void COperationDlg::OnRequery() 
{
	// TODO: Add your control notification handler code here
	CRequeryDlg dlg;
	dlg.m_dMoney = m_pDlg->requery();
	ShowWindow(SW_HIDE);
	dlg.DoModal();
	ShowWindow(SW_SHOW);
}

void COperationDlg::OnDeposit() 
{
	// TODO: Add your control notification handler code here
	CDepositDlg dlg;
	ShowWindow(SW_HIDE);
	if(dlg.DoModal() == IDOK)
	{
		ShowWindow(SW_SHOW);
		if(m_pDlg->deposit(dlg.m_nMoney))
		{
			//存钱成功
			AfxMessageBox("已经存入你的帐户!");
		}
		else 
		{
			AfxMessageBox("抱歉,存钱不成功!");
		}
	}
	else ShowWindow(SW_SHOW);
	
}

void COperationDlg::OnWithdraw() 
{
	// TODO: Add your control notification handler code here
	CWithdrawDlg dlg;
	ShowWindow(SW_HIDE);
	if(dlg.DoModal() == IDOK)
	{
		ShowWindow(SW_SHOW);
		if(m_pDlg->withdraw(dlg.m_nMoney))
		{
			//取钱成功
			AfxMessageBox("请您取走您的现金!");
		}
		else 
		{
			AfxMessageBox("抱歉,您的余额不足!");
		}
	}
	else ShowWindow(SW_SHOW);
}

void COperationDlg::OnAlterPassword() 
{
	// TODO: Add your control notification handler code here
	CAlterPAWDlg dlg;
	ShowWindow(SW_HIDE);
	if(dlg.DoModal() == IDOK)
	{
		ShowWindow(SW_SHOW);
		if(m_pDlg->alterPAW(dlg.m_strPAW1))
		{
			//取钱成功
			AfxMessageBox("修改密码成功!");
		}
		else 
		{
			AfxMessageBox("修改密码不成功!");
		}
	}
	else ShowWindow(SW_SHOW);
	
}

⌨️ 快捷键说明

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