91 lines
2.3 KiB
C++
91 lines
2.3 KiB
C++
// DLG_Manager.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "SmsCenter.h"
|
|
#include "DLG_Manager.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// DLG_Manager dialog
|
|
|
|
|
|
DLG_Manager::DLG_Manager(CWnd* pParent /*=NULL*/)
|
|
: CDialog(DLG_Manager::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(DLG_Manager)
|
|
// NOTE: the ClassWizard will add member initialization here
|
|
//}}AFX_DATA_INIT
|
|
|
|
memset( m_szUser , 0 , sizeof(m_szUser) );
|
|
memset( m_szPasswd , 0 , sizeof(m_szPasswd) );
|
|
}
|
|
|
|
|
|
void DLG_Manager::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(DLG_Manager)
|
|
DDX_Control(pDX, IDC_MAN_REPASSWD, m_E_Passwd2);
|
|
DDX_Control(pDX, IDC_MAN_PASSWD, m_E_Passwd);
|
|
DDX_Control(pDX, IDC_MAN_NAME, m_E_Name);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(DLG_Manager, CDialog)
|
|
//{{AFX_MSG_MAP(DLG_Manager)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// DLG_Manager message handlers
|
|
|
|
BOOL DLG_Manager::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
// TODO: Add extra initialization here
|
|
m_E_Name.LimitText( sizeof(m_E_Name) );
|
|
m_E_Passwd.LimitText( sizeof(m_E_Passwd) );
|
|
m_E_Passwd2.LimitText( sizeof(m_E_Passwd) );
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void DLG_Manager::OnOK()
|
|
{
|
|
TCHAR Buf[32]={0};
|
|
m_E_Name.GetWindowText( m_szUser ,sizeof(m_szUser));AllTrim(m_szUser);
|
|
m_E_Passwd.GetWindowText( m_szPasswd,sizeof(m_szPasswd) );AllTrim(m_szPasswd );
|
|
m_E_Passwd2.GetWindowText( Buf,sizeof(Buf) );AllTrim( Buf );
|
|
if ( lstrlen( m_szUser ) <=0 )
|
|
{
|
|
MessageBox( _T("管理员名称不能为空,请输入!") , _T("错误") , MB_ICONWARNING);
|
|
m_E_Name.SetFocus();
|
|
return ;
|
|
}
|
|
if ( lstrlen( m_szPasswd ) <=0 )
|
|
{
|
|
MessageBox( _T("管理员密码不能为空,请输入!") , _T("错误") , MB_ICONWARNING);
|
|
m_E_Passwd.SetFocus();
|
|
return ;
|
|
}
|
|
|
|
if ( lstrcmp( m_szPasswd , Buf ) )
|
|
{
|
|
MessageBox( _T("两次输入的密码不相同,请重输!") , _T("错误") , MB_ICONWARNING);
|
|
m_E_Passwd.SetWindowText( _T("") );
|
|
m_E_Passwd2.SetWindowText( _T("") );
|
|
m_E_Passwd.SetFocus();
|
|
return ;
|
|
}
|
|
CDialog::OnOK();
|
|
}
|