📄 salaryrecordsdlg.cpp
字号:
// SalaryRecordsDlg.cpp : implementation file
//
#include "stdafx.h"
#include "SalaryManagement.h"
#include "SalaryRecordsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSalaryRecordsDlg dialog
CSalaryRecordsDlg::CSalaryRecordsDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSalaryRecordsDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSalaryRecordsDlg)
m_year = _T("");
//}}AFX_DATA_INIT
}
void CSalaryRecordsDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSalaryRecordsDlg)
DDX_Control(pDX, IDC_MONTH_COMBO, m_optmonth);
DDX_Control(pDX, IDC_DEPART_COMBO, m_optdepartment);
DDX_Text(pDX, IDC_YEAR_EDIT, m_year);
DDV_MaxChars(pDX, m_year, 4);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSalaryRecordsDlg, CDialog)
//{{AFX_MSG_MAP(CSalaryRecordsDlg)
ON_BN_CLICKED(IDC_ENQUIRE_BUTTON, OnEnquireButton)
ON_CBN_CLOSEUP(IDC_DEPART_COMBO, OnCloseupDepartCombo)
ON_CBN_CLOSEUP(IDC_MONTH_COMBO, OnCloseupMonthCombo)
ON_BN_CLICKED(IDC_CANCEL_BUTTON, OnCancelButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSalaryRecordsDlg message handlers
void CSalaryRecordsDlg::OnEnquireButton()
{
UpdateData(TRUE);
if(pDepartment->GetDepartmentName()=="Root"){
MessageBox("请选择部门");
return;
}
else if(m_year==""){
MessageBox("请输入年份");
return;
}
else if(m_month==""){
MessageBox("请输入月份");
return;
}
pDepartment->SetDate(m_year,m_month);
EndDialog(IDOK);
CSalaryTableDlg dlg;
dlg.DoModal();
}
void CSalaryRecordsDlg::OnCloseupDepartCombo()
{
CString departmentname; //选择的部门的名字
m_optdepartment.GetWindowText(departmentname);
if(departmentname=="A部门")
pDepartment=&A_Department; //对A部门进行操作
else if(departmentname=="B部门")
pDepartment=&B_Department; //对B部门进行操作
else if(departmentname=="C部门")
pDepartment=&C_Department; //对C部门进行操作
else if(departmentname=="Root")
pDepartment=&NULL_Department;
else{
MessageBox("请先选择要操作的部门");
return;
}
}
void CSalaryRecordsDlg::OnCloseupMonthCombo()
{
m_optmonth.GetWindowText(m_month);
}
void CSalaryRecordsDlg::OnCancelButton()
{
EndDialog(IDCANCEL);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -