144 lines
3.4 KiB
C++
144 lines
3.4 KiB
C++
|
// DLG_Commend_DH.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "corpsms.h"
|
|||
|
#include "DLG_Commend_DH.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Commend_DH dialog
|
|||
|
|
|||
|
|
|||
|
DLG_Commend_DH::DLG_Commend_DH(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(DLG_Commend_DH::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(DLG_Commend_DH)
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
|
|||
|
m_pCommend = NULL;
|
|||
|
m_pCommendData = NULL;
|
|||
|
memset(&m_RetData, 0 , sizeof(m_RetData));
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_Commend_DH::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(DLG_Commend_DH)
|
|||
|
DDX_Control(pDX, IDC_COMMEND_DH_VIPINT, m_E_VipInt);
|
|||
|
DDX_Control(pDX, IDC_COMMEND_DH_LIST, m_wndList);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_Commend_DH, CDialog)
|
|||
|
//{{AFX_MSG_MAP(DLG_Commend_DH)
|
|||
|
ON_NOTIFY(NM_DBLCLK, IDC_COMMEND_DH_LIST, OnDblclkCommendDhList)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Commend_DH message handlers
|
|||
|
|
|||
|
BOOL DLG_Commend_DH::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
|
|||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD>б<EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>б<EFBFBD>
|
|||
|
m_Image.Create( 20 , 20 , ILC_COLOR32|ILC_MASK , 5 , 1);
|
|||
|
CBitmap bmp;
|
|||
|
bmp.LoadBitmap( IDB_L_USER_NOR );
|
|||
|
m_Image.Add( &bmp , RGB(193,193,193) ); //<2F><><EFBFBD><EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>б<EFBFBD>
|
|||
|
m_wndList.SetImageList(&m_Image,LVSIL_SMALL);
|
|||
|
m_wndList.SetBkColor( RGB(237,238,188) );
|
|||
|
m_wndList.SetTextBkColor( RGB(237,238,188) );
|
|||
|
|
|||
|
m_wndList.SubClassWindow2();
|
|||
|
m_wndList.SetHeadings(_T(" <20><><EFBFBD><EFBFBD>,50;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,70;<3B><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>,130;"));
|
|||
|
m_wndList.SetGridLines(true);
|
|||
|
|
|||
|
|
|||
|
RefreshList();
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Commend_DH::SetParam(ANS_GetCommend_LP *pCommend, ANS_GetCommend_LPData *pData)
|
|||
|
{
|
|||
|
m_pCommend=pCommend;
|
|||
|
m_pCommendData=pData;
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Commend_DH::RefreshList()
|
|||
|
{
|
|||
|
//m_wndList.SetHeadings(_T(" <20><><EFBFBD><EFBFBD>,60; <20><> <20><>,80; ״̬,80; <20><><EFBFBD><EFBFBD>,80; <20>¼<EFBFBD>,150;"));
|
|||
|
if ( !m_pCommend )
|
|||
|
return;
|
|||
|
if ( !m_pCommendData )
|
|||
|
return;
|
|||
|
|
|||
|
|
|||
|
CString str;
|
|||
|
|
|||
|
str.Format( _T("%d") , m_pCommend->lVipInt);
|
|||
|
m_E_VipInt.SetWindowText(str);
|
|||
|
for ( int i=0 ; i<m_pCommend->lCount ; i++)
|
|||
|
{
|
|||
|
str.Format( _T("%d") , i+1 );
|
|||
|
m_wndList.InsertItem(i , str , 0 );
|
|||
|
|
|||
|
int lTemp11=1;
|
|||
|
|
|||
|
str.Format( _T("%d") , m_pCommendData[i].lVipInt );
|
|||
|
m_wndList.SetItemText(i, lTemp11++ , str);
|
|||
|
|
|||
|
m_wndList.SetItemText(i, lTemp11++ , m_pCommendData[i].szName);
|
|||
|
|
|||
|
m_wndList.SetItemData(i , m_pCommendData[i].lCommendLPID );
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Commend_DH::OnOK()
|
|||
|
{
|
|||
|
long lItem=m_wndList.GetFirstSelectedItem();
|
|||
|
CString str;
|
|||
|
|
|||
|
if ( lItem<0 )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD>") , _T("<EFBFBD><EFBFBD>ʾ") , MB_ICONINFORMATION );
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
if ( m_pCommendData[lItem].lVipInt>m_pCommend->lVipInt )
|
|||
|
{
|
|||
|
str.Format( _T("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD>Ҫ%d<><64><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬<EFBFBD><E3A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>") , m_pCommendData[lItem].lVipInt );
|
|||
|
MessageBox(str , _T("<EFBFBD><EFBFBD>ʾ") , MB_ICONINFORMATION );
|
|||
|
return ;
|
|||
|
}
|
|||
|
str.Format( _T("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD>[%s]<5D><>Ҫ<EFBFBD>ۼ<EFBFBD>%d<><64><EFBFBD>֣<EFBFBD><D6A3>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , m_pCommendData[lItem].szName , m_pCommendData[lItem].lVipInt );
|
|||
|
int iRet = MessageBox(str , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONQUESTION|MB_YESNO );
|
|||
|
if ( iRet!=IDYES )
|
|||
|
return ;
|
|||
|
|
|||
|
m_RetData = m_pCommendData[lItem];
|
|||
|
|
|||
|
CDialog::OnOK();
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Commend_DH::OnDblclkCommendDhList(NMHDR* pNMHDR, LRESULT* pResult)
|
|||
|
{
|
|||
|
|
|||
|
*pResult = 0;
|
|||
|
|
|||
|
OnOK();
|
|||
|
}
|