?? journey.cpp
字號(hào):
// Journey.cpp : implementation file
//
#include "stdafx.h"
#include "Xmgl.h"
#include "Journey.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CJourney dialog
CJourney::CJourney(CWnd* pParent /*=NULL*/)
: CDialog(CJourney::IDD, pParent)
{
//{{AFX_DATA_INIT(CJourney)
m_Enddate = 0;
m_Startdate = 0;
m_Charge = 0.0f;
m_End = _T("");
m_Item = _T("");
m_Name = _T("");
m_Start = _T("");
//}}AFX_DATA_INIT
}
void CJourney::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CJourney)
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER_ENDDATE, m_Enddate);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER_STARTDATE, m_Startdate);
DDX_Text(pDX, IDC_EDIT_CHARGE, m_Charge);
DDX_Text(pDX, IDC_EDIT_END, m_End);
DDX_Text(pDX, IDC_EDIT_ITEM, m_Item);
DDX_Text(pDX, IDC_EDIT_NAME, m_Name);
DDX_Text(pDX, IDC_EDIT_START, m_Start);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CJourney, CDialog)
//{{AFX_MSG_MAP(CJourney)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CJourney message handlers
void CJourney::OnOK()
{
// TODO: Add extra validation here
UpdateData();
if(m_Name=="")
{
MessageBox("請(qǐng)?zhí)顚懶彰?quot;);
return;
}
if(m_Item=="")
{
MessageBox("請(qǐng)?zhí)顚戫?xiàng)目名稱!");
return;
}
if( m_End=="")
{
MessageBox("請(qǐng)?zhí)顚懙竭_(dá)地點(diǎn)!");
return;
}
if( m_Start=="")
{
MessageBox("請(qǐng)?zhí)顚懗霭l(fā)地點(diǎn)!");
return;
}
//打開記錄集
CString strSQL;
strSQL="select * from xingcheng";
if(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL))
{
MessageBox("打開數(shù)據(jù)庫(kù)失敗!","數(shù)據(jù)庫(kù)錯(cuò)誤",MB_OK);
return ;
}
m_recordset.AddNew();
m_recordset.m_Name = m_Name;
m_recordset.m_Item = m_Item;
m_recordset.m_Start = m_Start;
m_recordset.m_End = m_End;
m_recordset.m_Startdate = m_Startdate;
m_recordset.m_Enddate = m_Enddate;
m_recordset.m_Charge = m_Charge;
m_recordset.Update();
m_recordset.Close();
// CDialog::OnOK();
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -