📄 r2set.cpp
字号:
// R2set.cpp : implementation file
//
#include "stdafx.h"
#include "bank.h"
#include "R2set.h"
#include "qddlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CR2set
IMPLEMENT_DYNAMIC(CR2set, CRecordset)
CR2set::CR2set(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CR2set)
m_cardno = _T("");
m_password = _T("");
m_zipiaono = _T("");
m_userName = _T("");
m_identify = _T("");
m_idenno = _T("");
m_address = _T("");
m_telephone = _T("");
m_accountType = 0;
m_amount = 0.0;
m_nFields = 10;
//}}AFX_FIELD_INIT
m_nDefaultType = snapshot;
}
CString CR2set::GetDefaultConnect()
{
return _T("ODBC;DSN=money");
}
CString CR2set::GetDefaultSQL()
{
return _T("[dbo].[users]");
}
void CR2set::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CR2set)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text(pFX, _T("[cardno]"), m_cardno);
RFX_Text(pFX, _T("[password]"), m_password);
RFX_Text(pFX, _T("[zipiaono]"), m_zipiaono);
RFX_Text(pFX, _T("[userName]"), m_userName);
RFX_Text(pFX, _T("[identify]"), m_identify);
RFX_Text(pFX, _T("[idenno]"), m_idenno);
RFX_Text(pFX, _T("[address]"), m_address);
RFX_Text(pFX, _T("[telephone]"), m_telephone);
RFX_Int(pFX, _T("[accountType]"), m_accountType);
RFX_Double(pFX, _T("[amount]"), m_amount);
//}}AFX_FIELD_MAP
}
long CR2set::MyGetRecordCount()
{
long iTmp;
if(!this->IsBOF())
this->MoveFirst();
while(!this->IsEOF ())
{
this->MoveNext ();
}
iTmp = this->GetRecordCount();
return iTmp;
}
BOOL CR2set::AddConfigToTable(CString b,CString c,CString p,CString z,CString u,CString i,CString io,CString a,CString te,int ac,double m,double t)
{ Cqddlg dlg;
if (!this->IsBOF())//表明表中有记录,在增加新设置前,应首先删除旧设置
{this->MoveFirst();
while(!this->m_cardno==b)
this->MoveNext();}
this->MoveLast();
this->Delete();
this->AddNew();
this->m_cardno=c;
this->m_password = p;
this->m_zipiaono=z;
this->m_userName =u;
this->m_identify=i;
this->m_idenno=io;
this->m_address=a;
this->m_telephone=te;
this->m_accountType=ac;
this->m_amount=m+t;
this->Update();
Close();
return true; }
/////////////////////////////////////////////////////////////////////////////
// CR2set diagnostics
#ifdef _DEBUG
void CR2set::AssertValid() const
{
CRecordset::AssertValid();
}
void CR2set::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -