// DLG_CJCard_Add.cpp : implementation file // #include "stdafx.h" #include "smsmanager.h" #include "DLG_CJCard_Add.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_CJCard_Add dialog DLG_CJCard_Add::DLG_CJCard_Add(CWnd* pParent /*=NULL*/) : CDialog(DLG_CJCard_Add::IDD, pParent) { //{{AFX_DATA_INIT(DLG_CJCard_Add) m_lPrice = 0; m_lCount = 0; //}}AFX_DATA_INIT m_pAgent = NULL; m_lAgentID = 0; } void DLG_CJCard_Add::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_CJCard_Add) DDX_Control(pDX, IDC_CJCARD_ADD_AGENT, m_L_Agent); DDX_Text(pDX, IDC_CJCARD_ADD_PRICE, m_lPrice); DDV_MinMaxUInt(pDX, m_lPrice, 1, 1000); DDX_Text(pDX, IDC_CJCARD_ADD_COUNT, m_lCount); DDV_MinMaxUInt(pDX, m_lCount, 1, 20000); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_CJCard_Add, CDialog) //{{AFX_MSG_MAP(DLG_CJCard_Add) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_CJCard_Add message handlers BOOL DLG_CJCard_Add::OnInitDialog() { CDialog::OnInitDialog(); m_L_Agent.ResetContent(); //删除原已有的企业 m_L_Agent.AddString( _T("未分配") ); 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); m_lCount = 1000; UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_CJCard_Add::SetParam(CAgentName *pAgent) { m_pAgent = pAgent; } void DLG_CJCard_Add::OnOK() { if ( !UpdateData(true)) return ; m_lAgentID = m_L_Agent.GetItemData(m_L_Agent.GetCurSel()); //取代理商ID CDialog::OnOK(); }