// UserIdPwdDlg.cpp : Implementation file
//

#include "stdafx.h"
#include "remotetest.h"
#include "UserIdPwdDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CUserIdPwdDlg  dialog


CUserIdPwdDlg::CUserIdPwdDlg(CVAIBO *vaibo, CWnd* pParent /*=NULL*/)
	: CDialog(CUserIdPwdDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CUserIdPwdDlg)
	m_strID = _T("");
	m_strPwd = _T("");
	//}}AFX_DATA_INIT
	m_vaibo = vaibo;
}


void CUserIdPwdDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CUserIdPwdDlg)
	DDX_Text(pDX, IDC_EDIT_ID, m_strID);
	DDX_Text(pDX, IDC_EDIT_PWD, m_strPwd);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CUserIdPwdDlg, CDialog)
	//{{AFX_MSG_MAP(CUserIdPwdDlg)
	ON_BN_CLICKED(IDC_BTN_GET, OnBtnGet)
	ON_BN_CLICKED(IDC_BTN_SET, OnBtnSet)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CUserIdPwdDlg message handlers

void CUserIdPwdDlg::OnBtnGet() 
{
	char		szUserID[9], szPassword[9];
	m_vaibo->GetUserIdPwd(szUserID, szPassword);
	m_strID.Format(_T("%s"), szUserID);
	m_strPwd.Format(_T("%s"), szPassword);
	UpdateData(FALSE);
}

void CUserIdPwdDlg::OnBtnSet() 
{
	UpdateData(TRUE);
	char		szUserID[9], szPassword[9];
	::strcpy( szUserID, m_strID );
	::strcpy( szPassword, m_strPwd );
	m_vaibo->SetUserIdPwd(szUserID, szPassword);
	
}
