Exemplo n.º 1
0
void CLoginDlg::OnLogin()
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	if(m_UserName.IsEmpty()||m_PassWord.IsEmpty()){
		AfxMessageBox(_T("密码或用户名不得为空!"));
		return;
	}
	DataBase db;
	CString UserPwd = db.GetLogInPwd(m_UserName);
	if(UserPwd==m_PassWord){
		ShowWindow(SW_HIDE);
		CAdminDlg dlg;
		dlg.DoModal();
		PostMessageW(WM_CLOSE,0,0);
	}
	else{	
		AfxMessageBox(_T("用户名或密码错误,请重新输入"));
		m_UserName.Empty();
		m_PassWord.Empty();
		UpdateData(FALSE);
	}
}
Exemplo n.º 2
0
void C图片管理器App::OnCalladmin()
{
	CAdminDlg dlg;
	dlg.DoModal();
	// TODO: 在此添加命令处理程序代码
}