📄 dayplanset.cpp
字号:
// DayPlanSet.cpp : implementation file
//
#include "stdafx.h"
#include "StationManage.h"
#include "DayPlanSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDayPlanSet
IMPLEMENT_DYNAMIC(CDayPlanSet, CRecordset)
CDayPlanSet::CDayPlanSet(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CDayPlanSet)
m_ID = 0;
m_plan_date = _T("");
m_route_id = 0;
m_bus_id = 0;
m_bus_number = _T("");
m_bus_type = 0;
m_seat_left = 0;
m_fc_time = _T("");
m_run_state = 0;
m_nFields = 9;
//}}AFX_FIELD_INIT
m_nDefaultType = snapshot;
}
CString CDayPlanSet::GetDefaultConnect()
{
return _T("ODBC;DSN=StationManage");
}
CString CDayPlanSet::GetDefaultSQL()
{
return _T("[dbo].[dayplan]");
}
void CDayPlanSet::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CDayPlanSet)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[ID]"), m_ID);
RFX_Text(pFX, _T("[plan_date]"), m_plan_date);
RFX_Long(pFX, _T("[route_id]"), m_route_id);
RFX_Long(pFX, _T("[bus_id]"), m_bus_id);
RFX_Text(pFX, _T("[bus_number]"), m_bus_number);
RFX_Long(pFX, _T("[bus_type]"), m_bus_type);
RFX_Long(pFX, _T("[seat_left]"), m_seat_left);
RFX_Text(pFX, _T("[fc_time]"), m_fc_time);
RFX_Long(pFX, _T("[run_state]"), m_run_state);
//}}AFX_FIELD_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CDayPlanSet diagnostics
#ifdef _DEBUG
void CDayPlanSet::AssertValid() const
{
CRecordset::AssertValid();
}
void CDayPlanSet::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG
CDayPlanSet* CDayPlanSet::SearchById(int id)
{
if (!this->IsOpen())
{
this->Open();
}
this->MoveFirst();
while (!this->IsEOF())
{
if (this->m_ID==id)
{
return this;
}
else
{
this->MoveNext();
}
}
if (this->IsEOF())
{
return NULL;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -