📄 mark_password_dialog.cpp
字号:
// Mark_Password_Dialog.cpp : implementation file
//
#include "stdafx.h"
#include "双星台球厅计时收费系统.h"
#include "Mark_Password_Dialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMark_Password_Dialog dialog
CMark_Password_Dialog::CMark_Password_Dialog(CWnd* pParent /*=NULL*/)
: CDialog(CMark_Password_Dialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CMark_Password_Dialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMark_Password_Dialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMark_Password_Dialog)
DDX_Control(pDX, IDC_EDIT3, m_Password_3);
DDX_Control(pDX, IDC_EDIT2, m_Password_2);
DDX_Control(pDX, IDC_EDIT1, m_Password_1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMark_Password_Dialog, CDialog)
//{{AFX_MSG_MAP(CMark_Password_Dialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMark_Password_Dialog message handlers
void CMark_Password_Dialog::OnOK()
{
CMainFrame *pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd;
_variant_t var;
CString str_1,str_2,str_3,str_4;
m_Password_1.GetWindowText(str_1);
if(str_PasswordMark!=str_1)
{
AfxMessageBox("对不起,输入的旧密码不正确,请从新输入!!!");
return;
}
m_Password_2.GetWindowText(str_2);
m_Password_3.GetWindowText(str_3);
if(str_2=="")
{
AfxMessageBox("对不起,输入的新密码不能为空,请从新输入!!!");
return;
}
if(str_2!=str_3)
{
AfxMessageBox("对不起,两次输入的新密码不相同,请从新输入!!!");
return;
}
try
{
pFrame->f_MyApp->m_pRecordset->Open("SELECT *FROM SystemLandPassword",
pFrame->f_MyApp->m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
if(!pFrame->f_MyApp->m_pRecordset->BOF)
{
pFrame->f_MyApp->m_pRecordset->MoveFirst();
}
while(!pFrame->f_MyApp->m_pRecordset->adoEOF)
{
var=pFrame->f_MyApp->m_pRecordset->GetCollect("PASSWORD");
if(var.vt!=VT_NULL)
{
str_4=(LPCSTR)_bstr_t(var);
if(str_4==str_1)
{
pFrame->f_MyApp->m_pRecordset->PutCollect("PASSWORD",_variant_t(str_2));
}
}
pFrame->f_MyApp->m_pRecordset->MoveNext();
}
pFrame->f_MyApp->m_pRecordset->Close();
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage());
return;
}
AfxMessageBox("密码已成功修改完毕!!!");
CDialog::OnOK();
}
BOOL CMark_Password_Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
CMainFrame *pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CString str_1,str_2;
_variant_t var;
try
{
pFrame->f_MyApp->m_pRecordset->Open("SELECT *FROM SystemLandPassword",
pFrame->f_MyApp->m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
if(!pFrame->f_MyApp->m_pRecordset->BOF)
{
pFrame->f_MyApp->m_pRecordset->MoveFirst();
}
while(!pFrame->f_MyApp->m_pRecordset->adoEOF)
{
var=pFrame->f_MyApp->m_pRecordset->GetCollect("PASSWORD");
if(var.vt!=VT_NULL)
{
str_1=(LPCSTR)_bstr_t(var);
str_PasswordMark=str_1;
}
pFrame->f_MyApp->m_pRecordset->MoveNext();
}
pFrame->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
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -