📄 info.cpp
字号:
// Info.cpp : implementation file
//
#include "stdafx.h"
#include "BankSystem.h"
#include "Info.h"
#include "BankSystemDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CInfo dialog
CInfo::CInfo(CWnd* pParent /*=NULL*/)
: CDialog(CInfo::IDD, pParent)
{
//{{AFX_DATA_INIT(CInfo)
m_strInterest1 = _T("");
m_strInterest2 = _T("");
m_strRatio1 = _T("");
m_strRatio2 = _T("");
//}}AFX_DATA_INIT
}
void CInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CInfo)
DDX_Text(pDX, IDC_EDIT1, m_strInterest1);
DDX_Text(pDX, IDC_EDIT2, m_strInterest2);
DDX_Text(pDX, IDC_EDIT3, m_strRatio1);
DDX_Text(pDX, IDC_EDIT4, m_strRatio2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CInfo, CDialog)
//{{AFX_MSG_MAP(CInfo)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInfo message handlers
void CInfo::ShowInfo()
{
_ConnectionPtr m_pCon;
_RecordsetPtr m_pRec;
CBankSystemApp *App = (CBankSystemApp*)AfxGetApp();
CBankSystemDlg *m_pMain = (CBankSystemDlg*)App->m_pMainWnd;
m_pCon = m_pMain->m_pConnection;
m_pRec.CreateInstance(__uuidof(Recordset));
m_pRec->Open("SELECT * FROM VIEW3",m_pCon.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
if(m_pRec->adoEOF)
{
AfxMessageBox("ERROR!");
m_pRec->Close();
return;
}
m_strInterest1 = (LPCSTR)_bstr_t(m_pRec->GetCollect("活期"));
m_strInterest2 = (LPCSTR)_bstr_t(m_pRec->GetCollect("定期"));
m_strRatio1 = (LPCSTR)_bstr_t(m_pRec->GetCollect("美元"));
m_strRatio2 = (LPCSTR)_bstr_t(m_pRec->GetCollect("欧元"));
m_strInterest1.Insert(0,"0");
m_strInterest2.Insert(0,"0");
m_strRatio1.Insert(m_strRatio1.GetLength()," : 1");
m_strRatio2.Insert(m_strRatio2.GetLength()," : 1");
UpdateData(false);
m_pRec->Close();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -