📄 missdialog.cpp
字号:
// MissDialog.cpp : implementation file
//
#include "stdafx.h"
#include "银行系统.h"
#include "MissDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// MissDialog dialog
MissDialog::MissDialog(CWnd* pParent /*=NULL*/)
: CDialog(MissDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(MissDialog)
m_account = 0;
m_password = 0;
m_name = _T("");
m_address = _T("");
m_type = -1;
m_base = 0.0;
m_missdate = _T("");
//}}AFX_DATA_INIT
time_t temp = time(NULL);
m_missdate = ctime(&temp);
}
void MissDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(MissDialog)
DDX_Text(pDX, IDC_EDIT1, m_account);
DDV_MinMaxLong(pDX, m_account, 1000, 1999);
DDX_Text(pDX, IDC_EDIT2, m_password);
DDV_MinMaxLong(pDX, m_password, 1000000, 9999999);
DDX_Text(pDX, IDC_EDIT3, m_name);
DDX_Text(pDX, IDC_EDIT4, m_address);
DDX_Radio(pDX, IDC_RADIO1, m_type);
DDX_Text(pDX, IDC_EDIT6, m_base);
DDX_Text(pDX, IDC_EDIT8, m_missdate);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(MissDialog, CDialog)
//{{AFX_MSG_MAP(MissDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// MissDialog message handlers
void MissDialog::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void MissDialog::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
if(m_account<1000||m_account>1999)
{
MessageBox("账号错误:","错误");
return;
}
if(m_address == _T(""))
{
MessageBox("请输入地址:","错误");
return;
}
if(m_base<=0||m_base >9999999)
{
MessageBox("本金错误:","错误");
return;
}
if(m_name == _T(""))
{
MessageBox("请输入姓名:","错误");
return;
}
if(m_password<1000000||m_password>9999999)
{
MessageBox("请输入7位密码:","错误");
return;
}
if(m_type == -1)
{
MessageBox("请选择储种:","错误");
return;
}
int ntype;
switch(m_type)
{
case 0: ntype = 1;break;
case 1: ntype = 3;break;
case 2: ntype = 5;break;
}
int i = MyDoc->manage.DoMiss(m_account,m_name,m_password,m_address,ntype,m_base,time(NULL));
if(i == 1)
{
MessageBox("密码错误!!!","错误",MB_OK);
return;
}
if(i == 2)
{
MessageBox("姓名错误!!!","错误",MB_OK);
return;
}
if(i == 3)
{
MessageBox("地址错误!!!","错误",MB_OK);
return;
}
if(i == 4)
{
MessageBox("储种错误!!!","错误",MB_OK);
return;
}
if(i == 5)
{
MessageBox("储金错误!!!","错误",MB_OK);
return;
}
if(i == 10)
{
MessageBox("存款已被领走!!!","错误",MB_OK);
return;
}
if(i == 20)
{
MessageBox("没有此项存款!!!","错误",MB_OK);
return;
}
MyView->missinfo = "挂失成功!";
MyView->ismiss = TRUE;
MyView->Invalidate();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -