湖南科技大学VC ++课程设计(论文)
5. 删除模块
首先由用户输入要删除的单个职员姓名,然后调用删除函数,删除该名职员的资料。 6. 信息增加
可以随时增加职员信息,实行数据库的扩充。
4.3整体界面的实现
图 4-1 系统主界面
程序的具体实现部分如程序清单如下所示:
// 杨健文View.cpp : implementation of the CMyView class
//
#include \#include \杨健文.h\
6
湖南科技大学VC ++课程设计(论文)
#include \#include \杨健文Set.h\#include \杨健文Doc.h\#include \杨健文View.h\#include \#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_BUTTON1, Ontianjia) ON_BN_CLICKED(IDC_BUTTON2, Onshanchu) ON_BN_CLICKED(IDC_BUTTON3, Onshaixuan) ON_BN_CLICKED(IDC_BUTTON4, Onpaixu) //}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
7
湖南科技大学VC ++课程设计(论文)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()
void CMyView::DoDataExchange(CDataExchange* pDX)
{ CRecordView::DoDataExchange(pDX); //{{AFX_DATA_MAP(CMyView)
DDX_FieldText(pDX, IDC_EDIT1, m_pSet->m_column1, m_pSet); DDX_FieldText(pDX, IDC_EDIT2, m_pSet->m_column2, m_pSet); DDX_FieldText(pDX, IDC_EDIT3, m_pSet->m_column3, m_pSet); DDX_FieldText(pDX, IDC_EDIT4, m_pSet->m_column4, m_pSet); DDX_FieldText(pDX, IDC_EDIT5, m_pSet->m_column5, m_pSet); DDX_FieldText(pDX, IDC_EDIT6, m_pSet->m_column6, m_pSet); DDX_FieldText(pDX, IDC_EDIT7, m_pSet->m_column7, m_pSet); DDX_FieldText(pDX, IDC_EDIT8, m_pSet->m_column8, m_pSet); DDX_FieldText(pDX, IDC_EDIT9, m_pSet->m_column9, m_pSet); //}}AFX_DATA_MAP
}
BOOL CMyView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs
8
湖南科技大学VC ++课程设计(论文)
}
return CRecordView::PreCreateWindow(cs);
void CMyView::OnInitialUpdate() { }
/////////////////////////////////////////////////////////////////////////////
// CMyView printing
BOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo) { }
void CMyView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { }
9
m_pSet = &GetDocument()->m_mySet; CRecordView::OnInitialUpdate(); GetParentFrame()->RecalcLayout(); ResizeParentToFit();
// default preparation
return DoPreparePrinting(pInfo);
// TODO: add extra initialization before printing
湖南科技大学VC ++课程设计(论文)
void CMyView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { }
/////////////////////////////////////////////////////////////////////////////
// CMyView diagnostics
#ifdef _DEBUG
void CMyView::AssertValid() const { }
void CMyView::Dump(CDumpContext& dc) const { }
CMyDoc* CMyView::GetDocument() // non-debug version is inline { }
10
// TODO: add cleanup after printing
CRecordView::AssertValid();
CRecordView::Dump(dc);
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc))); return (CMyDoc*)m_pDocument;