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

📄 editdialog2.cpp

📁 人员管理子系统
💻 CPP
字号:
// EditDialog2.cpp : implementation file
//

#include "stdafx.h"
#include "user.h"
#include "EditDialog2.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEditDialog2 dialog


CEditDialog2::CEditDialog2(CWnd* pParent /*=NULL*/)
	: CDialog(CEditDialog2::IDD, pParent)
{
	//{{AFX_DATA_INIT(CEditDialog2)
	m_pOldPassword = _T("");
	m_pNewPassword = _T("");
	m_pNewPasswordR = _T("");
	//}}AFX_DATA_INIT
}


void CEditDialog2::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEditDialog2)
	DDX_Text(pDX, IDC_OLDPASSWORD, m_pOldPassword);
	DDX_Text(pDX, IDC_NEWPASSWORD, m_pNewPassword);
	DDX_Text(pDX, IDC_NEWPASSWORDR, m_pNewPasswordR);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CEditDialog2, CDialog)
	//{{AFX_MSG_MAP(CEditDialog2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEditDialog2 message handlers

void CEditDialog2::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	if(m_pNewPassword==m_pNewPasswordR)
	{
	CDatabase *pdb=new CDatabase();
	pdb->Open("cnxf",0,0,_T("ODBC;UID=sa;PWD=;"),0);
//	char p1[10];
//	itoa(m_ID,p1,10);
    CString str="update admin set userpassword='"+m_pNewPassword+"'";
	pdb->ExecuteSQL(str);
	pdb->Close();
	delete pdb;
	}
	else
	{
		AfxMessageBox("请重新核对您的密码");
		return;
	}

	CDialog::OnOK();
}

⌨️ 快捷键说明

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