?? userinfoview.cpp
字號:
// UserinfoView.cpp : implementation file
//
#include "stdafx.h"
#include "INhabitants.h"
#include "UserinfoView.h"
#include "INhabitantsDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CUserinfoView
IMPLEMENT_DYNCREATE(CUserinfoView, CFormView)
CUserinfoView::CUserinfoView()
: CFormView(CUserinfoView::IDD)
{
//{{AFX_DATA_INIT(CUserinfoView)
m_strBeeppager = _T("");
m_nBuilding = 0;
m_nCellnum = 0;
m_strEmail = _T("");
m_strHouseTel = _T("");
m_strHousemaster = _T("");
m_strMobile = _T("");
m_strOffice = _T("");
m_strOfficeTel = _T("");
m_nRoomnum = 0;
m_strSectionname = _T("");
//}}AFX_DATA_INIT
}
CUserinfoView::~CUserinfoView()
{
}
void CUserinfoView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CUserinfoView)
DDX_Text(pDX, IDC_EDIT_BEEPPAGER, m_strBeeppager);
DDX_Text(pDX, IDC_EDIT_BUILDINGNUM, m_nBuilding);
DDX_Text(pDX, IDC_EDIT_CELLNUM, m_nCellnum);
DDX_Text(pDX, IDC_EDIT_EMAIL, m_strEmail);
DDX_Text(pDX, IDC_EDIT_HOMETEL, m_strHouseTel);
DDX_Text(pDX, IDC_EDIT_HOUSEMASTER, m_strHousemaster);
DDX_Text(pDX, IDC_EDIT_MOBILE, m_strMobile);
DDX_Text(pDX, IDC_EDIT_OFFICE, m_strOffice);
DDX_Text(pDX, IDC_EDIT_OFFICETEL, m_strOfficeTel);
DDX_Text(pDX, IDC_EDIT_ROOMNUM, m_nRoomnum);
DDX_Text(pDX, IDC_EDIT_SECTIONNAME, m_strSectionname);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CUserinfoView, CFormView)
//{{AFX_MSG_MAP(CUserinfoView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CUserinfoView diagnostics
#ifdef _DEBUG
void CUserinfoView::AssertValid() const
{
CFormView::AssertValid();
}
void CUserinfoView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CUserinfoView message handlers
void CUserinfoView::UpdateUserInfo(CString strSectionName, int nBuildingNum, int nCellNum, int nRoomNum)
{
CString strSql;
strSql.Format("select * from house where sectionname = '%s' \
and buildingnum = %d and cellnum = %d and roomnum = %d",
strSectionName, nBuildingNum, nCellNum, nRoomNum);
CINhabitantsDoc * pDoc = (CINhabitantsDoc *)GetDocument();
CCommand<CAccessor<ChouseAccessor> > dbHouse;
long * pCount = new long;
if(dbHouse.Open(pDoc->m_dbHouse.m_session, strSql, NULL, pCount) != S_OK){
AfxMessageBox("error");
delete pCount;
return;
}
if(dbHouse.MoveFirst() == S_OK){
m_strHousemaster = dbHouse.m_housemaster;
m_strSectionname = dbHouse.m_sectionname;
m_nBuilding = dbHouse.m_buildingnum;
m_nCellnum = dbHouse.m_cellnum;
m_nRoomnum = dbHouse.m_roomnum;
m_strHouseTel = dbHouse.m_housetel;
m_strOffice = dbHouse.m_office;
m_strOfficeTel = dbHouse.m_officetel;
m_strBeeppager = dbHouse.m_beeppager;
m_strMobile = dbHouse.m_mobile;
m_strEmail = dbHouse.m_email;
}
dbHouse.Close();
UpdateData(FALSE);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -