📄 sectform.cpp
字号:
// SectForm.cpp : implementation of the CSectionForm class
//
#include "stdafx.h"
#include "Enroll.h"
#include "SectSet.h"
#include "EnrolDoc.h"
#include "SectForm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSectionForm
IMPLEMENT_DYNCREATE(CSectionForm, CRecordView)
BEGIN_MESSAGE_MAP(CSectionForm, CRecordView)
//{{AFX_MSG_MAP(CSectionForm)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSectionForm construction/destruction
CSectionForm::CSectionForm()
: CRecordView(CSectionForm::IDD)
{
//{{AFX_DATA_INIT(CSectionForm)
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CSectionForm::~CSectionForm()
{
}
void CSectionForm::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSectionForm)
DDX_FieldText(pDX, IDC_COURSE, m_pSet->m_CourseID, m_pSet);
DDX_FieldText(pDX, IDC_SECTION, m_pSet->m_SectionNo, m_pSet);
DDX_FieldText(pDX, IDC_INSTRUCTOR, m_pSet->m_InstructorID, m_pSet);
DDX_FieldText(pDX, IDC_ROOM, m_pSet->m_RoomNo, m_pSet);
DDX_FieldText(pDX, IDC_SCHEDULE, m_pSet->m_Schedule, m_pSet);
DDX_FieldText(pDX, IDC_CAPACITY, m_pSet->m_Capacity, m_pSet);
//}}AFX_DATA_MAP
}
BOOL CSectionForm::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CRecordView::PreCreateWindow(cs);
}
void CSectionForm::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_sectionSet;
CRecordView::OnInitialUpdate();
}
/////////////////////////////////////////////////////////////////////////////
// CSectionForm printing
BOOL CSectionForm::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CSectionForm::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CSectionForm::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CSectionForm diagnostics
#ifdef _DEBUG
void CSectionForm::AssertValid() const
{
CRecordView::AssertValid();
}
void CSectionForm::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CEnrollDoc* CSectionForm::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEnrollDoc)));
return (CEnrollDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSectionForm database support
CRecordset* CSectionForm::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CSectionForm message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -