📄 remaindlg.cpp
字号:
// RemainDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "BankSystem.h"
#include "RemainDlg.h"
#include ".\remaindlg.h"
#include "BankSystemDlg.h"
// RemainDlg 对话框
IMPLEMENT_DYNAMIC(RemainDlg, CDialog)
RemainDlg::RemainDlg(CWnd* pParent /*=NULL*/)
: CDialog(RemainDlg::IDD, pParent)
{
}
RemainDlg::~RemainDlg()
{
}
BOOL RemainDlg::OnInitDialog()
{
CString str="SELECT * FROM bankbook WHERE uname=\'"+UserName+"\'";
try{
pRst=pConn->Execute(_bstr_t(str),NULL,adCmdText);
}
catch(_com_error &e)
{
MessageBox(e.ErrorMessage());
return FALSE;
}
CString Result;
while(!pRst->rsEOF)//将查询到的数据加到列表框咯。
{
CString str2="您的余额为 "+(_bstr_t)pRst->GetCollect("amount")+" 元";
Result=str2;
pRst->MoveNext();
}
SetDlgItemText(IDC_Result,Result);
UpdateData();
return TRUE;
}
void RemainDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(RemainDlg, CDialog)
ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
END_MESSAGE_MAP()
// RemainDlg 消息处理程序
void RemainDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -