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

📄 stuffdlg.cpp

📁 DAO访问SQL数据库
💻 CPP
字号:
// StuffDlg.cpp : implementation file
//

#include "stdafx.h"
#include "DAODemo.h"
#include "StuffDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CStuffDlg dialog


CStuffDlg::CStuffDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CStuffDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStuffDlg)
	m_strAPrice = _T("");
	m_bChkInsurance = FALSE;
	m_strDate = _T("");
	m_strMaker = _T("");
	m_strModel = _T("");
	m_strModelNum = _T("");
	m_strPlace = _T("");
	m_strPrice = _T("");
	m_strSerialNo = _T("");
	m_strStuffDesc = _T("");
	m_strStuffMem = _T("");
	//}}AFX_DATA_INIT
}


void CStuffDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStuffDlg)
	DDX_Control(pDX, IDC_ROOM_ID, m_CtrlCBRoom);
	DDX_Control(pDX, IDC_CATE_ID, m_CtrlCBCate);
	DDX_Text(pDX, IDC_APRICE, m_strAPrice);
	DDX_Check(pDX, IDC_CHKINSURANCE, m_bChkInsurance);
	DDX_Text(pDX, IDC_DATE, m_strDate);
	DDX_Text(pDX, IDC_MAKER, m_strMaker);
	DDX_Text(pDX, IDC_MODEL, m_strModel);
	DDX_Text(pDX, IDC_MODEL_NUM, m_strModelNum);
	DDX_Text(pDX, IDC_PLACE, m_strPlace);
	DDX_Text(pDX, IDC_PRICE, m_strPrice);
	DDX_Text(pDX, IDC_SERIALNO, m_strSerialNo);
	DDX_Text(pDX, IDC_STUFFDESC, m_strStuffDesc);
	DDX_Text(pDX, IDC_STUFFMEM, m_strStuffMem);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CStuffDlg message handlers

BOOL CStuffDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	int nCateNum = m_saCate.GetSize(); 
	int nRoomNum = m_saRoom.GetSize(); 
	for(int i=0;i<nCateNum;i++){
		int nIndex = m_CtrlCBCate.AddString(m_saCate.GetAt(i));
		m_CtrlCBCate.SetItemData(nIndex, m_uaCate.GetAt(i));
	}
	for(int j=0;j<nRoomNum;j++){
		int nIndex = m_CtrlCBRoom.AddString(m_saRoom.GetAt(j));
		m_CtrlCBRoom.SetItemData(nIndex, m_uaRoom.GetAt(j));
	}
	
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CStuffDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	int nCateSel = m_CtrlCBCate.GetCurSel();
	int nRoomSel = m_CtrlCBRoom.GetCurSel();
	m_nCateID = m_CtrlCBCate.GetItemData(nCateSel);
	m_nRoomID = m_CtrlCBRoom.GetItemData(nRoomSel);
	
	//
	CDialog::OnOK();
}

⌨️ 快捷键说明

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