www.pudn.com > agentnet.zip > AddNewAccountDlg.cpp
// AddNewAccountDlg.cpp : implementation file
//
#include "stdafx.h"
#include "AgentNetServer.h"
#include "AddNewAccountDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAddNewAccountDlg dialog
CAddNewAccountDlg::CAddNewAccountDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAddNewAccountDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddNewAccountDlg)
m_strMm = _T("");
m_strYhm = _T("");
//}}AFX_DATA_INIT
}
void CAddNewAccountDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddNewAccountDlg)
DDX_Control(pDX, IDC_COMBO_QX, m_ComboBoxQx);
DDX_Text(pDX, IDC_EDIT_MM, m_strMm);
DDX_Text(pDX, IDC_EDIT_YHM, m_strYhm);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddNewAccountDlg, CDialog)
//{{AFX_MSG_MAP(CAddNewAccountDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddNewAccountDlg message handlers
BOOL CAddNewAccountDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
UpdateData(FALSE);
while(!m_MySet->EndOfFile)
{
_variant_t vQx;
while(!m_MySet->EndOfFile)
{
vQx=m_MySet->GetCollect(L"权限");
m_ComboBoxQx.AddString(_bstr_t(vQx));
m_MySet->MoveNext();
}
}
if (m_bModify==FALSE)
m_ComboBoxQx.SetCurSel(1);
else
{
m_ComboBoxQx.SelectString(0,m_strQx);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CAddNewAccountDlg::OnOK()
{
// TODO: Add extra validation here
//测试用户名,和权限是否为空
UpdateData(TRUE);
int iSel;
iSel=m_ComboBoxQx.GetCurSel();
m_ComboBoxQx.GetLBText(iSel,m_strQx);
if (m_strYhm==""||m_strQx=="")
{
AfxMessageBox("请输入用户名,并选择权限!");
return;
}
CDialog::OnOK();
}