447 lines
11 KiB
C++
447 lines
11 KiB
C++
|
// K_CJCard.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "smsmanager.h"
|
|||
|
#include "K_CJCard.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// CK_CJCard dialog
|
|||
|
#include "MainFrm.h"
|
|||
|
#include "ProcessSocket.h"
|
|||
|
#include "DLG_CJCard_Add.h"
|
|||
|
#include "DLG_KHCard_Agent.h"
|
|||
|
|
|||
|
CK_CJCard::CK_CJCard(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(CK_CJCard::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(CK_CJCard)
|
|||
|
m_strBegin = _T("");
|
|||
|
m_strEnd = _T("");
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
m_bInit = false;
|
|||
|
m_bRefresh = false;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void CK_CJCard::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(CK_CJCard)
|
|||
|
DDX_Control(pDX, IDC_CJCARD_S1, m_S_S1);
|
|||
|
DDX_Control(pDX, IDC_CJCARD_AGENT, m_L_Agent);
|
|||
|
DDX_Control(pDX, IDC_CJCARD_LIST, m_wndList);
|
|||
|
DDX_Text(pDX, IDC_CJCARD_BEGIN, m_strBegin);
|
|||
|
DDV_MaxChars(pDX, m_strBegin, 16);
|
|||
|
DDX_Text(pDX, IDC_CJCARD_END, m_strEnd);
|
|||
|
DDV_MaxChars(pDX, m_strEnd, 16);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(CK_CJCard, CDialog)
|
|||
|
//{{AFX_MSG_MAP(CK_CJCard)
|
|||
|
ON_WM_SIZE()
|
|||
|
ON_NOTIFY(NM_DBLCLK, IDC_CJCARD_LIST, OnDblclkCjcardList)
|
|||
|
ON_NOTIFY(NM_RCLICK, IDC_CJCARD_LIST, OnRclickCjcardList)
|
|||
|
ON_NOTIFY(LVN_KEYDOWN, IDC_CJCARD_LIST, OnKeydownCjcardList)
|
|||
|
ON_BN_CLICKED(IDC_CJCARD_QUERY, OnCjcardQuery)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
ON_COMMAND( MENU_CJCARD_ADD , On_CJCard_Add )
|
|||
|
ON_COMMAND( MENU_CJCARD_AGENT , On_CJCard_Agent )
|
|||
|
ON_COMMAND( MENU_CJCARD_EXPORT , On_CJCard_Export )
|
|||
|
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// CK_CJCard message handlers
|
|||
|
|
|||
|
BOOL CK_CJCard::RefreshInfo()
|
|||
|
{
|
|||
|
if ( !m_pMainFrame->GetUserPurview(PURVIEW_FILT) )
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
if ( !m_pMainFrame->GetUserPurview(PURVIEW_MANAGER_SEE) )
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
return m_pMainFrame->SendFrame(SMSFUNC_AGENT_NAME,NULL,0);
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::Close()
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
while (!m_Agent.IsEmpty())
|
|||
|
{
|
|||
|
ANS_Agent_NameData * pData = m_Agent.GetHead();
|
|||
|
m_Agent.RemoveHead();
|
|||
|
delete pData;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
BOOL CK_CJCard::ReHide()
|
|||
|
{
|
|||
|
ShowWindow( SW_HIDE );
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
BOOL CK_CJCard::ReShow(BOOL bRefresh)
|
|||
|
{
|
|||
|
ShowWindow( SW_SHOW );
|
|||
|
if ( bRefresh || !m_bRefresh )
|
|||
|
{
|
|||
|
RefreshInfo();
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
BOOL CK_CJCard::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
//ȡ<>ù<EFBFBD><C3B9>ò<EFBFBD><C3B2><EFBFBD>
|
|||
|
//CMainFrame * pFrame = static_cast <CMainFrame *>((CMainFrame *)AfxGetMainWnd());
|
|||
|
this->GetParent()->GetParentFrame();
|
|||
|
m_pMainFrame = (CMainFrame *)this->GetParent()->GetParentFrame();
|
|||
|
m_pSocket = &m_pMainFrame->m_Socket;
|
|||
|
|
|||
|
//<2F><>ʼ<EFBFBD><CABC>List
|
|||
|
m_Image.Create(16,16,ILC_COLOR16|ILC_MASK,5,5);
|
|||
|
m_Image.Add(AfxGetApp()->LoadIcon(IDI_L_AGENT) );
|
|||
|
m_Image.Add(AfxGetApp()->LoadIcon(IDI_L_AGENT_DISABLE) );
|
|||
|
m_Image.Add(AfxGetApp()->LoadIcon(IDI_L_LOCK) ); m_wndList.SubClassWindow2();
|
|||
|
m_wndList.SetHeadings(_T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,40; <20><> <20><>,100; <20><> <20><>,150; <20><> <20><>,80;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,60;<3B><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>,80;<3B><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,150; <20><><EFBFBD><EFBFBD>IP,150;"));
|
|||
|
m_wndList.SetGridLines(true);
|
|||
|
m_wndList.SetImageList(&m_Image,LVSIL_SMALL);
|
|||
|
|
|||
|
m_bInit = true;
|
|||
|
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::OnSize(UINT nType, int cx, int cy)
|
|||
|
{
|
|||
|
CDialog::OnSize(nType, cx, cy);
|
|||
|
|
|||
|
if ( m_bInit )
|
|||
|
{
|
|||
|
CRect rect;
|
|||
|
m_S_S1.GetWindowRect(&rect);
|
|||
|
m_wndList.MoveWindow( 0 , 0+rect.Height()+5 , cx,cy-rect.Height()-5);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
BOOL CK_CJCard::ProcessSocket(Socket_Head *pHead)
|
|||
|
{
|
|||
|
//ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (pHead->lFuncType == SMSFUNC_AGENT_NAME)
|
|||
|
{
|
|||
|
m_bRefresh = true; //<2F>Ѿ<EFBFBD>ˢ<EFBFBD>¹<EFBFBD>
|
|||
|
ANS_Agent_Name * pAgent = (ANS_Agent_Name *)pHead->pFrame;
|
|||
|
ANS_Agent_NameData * pData = (ANS_Agent_NameData *)(pHead->pFrame+sizeof(ANS_Agent_Name));
|
|||
|
m_L_Agent.ResetContent(); //ɾ<><C9BE>ԭ<EFBFBD><D4AD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>ҵ
|
|||
|
m_L_Agent.AddString( _T("<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>") );
|
|||
|
this->Close(); //<2F>ر<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>
|
|||
|
for ( int i=0;i<pAgent->lCount;i++ )
|
|||
|
{
|
|||
|
ANS_Agent_NameData * pNewData = new ANS_Agent_NameData;
|
|||
|
*pNewData = *pData;
|
|||
|
POSITION pos = m_Agent.AddTail(pNewData);
|
|||
|
long lItem = m_L_Agent.AddString( pData->szAgentName );
|
|||
|
m_L_Agent.SetItemData( lItem , (DWORD)pos);
|
|||
|
pData ++;
|
|||
|
}
|
|||
|
m_L_Agent.SetCurSel(0);
|
|||
|
return true;
|
|||
|
}
|
|||
|
if ( pHead->lFuncType == SMSFUNC_CJCARD_ADD )
|
|||
|
{
|
|||
|
ANS_CJCard_Add * pAdd = (ANS_CJCard_Add *)pHead->pFrame;
|
|||
|
CString str;
|
|||
|
str.Format( _T("<EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD>Ϊ%d-%d"),pAdd->lCount,pAdd->lABegin,pAdd->lAEnd );
|
|||
|
MessageBox(str,_T("<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>"),MB_ICONINFORMATION );
|
|||
|
return true;
|
|||
|
}
|
|||
|
if ( pHead->lFuncType == SMSFUNC_CJCARD_SEE )
|
|||
|
{
|
|||
|
ANS_CJCard_See * pSee = (ANS_CJCard_See *)pHead->pFrame;
|
|||
|
ANS_CJCard_SeeData * pData = (ANS_CJCard_SeeData *)(pHead->pFrame+sizeof(ANS_CJCard_See));
|
|||
|
m_wndList.ShowWindow( SW_HIDE );
|
|||
|
m_wndList.DeleteAllItems();
|
|||
|
TCHAR szBuf[32];
|
|||
|
//m_wndList.SetHeadings(_T("<22><><EFBFBD><EFBFBD>,40; <20><> <20><>,80; <20><> <20><>,120; <20><> <20><>,80;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,120; <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,120; <20><><EFBFBD><EFBFBD>IP,100;"));
|
|||
|
for ( int i=0 ; i< pSee->lCount ; i++ )
|
|||
|
{
|
|||
|
m_wndList.InsertItem( i , _itot(i+1,szBuf,10),pData->lStatus);
|
|||
|
m_wndList.SetItemText(i,1,pData->szCardNum );
|
|||
|
m_wndList.SetItemText(i,2,pData->szPasswd );
|
|||
|
_stprintf( szBuf , _T("%4d.00") , pData->lPrice );
|
|||
|
m_wndList.SetItemText(i,3,szBuf);
|
|||
|
_stprintf( szBuf , _T("%d") , pData->lAgentID );
|
|||
|
m_wndList.SetItemText(i,4,szBuf );
|
|||
|
_stprintf( szBuf , _T("%d") , pData->lUserID );
|
|||
|
m_wndList.SetItemText(i,5,szBuf );
|
|||
|
_stprintf(szBuf , _T("%04d.%02d.%02d %02d:%02d") , pData->tUse.wYear,pData->tUse.wMonth,pData->tUse.wDay,pData->tUse.wHour,pData->tUse.wMinute );
|
|||
|
m_wndList.SetItemText(i,6,szBuf );
|
|||
|
m_wndList.SetItemText(i,7,pData->szUseIP );
|
|||
|
|
|||
|
m_wndList.SetItemData(i,pData->lCardID );
|
|||
|
|
|||
|
pData++;
|
|||
|
}
|
|||
|
m_wndList.ShowWindow( SW_SHOW );
|
|||
|
return true;
|
|||
|
}
|
|||
|
if ( pHead->lFuncType == SMSFUNC_CJCARD_AGENT )
|
|||
|
{
|
|||
|
ANS_CJCard_Agent * pAgent = (ANS_CJCard_Agent *)pHead->pFrame;
|
|||
|
ANS_CJCard_AgentData * pData = (ANS_CJCard_AgentData *)(pHead->pFrame+sizeof(ANS_CJCard_Agent));
|
|||
|
CString str;
|
|||
|
str.Format( _T("%d") , pAgent->lAgentID );
|
|||
|
for ( int i=0 ; i<pAgent->lCount ; i++ )
|
|||
|
{
|
|||
|
m_wndList.SetItemText( pData->lItem ,4, str );
|
|||
|
pData ++;
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
long CK_CJCard::GetCurrentSelected()
|
|||
|
{
|
|||
|
POSITION pos = m_wndList.GetFirstSelectedItemPosition();
|
|||
|
if ( pos )
|
|||
|
{
|
|||
|
return m_wndList.GetNextSelectedItem(pos);
|
|||
|
}
|
|||
|
return -1;
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::OnDblclkCjcardList(NMHDR* pNMHDR, LRESULT* pResult)
|
|||
|
{
|
|||
|
// TODO: Add your control notification handler code here
|
|||
|
|
|||
|
*pResult = 0;
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::OnRclickCjcardList(NMHDR* pNMHDR, LRESULT* pResult)
|
|||
|
{
|
|||
|
*pResult = 0;
|
|||
|
ShowRMenu();
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::OnKeydownCjcardList(NMHDR* pNMHDR, LRESULT* pResult)
|
|||
|
{
|
|||
|
LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
|
|||
|
// TODO: Add your control notification handler code here
|
|||
|
|
|||
|
*pResult = 0;
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::ShowRMenu()
|
|||
|
{
|
|||
|
if (!m_pMainFrame->GetUserPurview(PURVIEW_FILT,false)) //û<>в鿴Ȩ<E9BFB4><C8A8>
|
|||
|
return ;
|
|||
|
if ( !m_pMainFrame->GetUserPurview(PURVIEW_MANAGER_SEE,false) )
|
|||
|
{
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
CMenu menu;
|
|||
|
menu.CreatePopupMenu();
|
|||
|
BOOL bLock = false;
|
|||
|
long lItem = this->GetCurrentSelected();
|
|||
|
if ( lItem >= 0 )
|
|||
|
bLock = isLockItem( lItem , false ); //ȡ<><C8A1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
menu.AppendMenu(MF_STRING , MENU_CJCARD_ADD, _T(" <20><> <20><> ") );
|
|||
|
//<2F><EFBFBD>
|
|||
|
if ( lItem >=0 && !bLock)
|
|||
|
{
|
|||
|
menu.AppendMenu(MF_STRING , MENU_CJCARD_AGENT, _T(" <20><><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>") );
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
menu.AppendMenu(MF_STRING|MF_DISABLED|MF_GRAYED , MENU_CJCARD_AGENT , _T(" <20><><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>") );
|
|||
|
}
|
|||
|
menu.AppendMenu(MF_SEPARATOR );
|
|||
|
menu.AppendMenu(MF_STRING , MENU_CJCARD_EXPORT, _T(" <20><> <20><> ") );
|
|||
|
//<2F><>ʾ<EFBFBD>˵<EFBFBD>
|
|||
|
POINT pt ;
|
|||
|
::GetCursorPos( &pt );
|
|||
|
//this->ClientToScreen( &pt);
|
|||
|
menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_RIGHTBUTTON,pt.x,pt.y, this, NULL);
|
|||
|
menu.DestroyMenu();
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::On_CJCard_Add()
|
|||
|
{
|
|||
|
DLG_CJCard_Add dlg(this);
|
|||
|
dlg.SetParam(&m_Agent);
|
|||
|
if ( dlg.DoModal()==IDOK )
|
|||
|
{
|
|||
|
REQ_CJCard_Add * pAdd= new REQ_CJCard_Add;
|
|||
|
pAdd->lAgentID = dlg.m_lAgentID;
|
|||
|
pAdd->lCount = dlg.m_lCount;
|
|||
|
pAdd->lPrice = dlg.m_lPrice;
|
|||
|
m_pMainFrame->SendFrame(SMSFUNC_CJCARD_ADD,(BYTE *)pAdd,sizeof(REQ_CJCard_Add));
|
|||
|
}
|
|||
|
}
|
|||
|
void CK_CJCard::On_CJCard_Export()
|
|||
|
{
|
|||
|
//ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
static TCHAR BASED_CODE szFilter[] = _T("TXT Files (*.txt)|*.txt||");
|
|||
|
CFileDialog dlg(false,_T("txt"),NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter);
|
|||
|
if (dlg.DoModal() != IDOK)
|
|||
|
return ;
|
|||
|
CString strName = dlg.GetPathName();
|
|||
|
|
|||
|
CFile file;
|
|||
|
if ( !file.Open( strName , CFile::modeCreate|CFile::modeWrite ) )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
return ;
|
|||
|
}
|
|||
|
long lCount = m_wndList.GetItemCount();
|
|||
|
CString strTemp;
|
|||
|
CString strWrite;
|
|||
|
for ( int i=0 ; i<lCount ; i++ )
|
|||
|
{
|
|||
|
strTemp = m_wndList.GetItemText(i,1);
|
|||
|
strWrite = strTemp+_T(",");
|
|||
|
strTemp = m_wndList.GetItemText(i,2);
|
|||
|
strWrite += strTemp+_T(",");
|
|||
|
strTemp = m_wndList.GetItemText(i,3);
|
|||
|
strWrite += strTemp;
|
|||
|
strWrite += _T("\r\n");
|
|||
|
file.Write( strWrite , strWrite.GetLength());
|
|||
|
}
|
|||
|
file.Close();
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>") );
|
|||
|
}
|
|||
|
void CK_CJCard::On_CJCard_Agent()
|
|||
|
{
|
|||
|
//ȡѡ<C8A1><D1A1><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<DEB8><C4B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
long lSelCount = m_wndList.GetSelectedCount();
|
|||
|
ANS_CJCard_AgentData * pModify = new ANS_CJCard_AgentData[lSelCount];
|
|||
|
memset(pModify,0,sizeof(ANS_CJCard_AgentData)*lSelCount);
|
|||
|
POSITION pos = m_wndList.GetFirstSelectedItemPosition();
|
|||
|
long lIndex=0;
|
|||
|
while(pos)
|
|||
|
{
|
|||
|
pModify[lIndex].lItem =m_wndList.GetNextSelectedItem(pos);
|
|||
|
if ( m_wndList.GetIconIndex(pModify[lIndex].lItem) == 0 ) //δ<><CEB4><EFBFBD>õIJ<C3B5><C4B2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
pModify[lIndex].lCardID=m_wndList.GetItemData(pModify[lIndex].lItem);
|
|||
|
lIndex++;
|
|||
|
}
|
|||
|
}
|
|||
|
DLG_KHCard_Agent dlg(this);
|
|||
|
dlg.SetParam(&m_Agent,lIndex);
|
|||
|
if ( dlg.DoModal()==IDOK )
|
|||
|
{
|
|||
|
long lSize = sizeof(REQ_CJCard_Agent)+sizeof(ANS_CJCard_AgentData)*lIndex;
|
|||
|
BYTE * pData = new BYTE[lSize];
|
|||
|
memset(pData,0,lSize);
|
|||
|
REQ_CJCard_Agent * pAgent=(REQ_CJCard_Agent *)pData;
|
|||
|
ANS_CJCard_AgentData * pSend = (ANS_CJCard_AgentData *)(pData+sizeof(REQ_CJCard_Agent));
|
|||
|
pAgent->lCount = lIndex;
|
|||
|
pAgent->lAgentID = dlg.m_lAgentID;
|
|||
|
memcpy( pSend , pModify , sizeof(ANS_CJCard_AgentData)*lIndex);
|
|||
|
m_pMainFrame->SendFrame(SMSFUNC_CJCARD_AGENT,(BYTE *)pData,lSize);
|
|||
|
}
|
|||
|
delete pModify;
|
|||
|
}
|
|||
|
void CK_CJCard::OnCjcardQuery()
|
|||
|
{
|
|||
|
if ( !m_pMainFrame->GetUserPurview(PURVIEW_MANAGER_SEE) )
|
|||
|
{
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
if ( !UpdateData(true))
|
|||
|
return ;
|
|||
|
|
|||
|
LONGLONG m_lBegin = _ttoi64(m_strBegin);
|
|||
|
LONGLONG m_lEnd = _ttoi64(m_strEnd);
|
|||
|
if ( m_lEnd>0 || m_lBegin>0 )
|
|||
|
{
|
|||
|
if ( m_lEnd < 10010000000 )
|
|||
|
m_lEnd += 10010000000;
|
|||
|
if ( m_lBegin < 10010000000 )
|
|||
|
m_lBegin += 10010000000;
|
|||
|
UpdateData(false);
|
|||
|
|
|||
|
|
|||
|
if ( m_lEnd<m_lBegin )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD>ܴ<EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
return ;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_lEnd=0;
|
|||
|
m_lBegin=0;
|
|||
|
}
|
|||
|
|
|||
|
REQ_CJCard_See * pSee= new REQ_CJCard_See;
|
|||
|
|
|||
|
long lAgent = m_L_Agent.GetCurSel();
|
|||
|
if ( lAgent == 0 ) //ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
|
|||
|
{
|
|||
|
pSee->lAgentID = -1;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
POSITION pos = (POSITION)m_L_Agent.GetItemData(lAgent);
|
|||
|
POSITION pos2 = pos;
|
|||
|
ANS_Agent_NameData * pData = m_Agent.GetNext( pos );
|
|||
|
if (pData)
|
|||
|
{
|
|||
|
pSee->lAgentID = pData->lAgentID;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
pSee->lABegin = m_lBegin;;
|
|||
|
pSee->lAEnd = m_lEnd;
|
|||
|
|
|||
|
m_pMainFrame->SendFrame(SMSFUNC_CJCARD_SEE,(BYTE *)pSee,sizeof(REQ_CJCard_See));
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
BOOL CK_CJCard::isLockItem(long lItem, BOOL bShowWarning)
|
|||
|
{
|
|||
|
BOOL b = (m_wndList.GetIconIndex(lItem) == 2);
|
|||
|
if ( b && bShowWarning )
|
|||
|
{
|
|||
|
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><EFBFBD>ٲ<EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONINFORMATION );
|
|||
|
}
|
|||
|
return b;
|
|||
|
}
|
|||
|
|
|||
|
void CK_CJCard::SetLockItem(long lItem, BOOL bLock)
|
|||
|
{
|
|||
|
if ( bLock )
|
|||
|
m_wndList.SetIconIndex( lItem , 2 );
|
|||
|
else
|
|||
|
m_wndList.SetIconIndex( lItem , 0 );
|
|||
|
}
|