📄 denglu.cpp
字号:
// Denglu.cpp : implementation file
//
#include "stdafx.h"
#include "物业管理系统.h"
#include "Denglu.h"
#include"Password.h"
#include"Zhuce.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDenglu dialog
CDenglu::CDenglu(CWnd* pParent /*=NULL*/)
: CDialog(CDenglu::IDD, pParent)
{
//{{AFX_DATA_INIT(CDenglu)
m_nname = _T("");
m_npass = _T("");
//}}AFX_DATA_INIT
}
void CDenglu::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDenglu)
DDX_Control(pDX, IDC_EDIT4, m_pass);
DDX_Control(pDX, IDC_EDIT3, m_name);
DDX_Text(pDX, IDC_EDIT3, m_nname);
DDX_Text(pDX, IDC_EDIT4, m_npass);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDenglu, CDialog)
//{{AFX_MSG_MAP(CDenglu)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDenglu message handlers
void CDenglu::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if(m_nname.IsEmpty())
{
MessageBox("用户名不能为空!");
m_nname="";
m_npass="";
UpdateData(FALSE);
m_name.SetFocus();
return;
}
if(m_npass.IsEmpty())
{
MessageBox("密码不能为空!");
m_pass.SetFocus();
return ;
}
CString strSQL;
CPassword recordset;
strSQL.Format("select * from password WHERE name='%s'",m_nname);
if(!recordset.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL))
{
MessageBox("打开数据失败!");
return ;
}
if(recordset.m_name=="")
{
MessageBox("用户名不存在!");
m_nname="";
m_npass="";
UpdateData(FALSE);
m_name.SetFocus();
return;
}
if(recordset.m_pass!=m_npass)
{
MessageBox("密码错误!");
m_npass="";
m_pass.SetFocus();
return ;
}
CDialog::OnOK();
}
void CDenglu::OnButton3()
{
// TODO: Add your control notification handler code here
CZhuce d;
d.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -