void Regist::OnClickedRegistCancel() { Hello dlg; fatherflag = 1; ShowWindow(SW_HIDE); dlg.DoModal(); ShowWindow(SW_SHOW); // TODO: 在此添加控件通知处理程序代码 }
void Manager::OnClickedManagerLogout() { Hello dlg; CurrentUser = ""; fatherflag = 1; ShowWindow(SW_HIDE); dlg.DoModal(); ShowWindow(SW_SHOW); // TODO: 在此添加控件通知处理程序代码 }
void Regist::OnClickedRegistRegist() { CDatabase db; db.Open("bankmanagement"); CString sqlstr;//,username,idcard,pwd,address,email,number; UpdateData(TRUE);//更新文本框变量 //MessageBox(m_RegUsername); sqlstr.Format(_T("insert into user(user_name,user_idcard,user_pwd,user_address,user_email,phone_number) values('%s','%s','%s','%s','%s','%s')"), m_RegUsername, m_RegIdcard, m_RegPwd, m_RegAddress, m_RegEmail, m_RegPhone); if (m_RegUsername.IsEmpty() || m_RegPwd.IsEmpty() || m_RegPwdConfirm.IsEmpty() || m_RegIdcard.IsEmpty() || m_RegAddress.IsEmpty() || m_RegEmail.IsEmpty()) { MessageBox("带*为必填项", "输入有误"); } else if (m_RegUsername == "用户名为字母与数字组合") { MessageBox("用户名未修改"); } else if (m_RegPwd.GetLength() < 6) { MessageBox("密码太短!","输入有误"); } else if (m_RegPwd != m_RegPwdConfirm) { MessageBox("输入密码不一致", "输入有误"); } else { db.ExecuteSQL(sqlstr); db.Close(); MessageBox("注册成功!返回登录。"); //this->GetParent()->SendMessage(WM_CLOSE);//关闭父对话框 Hello dlg; fatherflag = 1; ShowWindow(SW_HIDE); dlg.DoModal(); ShowWindow(SW_SHOW); } // TODO: 在此添加控件通知处理程序代码 }