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

📄 reservationview.cpp

📁 一个课程作业
💻 CPP
字号:
// ReservationView.cpp : implementation file
//

#include "stdafx.h"
#include "order.h"
#include "ReservationView.h"
#include "FilterReservation.h"

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

/////////////////////////////////////////////////////////////////////////////
// CReservationView

IMPLEMENT_DYNCREATE(CReservationView, CRecordView)

CReservationView::CReservationView()
	: CRecordView(CReservationView::IDD)
{
	//{{AFX_DATA_INIT(CReservationView)
	m_pSet = NULL;
	//}}AFX_DATA_INIT
}

CReservationView::~CReservationView()
{
	if (m_pSet)
		delete m_pSet;
}

void CReservationView::DoDataExchange(CDataExchange* pDX)
{
	CRecordView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CReservationView)
	DDX_FieldText(pDX, IDC_EDIT1, m_pSet->m_custName, m_pSet);
	DDX_FieldText(pDX, IDC_EDIT2, m_pSet->m_resvType, m_pSet);
	DDX_FieldText(pDX, IDC_EDIT3, m_pSet->m_resvKey, m_pSet);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CReservationView, CRecordView)
	//{{AFX_MSG_MAP(CReservationView)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CReservationView diagnostics

#ifdef _DEBUG
void CReservationView::AssertValid() const
{
	CRecordView::AssertValid();
}

void CReservationView::Dump(CDumpContext& dc) const
{
	CRecordView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CReservationView message handlers

CRecordset* CReservationView::OnGetRecordset()
{
	if (m_pSet != NULL)
		return m_pSet;

	m_pSet = new CReservationSet(NULL);
	m_pSet->Open();

	return m_pSet;
}

CReservationSet* CReservationView::GetRecordset()
{
	CReservationSet* pData = (CReservationSet*) OnGetRecordset();
	ASSERT(pData == NULL || pData->IsKindOf(RUNTIME_CLASS(CReservationSet)));
	return pData;
}

void CReservationView::OnInitialUpdate()
{
	BeginWaitCursor();
	GetRecordset();
	CRecordView::OnInitialUpdate();
	if (m_pSet->IsOpen())
	{
		CString strTitle = m_pSet->m_pDatabase->GetDatabaseName();
		CString strTable = m_pSet->GetTableName();
		if (!strTable.IsEmpty())
			strTitle += _T(":") + strTable;
		GetDocument()->SetTitle(strTitle);
	}
	EndWaitCursor();
}

⌨️ 快捷键说明

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