90 lines
2.0 KiB
C++
90 lines
2.0 KiB
C++
|
// DLG_KHCard_Agent.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "smsmanager.h"
|
|||
|
#include "DLG_KHCard_Agent.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_KHCard_Agent dialog
|
|||
|
|
|||
|
|
|||
|
DLG_KHCard_Agent::DLG_KHCard_Agent(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(DLG_KHCard_Agent::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(DLG_KHCard_Agent)
|
|||
|
// NOTE: the ClassWizard will add member initialization here
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
m_pAgent = NULL;
|
|||
|
m_lAgentID = 0;
|
|||
|
m_lCount = 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_KHCard_Agent::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(DLG_KHCard_Agent)
|
|||
|
DDX_Control(pDX, IDC_KHCARD_AGENT_S1, m_B_S1);
|
|||
|
DDX_Control(pDX, IDC_KHCARD_AGENT, m_L_Agent);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_KHCard_Agent, CDialog)
|
|||
|
//{{AFX_MSG_MAP(DLG_KHCard_Agent)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_KHCard_Agent message handlers
|
|||
|
|
|||
|
void DLG_KHCard_Agent::SetParam(CAgentName *pAgent, long lNum)
|
|||
|
{
|
|||
|
m_pAgent = pAgent;
|
|||
|
m_lCount = lNum;
|
|||
|
}
|
|||
|
|
|||
|
BOOL DLG_KHCard_Agent::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
m_L_Agent.ResetContent(); //ɾ<><C9BE>ԭ<EFBFBD><D4AD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>ҵ
|
|||
|
m_L_Agent.AddString( _T("δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") );
|
|||
|
POSITION pos = m_pAgent->GetHeadPosition();
|
|||
|
POSITION pos2;
|
|||
|
int i=1;
|
|||
|
while (pos)
|
|||
|
{
|
|||
|
pos2 = pos;
|
|||
|
ANS_Agent_NameData * pData = m_pAgent->GetNext( pos );
|
|||
|
if ( pData )
|
|||
|
{
|
|||
|
m_L_Agent.AddString(pData->szAgentName);
|
|||
|
m_L_Agent.SetItemData(i,pData->lAgentID);
|
|||
|
i++;
|
|||
|
}
|
|||
|
}
|
|||
|
m_L_Agent.SetCurSel(0);
|
|||
|
|
|||
|
CString str;
|
|||
|
str.Format( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>¼<EFBFBD><EFBFBD>Ϊ:%d") , m_lCount );
|
|||
|
m_B_S1.SetWindowText(str);
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|
|||
|
|
|||
|
void DLG_KHCard_Agent::OnOK()
|
|||
|
{
|
|||
|
m_lAgentID = m_L_Agent.GetItemData(m_L_Agent.GetCurSel()); //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
|
|||
|
CDialog::OnOK();
|
|||
|
}
|