140 lines
3.2 KiB
C++
140 lines
3.2 KiB
C++
// DLG_Commend_My.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "corpsms.h"
|
|
#include "DLG_Commend_My.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// DLG_Commend_My dialog
|
|
|
|
|
|
DLG_Commend_My::DLG_Commend_My(CWnd* pParent /*=NULL*/)
|
|
: CDialog(DLG_Commend_My::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(DLG_Commend_My)
|
|
// NOTE: the ClassWizard will add member initialization here
|
|
//}}AFX_DATA_INIT
|
|
|
|
m_pCommend = NULL;
|
|
m_pCommendData = NULL;
|
|
}
|
|
|
|
|
|
void DLG_Commend_My::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(DLG_Commend_My)
|
|
DDX_Control(pDX, IDC_COMMEND_MY_LIST, m_wndList);
|
|
DDX_Control(pDX, IDC_COMMEND_MY_VIPINT, m_E_VipInt);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(DLG_Commend_My, CDialog)
|
|
//{{AFX_MSG_MAP(DLG_Commend_My)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// DLG_Commend_My message handlers
|
|
|
|
void DLG_Commend_My::SetParam(ANS_GetCommend *pCommend, ANS_GetCommendData *pData)
|
|
{
|
|
m_pCommend=pCommend;
|
|
m_pCommendData=pData;
|
|
}
|
|
|
|
BOOL DLG_Commend_My::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
// TODO: Add extra initialization here
|
|
|
|
//初始化列表
|
|
//创建图像列表
|
|
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) ); //设置
|
|
//加入图像列表
|
|
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(" 序号,50; 类 型,70; 状态,70; 积分,50;提交时间,90; 事件,250;"));
|
|
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_My::RefreshList()
|
|
{
|
|
//m_wndList.SetHeadings(_T(" 序号,60; 类 型,80; 状态,80; 积分,80; 事件,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 );
|
|
|
|
long lTemp11=1;
|
|
switch(m_pCommendData[i].lCommendType)
|
|
{
|
|
case 1:
|
|
str =_T("兑换礼品");
|
|
break;
|
|
default:
|
|
str =_T("推荐用户");
|
|
break;
|
|
}
|
|
m_wndList.SetItemText(i, lTemp11++ , str);
|
|
switch(m_pCommendData[i].lStatus)
|
|
{
|
|
case 0:
|
|
default:
|
|
str =_T("提交成功");
|
|
break;
|
|
case 1:
|
|
str =_T("正在处理");
|
|
break;
|
|
case 2:
|
|
str =_T("已成交");
|
|
break;
|
|
case 3:
|
|
str =_T("无法成交");
|
|
break;
|
|
}
|
|
m_wndList.SetItemText(i, lTemp11++ , str);
|
|
|
|
str.Format( _T("%d") , m_pCommendData[i].lVipInt );
|
|
m_wndList.SetItemText(i, lTemp11++ , str);
|
|
str.Format( _T("%04d.%02d.%02d") , m_pCommendData[i].tCreateTime.wYear,m_pCommendData[i].tCreateTime.wMonth,m_pCommendData[i].tCreateTime.wDay );
|
|
m_wndList.SetItemText(i, lTemp11++ , str);
|
|
|
|
m_wndList.SetItemText(i, lTemp11++ , m_pCommendData[i].szTJ_CorpName);
|
|
|
|
|
|
}
|
|
}
|