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

📄 dlglogin.cpp

📁 1.解压后在sql2000中建立数据库flight,然后用本文件中的flight文件进行还原 2.数据库连接是用ADO实现的,如果更改连接,打开后对两个程序的ADOConn.cpp进行修改就行(t
💻 CPP
字号:
// DlgLogin.cpp : implementation file
//

#include "stdafx.h"
#include "AirLine.h"
#include "DlgLogin.h"
#include "ADOConn.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgLogin dialog


CDlgLogin::CDlgLogin(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgLogin::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgLogin)
	m_name = _T("");
	m_pwd = _T("");
	//}}AFX_DATA_INIT
}


void CDlgLogin::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgLogin)
	DDX_Text(pDX, IDC_EdtName, m_name);
	DDX_Text(pDX, IDC_EdtPwd, m_pwd);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgLogin, CDialog)
	//{{AFX_MSG_MAP(CDlgLogin)
	ON_BN_CLICKED(IDOK, OnLogin)
	ON_BN_CLICKED(IDCANCEL, OnQuit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgLogin message handlers

void CDlgLogin::OnLogin() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	ADOConn adoConn;
	_RecordsetPtr m_pRs;
	_bstr_t vsql;
	adoConn.OnInitADOConn();
	if(m_name!="" && m_pwd!="")
		vsql="select * from agency where 名称='"+m_name+"' and 密码='"+m_pwd+"'";
	else
	{
		MessageBox("请输入完整信息!");
		return;
	}
	try{
		m_pRs=adoConn.GetRecordSet(vsql);
		if(m_pRs->adoEOF)
		{
			MessageBox("旅行社信息错误!");
			return;
		}
	}catch(_com_error e){
		AfxMessageBox(e.Description());
	}
	adoConn.ExitConnect();
	CDialog::OnOK();
}

void CDlgLogin::OnQuit() 
{
	// TODO: Add your control notification handler code here
	exit(0);
}

⌨️ 快捷键说明

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