⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selmydlg.cpp

📁 This a integrated human resource manage system ,developed with vc++ and sql2000 Server
💻 CPP
字号:
// SelMYDlg.cpp : implementation file
//

#include "stdafx.h"
#include "HrSys.h"
#include "SelMYDlg.h"
#include "SalaryStatistics.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSelMYDlg dialog


CSelMYDlg::CSelMYDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSelMYDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSelMYDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CSelMYDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSelMYDlg)
	DDX_Control(pDX, IDC_YEAR_COMBO, m_year);
	DDX_Control(pDX, IDC_MONTH_COMBO, m_month);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSelMYDlg, CDialog)
	//{{AFX_MSG_MAP(CSelMYDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSelMYDlg message handlers

BOOL CSelMYDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	//读取当前系统日期
	CTime t = CTime::GetCurrentTime();  
	// 从系统时间中获取年和月的信息
	int iYear, iMonth;
	iYear = t.GetYear();	
	iMonth = t.GetMonth();
	// 设置年和月控件值
	m_year.SetCurSel(iYear - 2000);
	m_month.SetCurSel(iMonth - 1);	
	UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSelMYDlg::OnOK() 
{
	// 获取年和月的计算值
	long iMonth;
	iMonth = (m_year.GetCurSel() + 2000) * 100 + m_month.GetCurSel() + 1;
	CString cMonth;
	cMonth.Format("%d", iMonth);
	// 生成工资报表
	CSalaryStatistics sts;
	if(!sts.HaveRecord(cMonth))
	{
		sts.CreateSalaryReport(cMonth);	// 生成工资报表
		sts.ReportToExcel(cMonth);		// 将工资报表导出到Excel文件中显示
	}
	else
	{
		MessageBox("当月工资表已经存在");
		return;
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -