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

📄 dengludlg.cpp

📁 银行信息查询系统 直接将“银行账户信息查询系统.rar”解压之后
💻 CPP
字号:
// dengluDlg.cpp : implementation file
//

#include "stdafx.h"
#include "银行账户信息查询系统.h"
#include "dengluDlg.h"
#include "dengluRs.h"
#include "xinxiRs.h"
#include "xinxiDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CdengluDlg dialog

CdengluDlg::CdengluDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CdengluDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CdengluDlg)
	m_password = _T("");
	m_username = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CdengluDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CdengluDlg)
	DDX_Text(pDX, IDC_EDIT_password, m_password);
	DDX_Text(pDX, IDC_EDIT_username, m_username);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CdengluDlg, CDialog)
	//{{AFX_MSG_MAP(CdengluDlg)
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CdengluDlg message handlers

BOOL CdengluDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CdengluDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CdengluDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CdengluDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	CdengluRs m_dengluRs;
	try
	{
		if(m_dengluRs.IsOpen())
			m_dengluRs.Close();
		m_dengluRs.m_strFilter.Format("账户='%s'and 密码='%s'",m_username,m_password);
		m_dengluRs.Open(CRecordset::snapshot,NULL,CRecordset::none);
		if(m_dengluRs.IsEOF())
		{
			m_dengluRs.Close();
			AfxMessageBox("账户或密码错误,请重试!");
			return;
		}
		else 
		{
			m_dengluRs.Close();
			AfxMessageBox("密码正确,登录成功!");
		}
	}
	catch(CDBException*e)
	{
		e->ReportError();
		return;
	}

	UpdateData(TRUE);
	CxinxiRs m_xinxiRs;
	try
	{
		if(m_xinxiRs.IsOpen())
			m_xinxiRs.Close();

		m_xinxiRs.m_strFilter.Format("帐号= '%s'",m_username);
		m_xinxiRs.Open(CRecordset::snapshot,NULL,CRecordset::none);
		if(m_xinxiRs.IsEOF())
		{
			m_xinxiRs.Close();
			AfxMessageBox("登录失败");
			return;
		}
		else
		{			
			CxinxiDlg xinxiDlg;
			xinxiDlg.m_bizhong=m_xinxiRs.m_bizhong;
			xinxiDlg.m_cunqi=m_xinxiRs.m_cunqi;
			xinxiDlg.m_leixing=m_xinxiRs.m_leixing;
			xinxiDlg.m_lilv=m_xinxiRs.m_lilv;
			xinxiDlg.m_qixiri=m_xinxiRs.m_qixiri;
			xinxiDlg.m_yue=m_xinxiRs.m_yue;
			xinxiDlg.m_zhanghao=m_xinxiRs.m_zhanghao;
			xinxiDlg.m_zhuangtai=m_xinxiRs.m_zhuangtai;
			xinxiDlg.m_daoqiri=m_xinxiRs.m_daoqiri;
			m_xinxiRs.Close();
			xinxiDlg.DoModal();
		}
	}
	catch(CDBException* e)
	{
		e->ReportError();
		return;
	} 
	CDialog::OnOK();
}

void CdengluDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

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