📄 shortmsgdlg1.cpp
字号:
// shortmsgDlg1.cpp : implementation file
//
#include "stdafx.h"
#include "银行账户信息查询系统.h"
#include "shortmsgDlg1.h"
#include "shortmsgRs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CshortmsgDlg dialog
CshortmsgDlg::CshortmsgDlg(CWnd* pParent /*=NULL*/)
: CDialog(CshortmsgDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CshortmsgDlg)
m_phonmb = _T("");
m_phonmbag = _T("");
m_username = _T("");
//}}AFX_DATA_INIT
}
void CshortmsgDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CshortmsgDlg)
DDX_Text(pDX, IDC_EDIT_phonmb, m_phonmb);
DDX_Text(pDX, IDC_EDIT_phonmbag, m_phonmbag);
DDX_Text(pDX, IDC_EDIT_username, m_username);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CshortmsgDlg, CDialog)
//{{AFX_MSG_MAP(CshortmsgDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CshortmsgDlg message handlers
void CshortmsgDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CshortmsgRs m_shortmsgRs;
if(m_phonmb!=m_phonmbag)
AfxMessageBox("两次输入的手机号不一致,请重新输入!");
else
{
try
{
if(m_shortmsgRs.IsOpen())
m_shortmsgRs.Close();
m_shortmsgRs.m_strFilter.Format("用户名='%s' ",m_username.operator LPCTSTR());
m_shortmsgRs.Open(CRecordset::snapshot,NULL,CRecordset::none);
if(!m_shortmsgRs.IsEOF())
{
m_shortmsgRs.Close();
AfxMessageBox("您已经制订过短信通知业务!请勿重复制订!");
return;
}
m_shortmsgRs.AddNew();
m_shortmsgRs.m_column1=m_username;
m_shortmsgRs.m_column2=m_phonmb;
if(m_shortmsgRs.CanUpdate())
{
m_shortmsgRs.Update();
}
if(m_shortmsgRs.IsOpen())
m_shortmsgRs.Close();
AfxMessageBox("恭喜您,您以成功制订短信通知业务!");
}
catch(CDBException*e)
{
e->ReportError();
return;
}
}
CDialog::OnOK();
}
void CshortmsgDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -