MFC学生信息管理系统代码求解!!!
时间:2011-12-11
来源:互联网
// 学生基本信息统计系统View.cpp : implementation of the CMyView class
//
#include "stdafx.h"
#include "学生基本信息统计系统.h"
#include "学生基本信息统计系统Set.h"
#include "学生基本信息统计系统Doc.h"
#include "学生基本信息统计系统View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyView
IMPLEMENT_DYNCREATE(CMyView, CRecordView)
BEGIN_MESSAGE_MAP(CMyView, CRecordView)
//{{AFX_MSG_MAP(CMyView)
ON_BN_CLICKED(IDC_BUTTON1next, OnBUTTON1next)
ON_BN_CLICKED(IDC_BUTTON3delete, OnBUTTON3delete)
ON_BN_CLICKED(IDC_BUTTON2add, OnBUTTON2add)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CMyView construction/destruction
CMyView::CMyView()
: CRecordView(CMyView::IDD)
{
//{{AFX_DATA_INIT(CMyView)
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CMyView::~CMyView()
{
}
void CMyView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyView)
DDX_FieldText(pDX, IDC_EDIT1name, m_pSet->m_name, m_pSet);
DDX_FieldText(pDX, IDC_EDIT2num, m_pSet->m_num, m_pSet);
DDX_FieldText(pDX, IDC_EDIT3sex, m_pSet->m_sex, m_pSet);
DDX_FieldText(pDX, IDC_EDIT4academy, m_pSet->m_academy, m_pSet);
DDX_FieldText(pDX, IDC_EDIT5score, m_pSet->m_score, m_pSet);
//}}AFX_DATA_MAP
}
BOOL CMyView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CRecordView::PreCreateWindow(cs);
}
void CMyView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_mySet;
CRecordView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CMyView printing
BOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMyView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMyView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CMyView diagnostics
#ifdef _DEBUG
void CMyView::AssertValid() const
{
CRecordView::AssertValid();
}
void CMyView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CMyDoc* CMyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc)));
return (CMyDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyView database support
CRecordset* CMyView::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CMyView message handlers
void CMyView::OnBUTTON1next()
{
// TODO: Add your control notification handler code here
m_pSet->AddNew();
m_pSet->CanUpdate();
m_pSet->Requery();
m_pSet->MoveLast();
UpdateData(FALSE);
}
void CMyView::OnBUTTON3delete()
{
m_pSet->Delete();
m_pSet->MoveNext();
if(m_pSet->IsEOF())
m_pSet->MoveLast();
if(m_pSet->IsBOF())
m_pSet->SetFieldNull(NULL);
UpdateData(FALSE);
}
void CMyView::OnBUTTON2add()
{
// TODO: Add your control notification handler code here
添加代码可以添加学生及其相关信息,仿照其他学生信息!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
//
#include "stdafx.h"
#include "学生基本信息统计系统.h"
#include "学生基本信息统计系统Set.h"
#include "学生基本信息统计系统Doc.h"
#include "学生基本信息统计系统View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyView
IMPLEMENT_DYNCREATE(CMyView, CRecordView)
BEGIN_MESSAGE_MAP(CMyView, CRecordView)
//{{AFX_MSG_MAP(CMyView)
ON_BN_CLICKED(IDC_BUTTON1next, OnBUTTON1next)
ON_BN_CLICKED(IDC_BUTTON3delete, OnBUTTON3delete)
ON_BN_CLICKED(IDC_BUTTON2add, OnBUTTON2add)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CMyView construction/destruction
CMyView::CMyView()
: CRecordView(CMyView::IDD)
{
//{{AFX_DATA_INIT(CMyView)
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CMyView::~CMyView()
{
}
void CMyView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyView)
DDX_FieldText(pDX, IDC_EDIT1name, m_pSet->m_name, m_pSet);
DDX_FieldText(pDX, IDC_EDIT2num, m_pSet->m_num, m_pSet);
DDX_FieldText(pDX, IDC_EDIT3sex, m_pSet->m_sex, m_pSet);
DDX_FieldText(pDX, IDC_EDIT4academy, m_pSet->m_academy, m_pSet);
DDX_FieldText(pDX, IDC_EDIT5score, m_pSet->m_score, m_pSet);
//}}AFX_DATA_MAP
}
BOOL CMyView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CRecordView::PreCreateWindow(cs);
}
void CMyView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_mySet;
CRecordView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CMyView printing
BOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMyView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMyView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CMyView diagnostics
#ifdef _DEBUG
void CMyView::AssertValid() const
{
CRecordView::AssertValid();
}
void CMyView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CMyDoc* CMyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc)));
return (CMyDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyView database support
CRecordset* CMyView::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CMyView message handlers
void CMyView::OnBUTTON1next()
{
// TODO: Add your control notification handler code here
m_pSet->AddNew();
m_pSet->CanUpdate();
m_pSet->Requery();
m_pSet->MoveLast();
UpdateData(FALSE);
}
void CMyView::OnBUTTON3delete()
{
m_pSet->Delete();
m_pSet->MoveNext();
if(m_pSet->IsEOF())
m_pSet->MoveLast();
if(m_pSet->IsBOF())
m_pSet->SetFieldNull(NULL);
UpdateData(FALSE);
}
void CMyView::OnBUTTON2add()
{
// TODO: Add your control notification handler code here
添加代码可以添加学生及其相关信息,仿照其他学生信息!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
作者: qishumin1014464191 发布时间: 2011-12-11
什么意思,没理解。。
作者: gold_water 发布时间: 2011-12-11
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28