📄 landsystem_dlg.cpp
字号:
// LandSystem_Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "双星台球厅计时收费系统.h"
#include "LandSystem_Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLandSystem_Dlg dialog
CLandSystem_Dlg::CLandSystem_Dlg(CMyApp* MyApp)
: CDialog(CLandSystem_Dlg::IDD)
{
//{{AFX_DATA_INIT(CLandSystem_Dlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
f_MyApp=MyApp;
}
void CLandSystem_Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLandSystem_Dlg)
DDX_Control(pDX, IDC_BUTTON1, m_Cancel);
DDX_Control(pDX, IDC_EDIT1, m_PassWord);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLandSystem_Dlg, CDialog)
//{{AFX_MSG_MAP(CLandSystem_Dlg)
ON_BN_CLICKED(IDC_BUTTON1, On_Button)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLandSystem_Dlg message handlers
BOOL CLandSystem_Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_PassWord.SetWindowText("");
if(f_MyApp->m_MarkShow==TRUE)
{
m_Cancel.ShowWindow(SW_SHOW);
}
else
{
m_Cancel.ShowWindow(SW_HIDE);
}
CString str_1,str_2;
_variant_t var;
try
{
f_MyApp->m_pRecordset->Open("SELECT *FROM SystemLandPassword",
f_MyApp->m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
if(!f_MyApp->m_pRecordset->BOF)
{
f_MyApp->m_pRecordset->MoveFirst();
}
while(!f_MyApp->m_pRecordset->adoEOF)
{
var=f_MyApp->m_pRecordset->GetCollect("PASSWORD");
if(var.vt!=VT_NULL)
{
str_1=(LPCSTR)_bstr_t(var);
str_LandPassword=str_1;
}
f_MyApp->m_pRecordset->MoveNext();
}
f_MyApp->m_pRecordset->Close();
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage());
return FALSE;
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLandSystem_Dlg::OnOK()
{
CString str;
m_PassWord.GetWindowText(str);
if(str_LandPassword!=str)
{
AfxMessageBox("对不起,输入的密码不正确,请从新输入密码!");
return;
}
CDialog::OnOK();
}
void CLandSystem_Dlg::On_Button()
{
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -