📄 trainplaninfo.cpp
字号:
// TrainPlanInfo.cpp : implementation file
//
#include "stdafx.h"
#include "train.h"
#include "TrainPlanInfo.h"
#include "TrainPlanSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTrainPlanInfo dialog
CTrainPlanInfo::CTrainPlanInfo(CWnd* pParent /*=NULL*/)
: CDialog(CTrainPlanInfo::IDD, pParent)
{
//{{AFX_DATA_INIT(CTrainPlanInfo)
m_courseid = 0;
m_teacherid = 0;
m_total = 0;
m_site = _T("");
m_start = 0;
m_end = 0;
//}}AFX_DATA_INIT
}
void CTrainPlanInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTrainPlanInfo)
DDX_Text(pDX, IDC_EDIT1, m_courseid);
DDX_Text(pDX, IDC_EDIT4, m_teacherid);
DDX_Text(pDX, IDC_EDIT5, m_total);
DDX_Text(pDX, IDC_EDIT6, m_site);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_start);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER2, m_end);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTrainPlanInfo, CDialog)
//{{AFX_MSG_MAP(CTrainPlanInfo)
ON_BN_CLICKED(IDC_BUTTONRESET, OnButtonreset)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTrainPlanInfo message handlers
void CTrainPlanInfo::OnCancel()
{
// TODO: Add extra cleanup here
m_database.Close();
CDialog::OnCancel();
}
void CTrainPlanInfo::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CString strSQL;
// CResourceSet m_recordset(&m_database);
CTrainPlanSet m_recordset(&m_database);
strSQL.Format("insert into COURSE_AVAILABLE values(%d,\'%d-%d-%d\',\'%d-%d-%d\',%d,%d,\'%s\')",m_courseid,m_start.GetYear(),m_start.GetMonth(),m_start.GetDay(),m_end.GetYear(),m_end.GetMonth(),m_end.GetDay(),m_teacherid,m_total,m_site);
m_database.ExecuteSQL(strSQL);
m_database.Close();
CDialog::OnOK();
}
void CTrainPlanInfo::OnButtonreset()
{
// TODO: Add your control notification handler code here
m_courseid=0;
m_teacherid=0;
m_total=0;
m_site.Empty();
UpdateData(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -