📄 land.cpp
字号:
// land.cpp : implementation file
//
#include "stdafx.h"
#include "test.h"
#include "land.h"
#include "testSet.h"
#include "Splash.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// land dialog
land::land(CWnd* pParent /*=NULL*/)
: CDialog(land::IDD, pParent)
{
//{{AFX_DATA_INIT(land)
m_nPassword = _T("");
m_nName = _T("");
//}}AFX_DATA_INIT
}
void land::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(land)
DDX_Control(pDX, IDC_TITLE, m_nTitle);
DDX_Control(pDX, IDC_PASSWORD, m_Password);
DDX_Control(pDX, IDC_NAME, m_Name);
DDX_Text(pDX, IDC_PASSWORD, m_nPassword);
DDV_MaxChars(pDX, m_nPassword, 10);
DDX_Text(pDX, IDC_NAME, m_nName);
DDV_MaxChars(pDX, m_nName, 10);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(land, CDialog)
//{{AFX_MSG_MAP(land)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// land message handlers
void land::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CTestSet mSet;
if(mSet.IsOpen())
mSet.Close();
if(m_nName.IsEmpty())
{
MessageBox("用户名不能为空!","提示",MB_OK);
return;
}
if(m_nPassword.IsEmpty())
{
MessageBox("密码不能为空!","提示",MB_OK);
return;
}
mSet.m_strFilter.Format("managername='%s'",m_nName);
mSet.Open(); //打开记录集
if(mSet.IsEOF())
{
MessageBox("您所输入的用户不存在!","警告",MB_OK|MB_ICONWARNING);
m_Name.SetFocus();
return;
}
if(m_nPassword!=mSet.m_managerpassword)
{
MessageBox("密码错误!","提示",MB_OK);
m_Password.SetFocus();
return;
}
CDialog::OnOK();
}
int land::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CSplashWnd::ShowSplashScreen(this);
return 0;
}
/*void land::OnButton1()
{
// TODO: Add your control notification handler code here
if(MessageBox("是否删除该员工的信息?","警告",MB_ICONEXCLAMATION|MB_OKCANCEL)==1)
{CString string;
string="已经成功删除!";
MessageBox(string);
}
}
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -