?? report2dlg.cpp
字號(hào):
// Report2Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "HosptialMan.h"
#include "Report2Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CReport2Dlg dialog
CReport2Dlg::CReport2Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CReport2Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CReport2Dlg)
//}}AFX_DATA_INIT
}
void CReport2Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CReport2Dlg)
DDX_Control(pDX, IDC_YEAR_COMBO, m_year);
DDX_Control(pDX, IDC_MONTH_COMBO, m_month);
DDX_Control(pDX, IDC_ADODC1, m_adodc);
DDX_Control(pDX, IDC_DATAGRID1, m_datagrid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CReport2Dlg, CDialog)
//{{AFX_MSG_MAP(CReport2Dlg)
ON_CBN_SELCHANGE(IDC_YEAR_COMBO, OnSelchangeYearCombo)
ON_CBN_SELCHANGE(IDC_MONTH_COMBO, OnSelchangeMonthCombo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CReport2Dlg message handlers
void CReport2Dlg::RefreshData()
{
UpdateData(true);
//讀取月份信息
CString cYear, cMonth;
int index;
index = m_year.GetCurSel();
m_year.GetLBText(index, cYear);
index = m_month.GetCurSel();
m_month.GetLBText(index, cMonth);
// 刷新記錄
CString cSql;
cSql = "SELECT * FROM ReportDoctor_v WHERE 月份='" + cYear + "-" + cMonth + "'";
//設(shè)置數(shù)據(jù)源
m_adodc.SetRecordSource(cSql);
m_adodc.Refresh();
}
BOOL CReport2Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
CTime t = CTime::GetCurrentTime(); //讀取當(dāng)前系統(tǒng)日期
int iYear, iMonth;
iYear = t.GetYear();
iMonth = t.GetMonth();
m_year.SetCurSel(iYear - 2000); //設(shè)置年
m_month.SetCurSel(iMonth - 1); //設(shè)置月
UpdateData(FALSE);
RefreshData();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CReport2Dlg::OnSelchangeYearCombo()
{
RefreshData();
}
void CReport2Dlg::OnSelchangeMonthCombo()
{
RefreshData();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -