forked from boyuanH/Bank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MangerDlg.cpp
112 lines (95 loc) · 2.55 KB
/
MangerDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// MangerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Bank.h"
#include "MangerDlg.h"
#include "AddEmpDlg.h"
#include "LoginDlg.h"
#include "AllEmpDlg.h"
#include "DelEmpDlg.h"
#include "ModEmpDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMangerDlg dialog
extern CLoginDlg dlgLogin; //登陆框
CMangerDlg::CMangerDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMangerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMangerDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMangerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMangerDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMangerDlg, CDialog)
//{{AFX_MSG_MAP(CMangerDlg)
ON_BN_CLICKED(IDC_ADDEMPLOYEE, OnAddemployee)
ON_BN_CLICKED(IDC_ALLEMPLOYEE, OnAllemployee)
ON_WM_PAINT()
ON_BN_CLICKED(IDC_DELETEEMPLOYEE, OnDeleteemployee)
ON_BN_CLICKED(IDC_MODIFYEMPLOYEE, OnModifyemployee)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMangerDlg message handlers
void CMangerDlg::OnAddemployee()
{
// TODO: Add your control notification handler code here
CAddEmpDlg dlg;
dlg.DoModal();
}
void CMangerDlg::OnCancel()
{
// TODO: Add extra cleanup here
if(MessageBox("确实要退出系统吗?","退出提示",MB_YESNO|MB_ICONQUESTION)==IDYES)
{
CDialog::OnCancel();
CLoginDlg dlg;
dlg.DoModal();
}
}
void CMangerDlg::OnAllemployee()
{
// TODO: Add your control notification handler code here
CAllEmpDlg dlg;
dlg.DoModal();
}
void CMangerDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rect;
GetClientRect(&rect);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap bmpBackground;
bmpBackground.LoadBitmap(IDB_BITMAP2);
//IDB_BITMAP是你自己的图对应的ID
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap *pbmpOld=dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,\
bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
// Do not call CDialog::OnPaint() for painting messages
}
void CMangerDlg::OnDeleteemployee()
{
// TODO: Add your control notification handler code here
CDelEmpDlg dlg;
dlg.DoModal();
}
void CMangerDlg::OnModifyemployee()
{
// TODO: Add your control notification handler code here
CModEmpDlg dlg;
dlg.DoModal();
}