📄 lendchartdlg.cpp
字号:
// LendChartDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FileMaSys.h"
#include "LendChartDlg.h"
#include "LendInfoDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CFileMaSysApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CLendChartDlg dialog
CLendChartDlg::CLendChartDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLendChartDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLendChartDlg)
m_cLFileName = _T("");
//}}AFX_DATA_INIT
}
void CLendChartDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLendChartDlg)
DDX_Control(pDX, IDC_COMBO_LUSER, m_LUserControl);
DDX_Control(pDX, IDC_COMBO_LENDDAYCOUNT, m_LendDayCountControl);
DDX_Text(pDX, IDC_EDIT_FILENAME, m_cLFileName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLendChartDlg, CDialog)
//{{AFX_MSG_MAP(CLendChartDlg)
ON_CBN_SELCHANGE(IDC_COMBO_LUSER, OnSelchangeComboLuser)
ON_CBN_SELCHANGE(IDC_COMBO_LENDDAYCOUNT, OnSelchangeComboLenddaycount)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLendChartDlg message handlers
BOOL CLendChartDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//显示编辑框中的文件名称
m_cLFileName=((CLendInfoDlg *)GetParent())->m_LFileName;
UpdateData(FALSE);
//添加可以借阅人员
CString sql,str;
sql="Select * From WorkerName";
m_RecordProName.CreateInstance("ADODB.Recordset");
m_RecordProName->Open((_variant_t)sql,_variant_t((IDispatch *)theApp.m_pConnection,true),
adOpenDynamic,adLockPessimistic,adCmdText);
while (!m_RecordProName->adEOF)
{
str=m_RecordProName->GetCollect("Name").bstrVal;
m_LUserControl.AddString(str);
m_RecordProName->MoveNext();
}
//添加借阅天数
CString strCount;
for (int i=1 ;i<10;i++)
{
strCount.Format("%d天",10*i);
m_LendDayCountControl.AddString(strCount);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLendChartDlg::OnSelchangeComboLuser()
{
// TODO: Add your control notification handler code here
int i =m_LUserControl.GetCurSel();
m_LUserControl.GetLBText(i,m_LUser);
}
void CLendChartDlg::OnSelchangeComboLenddaycount()
{
// TODO: Add your control notification handler code here
int i=m_LendDayCountControl.GetCurSel();
m_DayCount=(i+1)*10;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -