📄 personal.cpp
字号:
// Personal.cpp : implementation file
//
#include "stdafx.h"
#include "work.h"
#include "Personal.h"
#include "CommonData.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPersonal dialog
CPersonal::CPersonal(CWnd* pParent /*=NULL*/)
: CDialog(CPersonal::IDD, pParent)
{
//{{AFX_DATA_INIT(CPersonal)
m_PEmail = _T("");
m_PMobile = _T("");
m_PNumber = _T("");
m_PTel = _T("");
m_PUserName = _T("");
//}}AFX_DATA_INIT
//初始化各值
_RecordsetPtr m_pRecordset;
m_pRecordset.CreateInstance("ADODB.Recordset");
CString QueryString="SELECT * FROM Stu_Infor WHERE SNumber='"+CCommonData::userNumber+"'";
try
{
m_pRecordset->Open((LPCTSTR)QueryString,_variant_t((IDispatch *)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);
}
catch(_com_error& e)
{
MessageBox(e.Description());
}
m_pRecordset->MoveFirst();
m_PUserName=(LPCTSTR)_bstr_t(m_pRecordset->GetCollect("SName"));
m_PNumber=(LPCTSTR)_bstr_t(m_pRecordset->GetCollect("SNumber"));
CString tel,mobile,email;
tel=(LPCTSTR)_bstr_t(m_pRecordset->GetCollect("STel"));
mobile=(LPCTSTR)_bstr_t(m_pRecordset->GetCollect("SMobile"));
email=(LPCTSTR)_bstr_t(m_pRecordset->GetCollect("SEmail"));
if(tel!="0")
{
m_PTel=tel;
}
if(mobile!="0")
{
m_PMobile=mobile;
}
if(email!="0")
{
m_PEmail=email;
}
m_pRecordset->Close();
}
void CPersonal::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPersonal)
DDX_Text(pDX, IDC_PEMAIL_STATIC, m_PEmail);
DDX_Text(pDX, IDC_PMOBILE_STATIC, m_PMobile);
DDX_Text(pDX, IDC_PNUMBER_STATIC, m_PNumber);
DDX_Text(pDX, IDC_PTEL_STATIC, m_PTel);
DDX_Text(pDX, IDC_PUSERNAME_STATIC, m_PUserName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPersonal, CDialog)
//{{AFX_MSG_MAP(CPersonal)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPersonal message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -