167 lines
3.9 KiB
C++
167 lines
3.9 KiB
C++
// FCJLog.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "corpsms.h"
|
|
#include "FCJLog.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFCJLog dialog
|
|
#include "MainFrm.h"
|
|
#include "ProcessSocket.h"
|
|
|
|
|
|
CFCJLog::CFCJLog(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CFCJLog::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CFCJLog)
|
|
// NOTE: the ClassWizard will add member initialization here
|
|
//}}AFX_DATA_INIT
|
|
m_bInit = false;
|
|
m_bRefresh = false;
|
|
}
|
|
|
|
|
|
void CFCJLog::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CFCJLog)
|
|
DDX_Control(pDX, IDC_CJLOG_LIST, m_wndList);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CFCJLog, CDialog)
|
|
//{{AFX_MSG_MAP(CFCJLog)
|
|
ON_WM_SIZE()
|
|
ON_NOTIFY(NM_DBLCLK, IDC_CJLOG_LIST, OnDblclkCjlogList)
|
|
ON_NOTIFY(NM_RCLICK, IDC_CJLOG_LIST, OnRclickCjlogList)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFCJLog message handlers
|
|
|
|
BOOL CFCJLog::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
//取得共用参数
|
|
//CMainFrame * pFrame = static_cast <CMainFrame *>((CMainFrame *)AfxGetMainWnd());
|
|
this->GetParent()->GetParentFrame();
|
|
m_pMainFrame = (CMainFrame *)this->GetParent()->GetParentFrame();
|
|
m_pSocket = &m_pMainFrame->m_Socket;
|
|
m_AdoRS.SetAdoConnection( &m_pMainFrame->m_adoConnection );
|
|
|
|
//初始化List
|
|
m_Image.Create(16,16,ILC_COLOR32|ILC_MASK,5,5);
|
|
m_Image.Add(AfxGetApp()->LoadIcon(IDI_L_CJLOG) );
|
|
m_wndList.SubClassWindow2();
|
|
m_wndList.SetHeadings(_T("序号,50; 时 间,150; 信 息,450;"));
|
|
m_wndList.SetGridLines(true);
|
|
m_wndList.SetImageList(&m_Image,LVSIL_SMALL);
|
|
//m_wndList.SetBkColor( RGB(237,191,175) );
|
|
//m_wndList.SetTextBkColor( RGB(237,191,175) );
|
|
|
|
m_bInit = true;
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CFCJLog::OnSize(UINT nType, int cx, int cy)
|
|
{
|
|
CDialog::OnSize(nType, cx, cy);
|
|
|
|
if ( m_bInit )
|
|
{
|
|
m_wndList.MoveWindow( 0 , 0 , cx,cy);
|
|
}
|
|
}
|
|
|
|
BOOL CFCJLog::ReHide()
|
|
{
|
|
ShowWindow( SW_HIDE );
|
|
return true;
|
|
}
|
|
|
|
BOOL CFCJLog::ReShow(BOOL bRefresh)
|
|
{
|
|
ShowWindow( SW_SHOW );
|
|
if ( bRefresh || !m_bRefresh )
|
|
{
|
|
RefreshInfo();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void CFCJLog::RefreshInfo()
|
|
{
|
|
REQ_CJLog_See * pSee = new REQ_CJLog_See;
|
|
pSee->lCorpID = m_pMainFrame->m_lCorpID;
|
|
pSee->lUserID = m_pMainFrame->m_lUserID;
|
|
m_pMainFrame->SendFrame( SMSFUNC_CJLOG_SEE , (BYTE*)pSee , sizeof( REQ_CJLog_See ) ); //发送取资料的请求
|
|
}
|
|
|
|
BOOL CFCJLog::ProcessSocket(Socket_Head *pHead)
|
|
{
|
|
//修改公用地址本
|
|
if (pHead->lFuncType == SMSFUNC_CJLOG_SEE)
|
|
{
|
|
m_bRefresh = true; //已刷新
|
|
ANS_CJLog_See * pSee = (ANS_CJLog_See *)pHead->pFrame;
|
|
ANS_CJLog_SeeData * pData = (ANS_CJLog_SeeData *)(pHead->pFrame+sizeof(ANS_CJLog_See));
|
|
|
|
m_wndList.ShowWindow( SW_HIDE ); //加快显示速度
|
|
m_wndList.DeleteAllItems();
|
|
|
|
TCHAR Buf[32]={0};
|
|
for ( int i=0 ; i<pSee->lCount;i++ )
|
|
{
|
|
//写到列表
|
|
m_wndList.InsertItem( i , _itot(pSee->lCount-i,Buf,10),0);
|
|
m_wndList.SetItemData(i,pData->lCJLogID);
|
|
|
|
_stprintf(Buf , _T("%04d.%02d.%02d %02d:%02d") , pData->tCJTime.wYear,pData->tCJTime.wMonth,pData->tCJTime.wDay,pData->tCJTime.wHour,pData->tCJTime.wMinute );
|
|
m_wndList.SetItemText(i,1,Buf); //充值时间
|
|
m_wndList.SetItemText(i,2,pData->szMsg); //充值内容
|
|
|
|
pData ++;
|
|
}
|
|
m_wndList.ShowWindow( SW_SHOW ); //加快显示速度
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void CFCJLog::OnDblclkCjlogList(NMHDR* pNMHDR, LRESULT* pResult)
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
|
|
*pResult = 0;
|
|
}
|
|
|
|
void CFCJLog::OnRclickCjlogList(NMHDR* pNMHDR, LRESULT* pResult)
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
|
|
*pResult = 0;
|
|
}
|
|
|
|
void CFCJLog::OnOK()
|
|
{
|
|
//CDialog::OnOK();
|
|
}
|
|
|
|
void CFCJLog::OnCancel()
|
|
{
|
|
//CDialog::OnCancel();
|
|
}
|