{
MessageBox(\Differed!\
m_strPassword = \ m_strRePassword = \ UpdateData(FALSE); m_ctrPassword.SetFocus(); return ; }
CString strSQL;
strSQL.Format(\* from Account where CNo = '%s'\if
(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL)) {
MessageBox(\
Filed!\ return ; } if
(m_recordset.m_CPassword
!=
m_strPassword)
Passwords Are
Database
{
MessageBox(\Error! Please Rewrite!\
m_recordset.Close();
m_strPassword = \ m_strRePassword = \ UpdateData(FALSE); m_ctrPassword.SetFocus(); return ; }
CBankApp * ptheApp = (CBankApp *) AfxGetApp();
ptheApp->strNo = m_strNo; CDialog::OnOK(); }
(5) 在“CBankApp”类中的“InitInstance()”函数中添加登录对话框的对象: CLoginDlg dlg;
if (dlg.DoModal() != IDOK) {
return FALSE; }
完成“创建新帐户”的窗口:
ID IDC_COMBO1 控件类成员变量 型 CComboBox m_ctrSex m_tmDate m_strNo m_ctrNo 说明 性别 开户日期 帐号 IDC_DATETIMEPCTime ICKER1 IDC_EDIT1 IDC_EDIT1 IDC_EDIT2
CString CEdit CStrinm_strName 开户人
g IDC_EDIT2 IDC_EDIT3 IDC_EDIT3 IDC_EDIT4 IDC_EDIT4 IDC_EDIT5 IDC_EDIT5 IDC_EDIT6 IDC_EDIT7 IDC_EDIT7 IDOK CEdit CString CEdit CString CEdit CString CEdit m_ctrID 姓名 m_ctrName m_strPassw密码 ord m_ctrPassw ord m_strComPa确认密ssword ssword m_strID 身份证号 额 码 m_ctrComPa Double m_bBalance 帐户余CString CEdit m_strAddre开户地ss ss “钮 确定”按址 m_ctrAddre
IDCANCLE “钮 取消”按(1) 在CAccountDlg类中添加CAccontSet类的成员变量m_recordset;
(2) 添加记录集类CCurrentSet类,基类为CRecordSet,数据表为current表; (3) 添加初始化对话框OnInitDialog()方法: BOOL CAccountDlg::OnInitDialog() {
CDialog::OnInitDialog();
m_tmDate = CTime::GetCurrentTime(); m_ctrSex.AddString(\男\ m_ctrSex.AddString(\女\ UpdateData(FALSE); return TRUE; }
(4) IDOK控件的消息响应函数,完成对帐户表和活期存取款表的记录添加。
完成“删除帐户”的功能:
在CMainFrame类中添加菜单的消息响应函数,找到当前用户在账户表中的记录,并且判断该帐