2025-02-27 16:58:16 +08:00
// FUBoxLog.cpp : implementation file
//
# include "stdafx.h"
# include "corpsms.h"
# include "FUBoxLog.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CFUBoxLog dialog
# include "MainFrm.h"
# include "ProcessSocket.h"
# include "DLG_BAK.h"
# include "DLG_UBoxLog_See.h"
# include "DLG_Find_UBoxLog.h"
# include "DLG_UserSelect.h"
//#include "DLG_Find_Fail.h"
//#include "DLG_SMSLog_Export.h"
CFUBoxLog : : CFUBoxLog ( CWnd * pParent /*=NULL*/ )
: CDialog ( CFUBoxLog : : IDD , pParent )
, m_strKey ( _T ( " " ) )
{
//{{AFX_DATA_INIT(CFUBoxLog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bInit = false ;
m_bRefresh = false ;
m_lRefreshStatusIndex = 0 ;
m_bShowToday = true ;
m_bShowAllRecord = false ;
m_bNewDB = true ;
m_pUBoxLog_See = NULL ;
m_tBegin = COleDateTime : : GetCurrentTime ( ) ;
m_tEnd = COleDateTime : : GetCurrentTime ( ) ;
m_lStatus = 0 ;
// m_lType = 0;
m_strUser = _T ( " " ) ;
m_lCallWay = 0 ;
m_strType = _T ( " " ) ;
m_lTotalSC = 0 ;
}
void CFUBoxLog : : DoDataExchange ( CDataExchange * pDX )
{
CDialog : : DoDataExchange ( pDX ) ;
//{{AFX_DATA_MAP(CFUBoxLog)
DDX_Control ( pDX , IDC_MMSLOG_LIST , m_wndList ) ;
//}}AFX_DATA_MAP
DDX_Control ( pDX , IDC_UBOX_LOG_S1 , m_S_S1 ) ;
DDX_DateTimeCtrl ( pDX , IDC_UBOX_LOG_BEGIN , m_tBegin ) ;
DDX_DateTimeCtrl ( pDX , IDC_UBOX_LOG_END , m_tEnd ) ;
DDX_CBIndex ( pDX , IDC_UBOX_LOG_STATUS , m_lStatus ) ;
// DDX_CBIndex(pDX, IDC_UBOX_LOG_TYPE, m_lType);
DDX_Text ( pDX , IDC_UBOX_LOG_USER , m_strUser ) ;
DDX_CBIndex ( pDX , IDC_UBOX_LOG_CALLWAY , m_lCallWay ) ;
DDX_CBString ( pDX , IDC_UBOX_LOG_TYPE , m_strType ) ;
DDV_MaxChars ( pDX , m_strType , 30 ) ;
DDX_Text ( pDX , IDC_UBOX_LOG_KEY , m_strKey ) ;
DDV_MaxChars ( pDX , m_strKey , 60 ) ;
DDX_Control ( pDX , IDC_UBOX_LOG_TYPE , m_L_Type ) ;
DDX_Control ( pDX , IDC_UBOX_LOG_SC , m_S_SC ) ;
}
BEGIN_MESSAGE_MAP ( CFUBoxLog , CDialog )
//{{AFX_MSG_MAP(CFUBoxLog)
ON_WM_SIZE ( )
ON_NOTIFY ( NM_RCLICK , IDC_MMSLOG_LIST , OnRclickSmslogList )
ON_NOTIFY ( NM_DBLCLK , IDC_MMSLOG_LIST , OnDblclkSmslogList )
ON_NOTIFY ( LVN_KEYDOWN , IDC_MMSLOG_LIST , OnKeydownSmslogList )
//}}AFX_MSG_MAP
ON_MESSAGE ( UBOX_EVENT , UBox_Event )
ON_COMMAND ( MENU_LOG_DEL , On_User_Del )
ON_COMMAND ( MENU_LOG_SEE , On_User_See )
ON_COMMAND ( MENU_LOG_SEND , On_User_Send )
ON_COMMAND ( MENU_LOG_EXPORT , On_User_Export )
ON_COMMAND ( MENU_LOG_REFRESH , On_User_Refresh )
ON_COMMAND ( MENU_LOG_REFSTATUS , On_User_RefStatus )
ON_COMMAND ( MENU_LOG_FIND , On_User_Find )
ON_COMMAND ( MENU_LOG_BAK , On_User_Bak )
ON_COMMAND ( MENU_LOG_QUERYFAIL , On_User_QueryFail )
ON_COMMAND ( MENU_LOG_SHOWALLRECORD , On_User_Refresh_All )
ON_COMMAND ( MENU_LOG_PLAY , On_User_Play )
ON_BN_CLICKED ( IDC_UBOX_LOG_QUERY , & CFUBoxLog : : OnBnClickedUboxLogQuery )
ON_BN_CLICKED ( IDC_UBOX_LOG__SEL , & CFUBoxLog : : OnBnClickedUboxLog )
ON_WM_DESTROY ( )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CFUBoxLog message handlers
BOOL CFUBoxLog : : 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 ;
m_AdoRS . SetAdoConnection ( & m_pMainFrame - > m_adoConnection ) ;
//<2F> <> ʼ <EFBFBD> <CABC> List
m_Image . Create ( 16 , 16 , ILC_COLOR32 | ILC_MASK , 5 , 5 ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_CALLIN ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_CALLIN2 ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_CALLOUT ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_CALLOUT2 ) ) ;
m_wndList . SubClassWindow2 ( ) ;
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,90;<3B> <> <EFBFBD> <EFBFBD> ,60;״̬,60;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,100;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,100;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,130;ͨ<> <CDA8> ʱ<EFBFBD> <CAB1> ,80;<3B> <> <EFBFBD> <EFBFBD> ,90;<3B> <> <EFBFBD> 絥λ,150;ͨ<> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,120;<3B> <> ע,200;" ) ) ;
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 ;
//Ĭ<> ϲ <EFBFBD> <CFB2> <EFBFBD> <EFBFBD> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//m_strUser = m_pMainFrame->m_pCurUser->szUser;
m_lUserID = m_pMainFrame - > m_lUserID ;
//ȡ¼<C8A1> <C2BC> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> ·<EFBFBD> <C2B7>
TCHAR szPath [ 512 ] = { 0 } ;
m_pMainFrame - > GetCurrentPath ( szPath ) ;
_tcscat ( szPath , _T ( " Record " ) ) ;
m_strRecordPath = szPath ;
: : CreateDirectory ( szPath , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> ȴ<EFBFBD> <C8B4> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD>
return TRUE ; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CFUBoxLog : : ReHide ( )
{
ShowWindow ( SW_HIDE ) ;
return true ;
}
BOOL CFUBoxLog : : ReShow ( BOOL bRefresh )
{
USES_CONVERSION ;
m_AdoRS . Close ( ) ;
if ( m_strBakDBName . GetLength ( ) < = 0 )
{
m_adoConnection . Close ( ) ;
m_AdoRS . SetAdoConnection ( & m_pMainFrame - > m_adoConnection ) ;
}
else
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
char szPasswd [ 64 ] = { 0 } ; strcpy ( szPasswd , ACCESS_PASSWD ) ;
char szKey [ 64 ] = { 0 } ; strcpy ( szKey , ACCESS_KEY ) ;
char szNew2 [ 64 ] = { 0 } ; long lOut = sizeof ( szNew2 ) ;
TCHAR szNew [ 64 ] = { 0 } ;
CDes des ;
des . Decrypt ( szPasswd , strlen ( szPasswd ) , szNew2 , lOut , szKey , 8 ) ;
# ifdef UNICODE
_tcscpy ( szNew , A2W ( szNew2 ) ) ;
# else
_tcscpy ( szNew , szNew2 ) ;
# endif
m_adoConnection . Close ( ) ;
if ( ! m_adoConnection . ConnectAccess ( m_strBakDBName , szNew ) ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> Ҫ<EFBFBD> <D2AA> <EFBFBD> ´ <EFBFBD> <C2B4> <EFBFBD>
{
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 ) ;
m_bShowToday = true ;
m_AdoRS . SetAdoConnection ( & m_pMainFrame - > m_adoConnection ) ;
}
else
{
m_bShowToday = false ;
m_AdoRS . SetAdoConnection ( & m_adoConnection ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
}
ShowWindow ( SW_SHOW ) ;
if ( bRefresh | | ! m_bRefresh | | m_bNewDB )
{
RefreshInfo ( ) ;
m_bNewDB = false ;
}
return true ;
}
BOOL CFUBoxLog : : RefreshInfo ( )
{
//Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> Ȳ<EFBFBD> ѯ<EFBFBD> Լ<EFBFBD>
//û<> в<EFBFBD> ѯ<EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> Ȩ<EFBFBD> ޣ<EFBFBD> ֻ<EFBFBD> ܲ<EFBFBD> ѯ<EFBFBD> Լ<EFBFBD>
m_strUser = m_pMainFrame - > m_pCurUser - > szUser ;
m_lUserID = m_pMainFrame - > m_lUserID ;
UpdateData ( false ) ;
REQ_UBox_GetType * pGetType = new REQ_UBox_GetType ;
memset ( pGetType , 0 , sizeof ( REQ_UBox_GetType ) ) ;
pGetType - > lCorpID = m_pMainFrame - > m_lCorpID ;
pGetType - > lUserID = m_pMainFrame - > m_lUserID ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_GETTYPE , ( BYTE * ) pGetType , sizeof ( REQ_UBox_GetType ) ) ; //<2F> <> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD>
/*
m_wndList . ShowWindow ( SW_HIDE ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
m_bRefresh = true ;
m_wndList . DeleteAllItems ( ) ;
CString strSelect ;
CString strTop ;
if ( ! m_bShowAllRecord & & m_pMainFrame - > m_Setup . lTopRecord > 0 )
{
strTop . Format ( _T ( " top %d " ) , m_pMainFrame - > m_Setup . lTopRecord ) ;
}
if ( m_bShowToday )
{
//<2F> <> <EFBFBD> <EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
SYSTEMTIME t ; : : GetLocalTime ( & t ) ;
if ( m_pMainFrame - > m_Setup . bSQLUse )
strSelect . Format ( _T ( " select %s * from ( uboxlog left join paddress on uboxlog.khaddid = paddress.userid ) left join gaddress on uboxlog.ywyaddid=gaddress.userid where CallTime>='%04d%02d%02d' %s order by CallTime desc " ) , strTop , t . wYear , t . wMonth , t . wDay , m_strFindAdd ) ; //<2F> <> ѯ<EFBFBD> ѷ<EFBFBD> <D1B7> <EFBFBD> <EFBFBD> <EFBFBD>
else
strSelect . Format ( _T ( " select %s * from ( uboxlog left join paddress on uboxlog.khaddid = paddress.userid ) left join gaddress on uboxlog.ywyaddid=gaddress.userid where CallTime>=#%04d-%02d-%02d# %s order by CallTime desc " ) , strTop , t . wYear , t . wMonth , t . wDay , m_strFindAdd ) ; //<2F> <> ѯ<EFBFBD> ѷ<EFBFBD> <D1B7> <EFBFBD> <EFBFBD> <EFBFBD>
}
else
{
if ( m_strFindAdd . GetLength ( ) > 0 )
strSelect . Format ( _T ( " select * from ( uboxlog left join paddress on uboxlog.khaddid = paddress.userid ) left join gaddress on uboxlog.ywyaddid=gaddress.userid where 1 %s order by CallTime desc " ) , m_strFindAdd ) ; //<2F> <> ѯ<EFBFBD> <D1AF> <EFBFBD> ռ <EFBFBD> ¼
else
strSelect . Format ( _T ( " select * from ( uboxlog left join paddress on uboxlog.khaddid = paddress.userid ) left join gaddress on uboxlog.ywyaddid=gaddress.userid order by CallTime desc " ) ) ; //<2F> <> ѯ<EFBFBD> <D1AF> ־,<2C> <> ʾ ȫ<CABE> <C8AB> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> ʾ ͷ<CABE> <CDB7> <EFBFBD> <EFBFBD>
}
BOOL b = m_AdoRS . Open ( strSelect ) ;
UBox_Item ubox = { 0 } ;
long lCount = m_AdoRS . GetRecordCount ( ) ;
if ( ! m_bShowAllRecord & & m_pMainFrame - > m_Setup . lTopRecord > 0 & &
lCount > m_pMainFrame - > m_Setup . lTopRecord )
{
lCount = m_pMainFrame - > m_Setup . lTopRecord ;
}
m_bShowAllRecord = false ; //<2F> <> ʾ <EFBFBD> <CABE> һ <EFBFBD> κ<CEBA> <F3A3ACB2> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> ʾ
if ( b & & lCount )
{
m_AdoRS . MoveFirst ( ) ;
long iItem = 0 ;
while ( ! m_AdoRS . IsEOF ( ) & & iItem < lCount )
{
COleDateTime t ;
m_AdoRS . GetCollect ( _T ( " UBoxID " ) , ubox . lUBoxID ) ;
m_AdoRS . GetCollect ( _T ( " Status " ) , ubox . lStatus ) ;
m_AdoRS . GetCollect ( _T ( " CallNum " ) , ubox . szCallNum ) ;
m_AdoRS . GetCollect ( _T ( " CallTime " ) , t ) ; t . GetAsSystemTime ( ubox . tCallTime ) ;
m_AdoRS . GetCollect ( _T ( " KHAddID " ) , ubox . lKHAddID ) ;
m_AdoRS . GetCollect ( _T ( " YWYAddID " ) , ubox . lYWYAddID ) ;
m_AdoRS . GetCollect ( _T ( " SendSms " ) , ubox . szSendSms ) ;
m_AdoRS . GetCollect ( _T ( " uboxlog.BZ " ) , ubox . szBZ ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Name " ) , ubox . szKH_Name ) ;
m_AdoRS . GetCollect ( _T ( " paddress.LTD " ) , ubox . szKH_LTD ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Addr " ) , ubox . szKH_Addr ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Mobile " ) , ubox . szKH_Mobile ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Tel " ) , ubox . szKH_Tel ) ;
m_AdoRS . GetCollect ( _T ( " gaddress.Name " ) , ubox . szYWY_Name ) ;
m_AdoRS . GetCollect ( _T ( " gaddress.Mobile " ) , ubox . szYWY_Mobile ) ;
m_AdoRS . GetCollect ( _T ( " gaddress.LTD " ) , ubox . szYWY_LTD ) ;
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50;״̬,60;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,100;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,100;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,80;<3B> <> <EFBFBD> 絥λ,130;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ַ,130;ҵ<> <D2B5> Ա,80;ҵ<> <D2B5> Ա<EFBFBD> ֻ<EFBFBD> ,100;<3B> ·<EFBFBD> <C2B7> <EFBFBD> <EFBFBD> <EFBFBD> ,200;<3B> <> ע,200;"));
TCHAR szSelect [ 32 ] = { 0 } ;
m_wndList . InsertItem ( iItem , _itot ( lCount - iItem , szSelect , 10 ) , 0 ) ;
m_wndList . SetItemData ( iItem , ubox . lUBoxID ) ;
ShowUBox ( ubox , iItem ) ;
iItem + + ;
memset ( & ubox , 0 , sizeof ( ubox ) ) ;
m_AdoRS . MoveNext ( ) ;
}
}
RefreshStatus ( ) ;
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
if ( strTop . GetLength ( ) > 0 & & lCount > = m_pMainFrame - > m_Setup . lTopRecord ) //<2F> <> ʾ <EFBFBD> <CABE> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> м<EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1>
{
CMenu menu ;
menu . CreatePopupMenu ( ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
menu . AppendMenu ( MF_STRING , MENU_LOG_SHOWALLRECORD , _T ( " <20> <> ʾ <EFBFBD> <CABE> <EFBFBD> м<EFBFBD> ¼ " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
CRect rect ;
GetWindowRect ( & rect ) ;
//ClientToScreen(&rect);
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
POINT pt ;
pt . x = rect . Width ( ) / 2 ;
pt . y = rect . Height ( ) / 3 ;
ClientToScreen ( & pt ) ;
//menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_RIGHTBUTTON,pt.x,pt.y, this, NULL);
menu . TrackPopupMenu ( TPM_CENTERALIGN , pt . x , pt . y , this , NULL ) ;
menu . DestroyMenu ( ) ;
}
*/
return true ;
}
void CFUBoxLog : : OnSize ( UINT nType , int cx , int cy )
{
CDialog : : OnSize ( nType , cx , cy ) ;
if ( m_bInit )
{
CRect rect ;
m_S_S1 . GetWindowRect ( & rect ) ;
this - > m_wndList . MoveWindow ( 0 , 0 + rect . Height ( ) + 12 , cx , cy - rect . Height ( ) - 12 ) ;
}
}
long CFUBoxLog : : GetStatusText ( long lStatus , TCHAR * pStatus )
{
_tcscpy ( pStatus , _T ( " δ֪ " ) ) ;
long lIcon = 0 ;
switch ( lStatus )
{
case 0 :
_tcscpy ( pStatus , _T ( " δ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 0 ;
break ;
case 1 :
_tcscpy ( pStatus , _T ( " <EFBFBD> ѽ<EFBFBD> " ) ) ;
lIcon = 1 ;
break ;
}
return lIcon ;
}
void CFUBoxLog : : OnRclickSmslogList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
ShowRMenu ( ) ;
}
void CFUBoxLog : : ShowRMenu ( )
{
CMenu menu ;
menu . CreatePopupMenu ( ) ;
BOOL bLock = false ;
long lItem = this - > GetCurrentSelected ( ) ;
if ( lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_LOG_SEE , _T ( " <20> <> <20> <> " ) ) ;
//menu.AppendMenu(MF_STRING , MENU_LOG_SEND, _T(" <20> ٴη<D9B4> <CEB7> <EFBFBD> ") );
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_LOG_SEE , _T ( " <20> <> <20> <> " ) ) ;
//menu.AppendMenu(MF_STRING|MF_DISABLED|MF_GRAYED , MENU_LOG_SEND, _T(" <20> ٴη<D9B4> <CEB7> <EFBFBD> ") );
}
if ( lItem > = 0 & & m_pMainFrame - > m_ulPurviewType = = PURVIEWTYPE_ADMIN & & m_pMainFrame - > GetUserPurview ( PURVIEW_USER_MANAGER , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_LOG_DEL , _T ( " ɾ <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_LOG_DEL , _T ( " ɾ <20> <> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_LOG_PLAY , _T ( " <20> <> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> ... " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_LOG_PLAY , _T ( " <20> <> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> ... " ) ) ;
}
/*
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> <EFBFBD>
menu . AppendMenu ( MF_STRING , MENU_LOG_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
*/
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
POINT pt ;
: : GetCursorPos ( & pt ) ;
//this->ClientToScreen( &pt);
menu . TrackPopupMenu ( TPM_LEFTBUTTON | TPM_RIGHTBUTTON , pt . x , pt . y , this , NULL ) ;
menu . DestroyMenu ( ) ;
}
long CFUBoxLog : : GetCurrentSelected ( )
{
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
if ( pos )
{
return m_wndList . GetNextSelectedItem ( pos ) ;
}
return - 1 ;
}
void CFUBoxLog : : On_User_Play ( )
{
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
POSITION pos = ( POSITION ) m_wndList . GetItemData ( lItem ) ;
POSITION pos2 = pos ;
ANS_UBox_CallLog * pData = m_CallLog . GetNext ( pos ) ;
if ( pData )
{
CString strFileName ;
strFileName . Format ( _T ( " %s \\ %d.mp3 " ) , this - > m_strRecordPath , pData - > lUBoxLogID ) ;
WIN32_FILE_ATTRIBUTE_DATA filedata = { 0 } ;
GetFileAttributesEx ( strFileName , GetFileExInfoStandard , & filedata ) ;
if ( filedata . nFileSizeLow > 0 & & pData - > lUserID = = m_pMainFrame - > m_lUserID ) //<2F> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> ֻ<EFBFBD> <D6BB> Ҫ<EFBFBD> <D2AA> <EFBFBD> ļ<EFBFBD> <C4BC> Ϳ <EFBFBD> <CDBF> Բ<EFBFBD> <D4B2> <EFBFBD>
{
//ֱ<> Ӳ<EFBFBD> <D3B2> <EFBFBD>
ShellExecute ( NULL , _T ( " open " ) , strFileName , NULL , m_strRecordPath , SW_SHOWNORMAL ) ;
return ;
}
if ( filedata . nFileSizeLow > 0 & & filedata . nFileSizeLow = = pData - > lRecordSize ) //¼<> <C2BC> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> ͬ
{
//ֱ<> Ӳ<EFBFBD> <D3B2> <EFBFBD>
ShellExecute ( NULL , _T ( " open " ) , strFileName , NULL , m_strRecordPath , SW_SHOWNORMAL ) ;
return ;
}
/*
if ( _taccess ( strFileName , 4 ) ! = - 1 ) //<2F> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> Ȩ<EFBFBD> <C8A8>
{
//ֱ<> Ӳ<EFBFBD> <D3B2> <EFBFBD>
ShellExecute ( NULL , _T ( " open " ) , strFileName , NULL , m_strRecordPath , SW_SHOWNORMAL ) ;
}
*/
//<2F> жϴ˼<CFB4> ¼<EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> ļ<EFBFBD>
if ( pData - > lRecordSize > 0 & & pData - > lRecordSize = = pData - > lRecordUpSize )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ӷ<F3A3ACB4> <D3B7> <EFBFBD> <EFBFBD> <EFBFBD> ȡ
REQ_UBox_Record_Down * pDown = new REQ_UBox_Record_Down ;
memset ( pDown , 0 , sizeof ( REQ_UBox_Record_Down ) ) ;
pDown - > lCorpID = m_pMainFrame - > m_lCorpID ;
pDown - > lUserID = m_pMainFrame - > m_lUserID ;
pDown - > lUBoxLogID = pData - > lUBoxLogID ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_RECORD_DOWN , ( BYTE * ) pDown , sizeof ( REQ_UBox_Record_Down ) ) ;
return ;
}
else
{
//û<> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD>
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> <EFBFBD> <EFBFBD> <EFBFBD> ԣ<EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> ʾ " ) , MB_ICONWARNING ) ;
return ;
}
}
return ;
}
void CFUBoxLog : : On_User_See ( )
{
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
POSITION pos = ( POSITION ) m_wndList . GetItemData ( lItem ) ;
POSITION pos2 = pos ;
ANS_UBox_CallLog * pData = m_CallLog . GetNext ( pos ) ;
if ( pData )
{
DLG_UBoxLog_See dlg ( this ) ;
BOOL bModify = false ;
if ( pData - > lCorpID = = m_pMainFrame - > m_lCorpID & &
pData - > lUserID = = m_pMainFrame - > m_lUserID )
{
bModify = true ;
}
dlg . SetParam ( * pData , bModify ) ;
dlg . SetCallType ( m_CallType ) ;
if ( dlg . DoModal ( ) = = IDOK & & bModify )
{
REQ_UBox_UpLoad2 * pUpload = new REQ_UBox_UpLoad2 ;
memset ( pUpload , 0 , sizeof ( REQ_UBox_UpLoad2 ) ) ;
pUpload - > lItem = lItem ;
pUpload - > callLog = dlg . GetParam ( ) ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_UPLOAD2 , ( BYTE * ) pUpload , sizeof ( REQ_UBox_UpLoad2 ) ) ;
}
}
}
void CFUBoxLog : : On_User_Send ( )
{
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
/*
if ( m_pMainFrame - > m_pFuncView - > On_User_List_Add ( ) ) //<2F> ½<EFBFBD> <C2BD> б <EFBFBD>
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pMainFrame - > m_pFuncView - > m_DLGSend . List_SetMsg ( _T ( " \" %Memo% \" " ) ) ;
//<2F> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD>
long lCount = m_wndList . GetSelectedCount ( ) ;
if ( lCount < = 0 )
return ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
long lSize = sizeof ( Send_User ) * lCount ;
BYTE * pS = new BYTE [ lSize ] ;
memset ( pS , 0 , lSize ) ;
Send_User * pUser = ( Send_User * ) pS ;
TCHAR szSelect [ 128 ] = { 0 } ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
while ( pos )
{
long lItem = m_wndList . GetNextSelectedItem ( pos ) ;
long lSendID = m_wndList . GetItemData ( lItem ) ;
if ( lSendID > 0 )
{
_stprintf ( szSelect , _T ( " select * from smslog where SendID=%d " ) , lSendID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " Recver " ) , pUser - > szName ) ;
m_AdoRS . GetCollect ( _T ( " RecvNum " ) , pUser - > szMobile ) ;
m_AdoRS . GetCollect ( _T ( " Msg " ) , pUser - > szBZ ) ;
}
}
else
{
m_wndList . GetItemText ( lItem , 3 , pUser - > szMobile , sizeof ( pUser - > szMobile ) ) ;
m_wndList . GetItemText ( lItem , 4 , pUser - > szBZ , sizeof ( pUser - > szBZ ) ) ;
}
pUser + + ;
}
m_pMainFrame - > m_pFuncView - > On_User_List_AddUser ( lCount , ( Send_User * ) pS ) ;
delete pS ;
}
*/
}
void CFUBoxLog : : On_User_Del ( )
{
if ( m_pMainFrame - > m_ulPurviewType ! = PURVIEWTYPE_ADMIN | | ! m_pMainFrame - > GetUserPurview ( PURVIEW_USER_MANAGER , false ) )
{
return ;
}
long lRet = 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> <EFBFBD> Ƿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNOCANCEL | MB_DEFBUTTON2 ) ;
if ( lRet ! = IDYES )
return ;
long lCount = m_wndList . GetSelectedCount ( ) ;
long lSize = sizeof ( REQ_UBox_LogDel ) + sizeof ( ANS_UBox_LogDelData ) * lCount ;
BYTE * pDelSend = new BYTE [ lSize ] ; memset ( pDelSend , 0 , lSize ) ;
REQ_UBox_LogDel * pDel = ( REQ_UBox_LogDel * ) pDelSend ; //ͷ
ANS_UBox_LogDelData * pDelData = ( ANS_UBox_LogDelData * ) ( pDelSend + sizeof ( REQ_UBox_LogDel ) ) ;
pDel - > lCount = lCount ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
ANS_UBox_CallLog * pTD2Data ;
POSITION pos2 ;
while ( pos )
{
pDelData - > lItem = m_wndList . GetNextSelectedItem ( pos ) ;
pos2 = ( POSITION ) m_wndList . GetItemData ( pDelData - > lItem ) ;
pTD2Data = m_CallLog . GetNext ( pos2 ) ; //ȡ<> <C8A1> <EFBFBD> б <EFBFBD> <D0B1> е <EFBFBD> pos
pDelData - > lUBoxLogID = pTD2Data - > lUBoxLogID ;
pDelData + + ;
}
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_LOGDEL , pDelSend , lSize ) ;
}
void CFUBoxLog : : On_User_Export ( )
{
// this->m_pMainFrame->m_ubox_send_dtmf(m_pMainFrame->m_ubox_endHandle,_T("913922455188"));
CString strFileName ; //ȡ<> ļ<EFBFBD> <C4BC> <EFBFBD>
# define FILE_FILTER_TEXT \
TEXT ( " Excel <20> ļ<EFBFBD> (*.xls,*.xlsx) \0 *.xls \0 *.xlsx \0 " ) \
TEXT ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.*)\0 *.*; \0 \0 " )
TCHAR szFile [ 256 ] = { 0 } ;
TCHAR szFileB [ 256 ] = { 0 } ;
* szFileB = NULL ;
_stprintf ( szFile , _T ( " <EFBFBD> 绰<EFBFBD> <EFBFBD> ¼.xls" ) ) ;
OPENFILENAME sOpen ;
sOpen . lStructSize = sizeof ( sOpen ) ;
sOpen . hwndOwner = this - > m_hWnd ;
sOpen . Flags = OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY ;
sOpen . lpstrFilter = FILE_FILTER_TEXT ;
sOpen . lpstrDefExt = _T ( " *.xls " ) ;
sOpen . lpstrCustomFilter = NULL ;
sOpen . nMaxCustFilter = 0 ;
sOpen . lpstrFile = szFile ;
sOpen . nMaxFile = sizeof ( szFile ) ;
sOpen . lpstrFileTitle = szFileB ;
sOpen . nMaxFileTitle = sizeof ( szFileB ) ;
sOpen . lpstrInitialDir = NULL ;
sOpen . lpstrTitle = _T ( " ѡ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> " ) ;
if ( : : GetSaveFileName ( & sOpen ) )
{
strFileName = sOpen . lpstrFile ;
}
else
{
return ;
}
long lCount = m_wndList . SaveToExcel ( strFileName , _T ( " <EFBFBD> 绰<EFBFBD> <EFBFBD> ¼" ) ) ;
CString str ;
str . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> ɹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> %d\r \n <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> :%s" ) , lCount , strFileName ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> Ϣ" ) , MB_ICONINFORMATION ) ;
/*
//<2F> <> <EFBFBD> <EFBFBD> Ҫ״̬<D7B4> Ķ<EFBFBD> <C4B6> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> ء<EFBFBD> <D8A1> <EFBFBD> <EFBFBD> ͳɹ<CDB3> <C9B9> <EFBFBD> <EFBFBD> <EFBFBD>
BOOL bNoStatus = m_pMainFrame - > m_Setup . bSDK & SDK_NOSTATUS ? true : false ;
DLG_SMSLog_Export dlg ( this ) ;
dlg . SetParam ( & m_AdoRS , & m_wndList , bNoStatus ) ;
dlg . DoModal ( ) ;
*/
}
void CFUBoxLog : : On_User_Refresh ( )
{
RefreshInfo ( ) ;
}
void CFUBoxLog : : On_User_QueryFail ( )
{
/*
DLG_Find_Fail dlg ( this ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
m_wndList . ShowWindow ( SW_HIDE ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
m_wndList . DeleteAllItems ( ) ;
m_wndList . ShowWindow ( SW_SHOW ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
REQ_List * pList = new REQ_List ;
memset ( pList , 0 , sizeof ( REQ_List ) ) ;
_tcscpy ( pList - > szMobile , _T ( " FAIL " ) ) ;
dlg . m_tQBegin . GetAsSystemTime ( pList - > tBegin ) ;
dlg . m_tQEnd . GetAsSystemTime ( pList - > tEnd ) ;
pList - > lCorpID = m_pMainFrame - > m_lCorpID ;
pList - > lMobileType = - 1 ;
pList - > lMsgType = - 1 ;
pList - > lMsgType = - 1 ;
pList - > bJF = false ;
m_pMainFrame - > SendFrame ( SMSFUNC_LIST , ( BYTE * ) pList , sizeof ( REQ_List ) ) ;
}
*/
}
void CFUBoxLog : : On_User_Find ( )
{
CString strTemp ;
DLG_Find_UBoxLog dlg ( this ) ;
dlg . SetParam ( ! m_bShowToday ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
m_strFindAdd = _T ( " " ) ;
if ( ! m_bShowToday )
{
strTemp . Format ( _T ( " AND CallTime>=#%04d-%02d-%02d# AND CallTime<=#%04d-%02d-%02d 23:59:59# " ) , dlg . m_tBegin . GetYear ( ) , dlg . m_tBegin . GetMonth ( ) , dlg . m_tBegin . GetDay ( ) , dlg . m_tEnd . GetYear ( ) , dlg . m_tEnd . GetMonth ( ) , dlg . m_tEnd . GetDay ( ) ) ;
m_strFindAdd = strTemp ;
}
if ( dlg . m_lStatus > 0 )
{
strTemp . Format ( _T ( " AND Status=%d " ) , dlg . m_lStatus - 1 ) ;
m_strFindAdd + = strTemp ;
}
if ( dlg . m_strCallNum . GetLength ( ) > 0 )
{
strTemp . Format ( _T ( " AND CallNum like '%%%s%%' " ) , dlg . m_strCallNum ) ;
m_strFindAdd + = strTemp ;
}
if ( dlg . m_strYWYMobile . GetLength ( ) > 0 )
{
strTemp . Format ( _T ( " select * from gaddress where Mobile='%s' " ) , dlg . m_strYWYMobile ) ;
if ( m_AdoRS . Open ( strTemp ) & & ! m_AdoRS . IsEOF ( ) )
{
long lUserID = 0 ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , lUserID ) ;
strTemp . Format ( _T ( " AND YWYAddID=%d " ) , lUserID ) ;
m_strFindAdd + = strTemp ;
}
else
{
strTemp . Format ( _T ( " AND 1<>1 " ) ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> <EFBFBD> <EFBFBD> 벻<EFBFBD> ԣ<EFBFBD> ʲôҲ<C3B4> 鲻<EFBFBD> <E9B2BB>
m_strFindAdd + = strTemp ;
}
}
On_User_Refresh ( ) ;
m_strFindAdd = _T ( " " ) ; //ˢ<> º<C2BA> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD>
}
}
void CFUBoxLog : : On_User_Bak ( )
{
USES_CONVERSION ;
/*
long lCount = m_wndList . GetSelectedCount ( ) ;
DLG_BAK dlg ( this ) ;
dlg . SetParam ( lCount ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
TCHAR szPath [ 512 ] = { 0 } ;
TCHAR szBakPath [ 64 ] = { 0 } ;
TCHAR szOldDB [ 512 ] = { 0 } ;
TCHAR szNewDB [ 512 ] = { 0 } ;
this - > m_pMainFrame - > GetCurrentPath ( szPath ) ;
_stprintf ( szOldDB , _T ( " %s%s " ) , szPath , ACCESS_SOURCE ) ;
_stprintf ( szBakPath , _T ( " Bak_%d_%s " ) , m_pMainFrame - > m_lCorpID , m_pMainFrame - > m_pCurUser - > szUser ) ;
_tcscat ( szPath , szBakPath ) ;
: : CreateDirectory ( szPath , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> ȴ<EFBFBD> <C8B4> <EFBFBD> <EFBFBD> <EFBFBD> ˵
_stprintf ( szNewDB , _T ( " %s \\ MmsLog_%s.bak " ) , szPath , dlg . m_strTitle ) ;
if ( ! CopyFile ( szOldDB , szNewDB , false ) ) //copy<70> ļ<EFBFBD> ʧ<EFBFBD> <CAA7>
{
MessageBox ( _T ( " ϵͳ<EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> ʧ1<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> °<EFBFBD> װ! " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µı <C2B5> <C4B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
CAdoConnection bakadoConnection ;
CAdoRecordSet bakAdoRS ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
char szPasswd [ 64 ] = { 0 } ; strcpy ( szPasswd , ACCESS_PASSWD ) ;
char szKey [ 64 ] = { 0 } ; strcpy ( szKey , ACCESS_KEY ) ;
char szNew2 [ 64 ] = { 0 } ; long lOut = sizeof ( szNew2 ) ;
TCHAR szNew [ 64 ] = { 0 } ;
CDes des ;
des . Decrypt ( szPasswd , strlen ( szPasswd ) , szNew2 , lOut , szKey , 8 ) ;
# ifdef UNICODE
_tcscpy ( szNew , A2W ( szNew2 ) ) ;
# else
_tcscpy ( szNew , szNew2 ) ;
# endif
if ( ! bakadoConnection . ConnectAccess ( szNewDB , szNew ) ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> Ҫ<EFBFBD> <D2AA> <EFBFBD> ´ <EFBFBD> <C2B4> <EFBFBD>
{
MessageBox ( _T ( " ϵͳ<EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> ʧ2<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> °<EFBFBD> װ! " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
bakAdoRS . SetAdoConnection ( & bakadoConnection ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! bakAdoRS . Open ( _T ( " smslog " ) , adCmdTable ) )
{
MessageBox ( _T ( " ϵͳ<EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> ʧ3<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> °<EFBFBD> װ! " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
long * lDel = new long [ lCount + 2 ] ;
int lDelCount = 0 ;
TCHAR szSelect [ 256 ] = { 0 } ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
while ( pos )
{
long lItem = m_wndList . GetNextSelectedItem ( pos ) ;
long lSendID = m_wndList . GetItemData ( lItem ) ;
lDel [ lDelCount ] = lItem ;
if ( lSendID > 0 )
{
_stprintf ( szSelect , _T ( " select * from smslog where SendID=%d " ) , lSendID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
CAdoMmsLog adoSms ;
m_AdoRS . RecordBinding ( adoSms ) ;
m_AdoRS . MoveFirst ( ) ;
//<2F> <> <EFBFBD> 뵽<EFBFBD> <EBB5BD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD>
BOOL b = bakAdoRS . RecordBinding ( adoSms ) ;
b = bakAdoRS . AddNew ( adoSms ) ;
b = bakAdoRS . Update ( ) ;
}
}
lDelCount + + ;
}
//<2F> <> תɾ<D7AA> <C9BE>
m_wndList . ShowWindow ( SW_HIDE ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ٶ<EFBFBD>
for ( int i = lDelCount - 1 ; i > = 0 ; i - - )
{
long lSendID = m_wndList . GetItemData ( lDel [ i ] ) ;
_stprintf ( szSelect , _T ( " delete from smslog where SendID=%d " ) , lSendID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_wndList . DeleteItem ( lDel [ i ] ) ; //<2F> <> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> ɾ<EFBFBD> <C9BE>
}
}
m_wndList . ShowWindow ( SW_SHOW ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ٶ<EFBFBD>
delete lDel ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CString strName ;
strName . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> _%s" ) , dlg . m_strTitle ) ;
m_pMainFrame - > m_pFuncView - > AddBak_MmsLog ( strName ) ;
}
*/
}
void CFUBoxLog : : On_User_RefStatus ( )
{
RefreshStatus ( ) ;
}
void CFUBoxLog : : On_User_Refresh_All ( )
{
m_bShowAllRecord = true ;
On_User_Refresh ( ) ;
}
void CFUBoxLog : : RefreshStatus ( BOOL bBegin )
{
return ;
BOOL bNoStatus = m_pMainFrame - > m_Setup . bSDK & SDK_NOSTATUS ? true : false ;
if ( bNoStatus ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ״̬<D7B4> <CCAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˢ<EFBFBD> <CBA2> ״̬
return ;
//<2F> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬Ϊδ<CEAA> ̶<EFBFBD> <CCB6> Ķ<EFBFBD> <C4B6> <EFBFBD>
long lCount = m_wndList . GetItemCount ( ) ;
long * pSendID = new long [ STATUS_MAX_QUERY * 3 + 100 ] ;
long lCount2 = 0 ;
if ( bBegin )
m_lRefreshStatusIndex = 0 ;
else
m_lRefreshStatusIndex + + ;
for ( int i = m_lRefreshStatusIndex * STATUS_MAX_QUERY ; i < lCount ; i + + ) //ÿ<> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѯ1000<30> <30> <EFBFBD> <EFBFBD> ¼
{
long lStatus = GetItemStatus ( i ) ;
# ifdef STATUS_ENABLE_RECV
if ( lStatus = = SEND_STATUS_SUB_OK | | //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֣<EFBFBD> <D6A3> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ȡ״̬
lStatus = = SEND_STATUS_SUB_FILT | |
lStatus = = SEND_STATUS_SEND_OK | |
lStatus = = SEND_STATUS_SEND_ERROR )
# else
if ( lStatus = = SEND_STATUS_SUB_OK | | //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֣<EFBFBD> <D6A3> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ȡ״̬
lStatus = = SEND_STATUS_SUB_FILT | |
lStatus = = SEND_STATUS_SEND_OK | |
lStatus = = SEND_STATUS_SEND_ERROR )
# endif
{
pSendID [ lCount2 ] = i ;
lCount2 + + ;
pSendID [ lCount2 ] = m_wndList . GetItemData ( i ) ; //ȡ<> <C8A1> SendID
lCount2 + + ;
pSendID [ lCount2 ] = lStatus ;
lCount2 + + ;
}
if ( lCount2 > = STATUS_MAX_QUERY * 3 ) //<2F> <> <EFBFBD> <EFBFBD> 1000<30> <30> <EFBFBD> <EFBFBD>
break ;
}
lCount = lCount2 / 3 ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> Ҫȡ״̬<D7B4> ĸ<EFBFBD> <C4B8> <EFBFBD>
if ( lCount > 0 )
{
long lSize = sizeof ( REQ_MmsStatus ) + sizeof ( ANS_MmsStatus_Data2 ) * lCount ;
BYTE * pData = new BYTE [ lSize ] ; memset ( pData , 0 , lSize ) ;
REQ_MmsStatus * pStatus = ( REQ_MmsStatus * ) pData ;
ANS_MmsStatus_Data2 * pStatusData = ( ANS_MmsStatus_Data2 * ) ( pData + sizeof ( REQ_MmsStatus ) ) ;
pStatus - > lCorpID = m_pMainFrame - > m_lCorpID ;
pStatus - > lCount = lCount ;
for ( i = 0 ; i < lCount ; i + + )
{
pStatusData - > lItemID = pSendID [ i * 3 ] ;
pStatusData - > lSendID = pSendID [ i * 3 + 1 ] ;
pStatusData - > lStatus = pSendID [ i * 3 + 2 ] ;
pStatusData + + ;
}
m_pMainFrame - > SendFrame ( SMSFUNC_MMSSTATUS , pData , lSize ) ;
}
delete pSendID ;
}
long CFUBoxLog : : GetItemStatus ( long iItem )
{
TCHAR szStatus [ 16 ] = { 0 } ;
TCHAR szTime [ 32 ] = { 0 } ;
m_wndList . GetItemText ( iItem , 1 , szStatus , sizeof ( szStatus ) ) ;
m_wndList . GetItemText ( iItem , 4 , szTime , sizeof ( szTime ) ) ;
szTime [ 4 ] = 0 ;
szTime [ 7 ] = 0 ;
szTime [ 10 ] = 0 ;
long lYear = _ttol ( szTime ) ;
long lMon = _ttol ( szTime + 5 ) ;
long lDay = _ttol ( szTime + 8 ) ;
CTime t1 ( lYear , lMon , lDay , 0 , 0 , 0 ) ;
CTime t2 = CTime : : GetCurrentTime ( ) ;
CTime t3 = t1 + CTimeSpan ( 10 , 0 , 0 , 0 ) ;
if ( t3 < t2 ) //2<> <32> ǰ<EFBFBD> <C7B0> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
return SEND_STATUS_UNKNOW ;
}
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> ύ<EFBFBD> ɹ<EFBFBD> " ) ) )
return SEND_STATUS_SUB_OK ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) )
return SEND_STATUS_SUB_FILT ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> ύʧ<EFBFBD> <EFBFBD> " ) ) )
return SEND_STATUS_SUB_ERROR ;
if ( ! _tcscmp ( szStatus , _T ( " Ŀ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) )
return SEND_STATUS_SUB_NUMNOSUP ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) )
return SEND_STATUS_FILT_ERROR ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ͳɹ<EFBFBD> " ) ) )
return SEND_STATUS_SEND_OK ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) )
return SEND_STATUS_SEND_ERROR ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ճɹ<EFBFBD> " ) ) )
return SEND_STATUS_RECV_OK ;
if ( ! _tcscmp ( szStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) )
return SEND_STATUS_RECV_ERROR ;
// if ( !_tcscmp( szStatus , _T("δ֪״̬") ) )
return SEND_STATUS_UNKNOW ;
}
BOOL CFUBoxLog : : ProcessSocket ( Socket_Head_Add * pHead , BYTE * pFrame )
{
CString str ;
if ( pHead - > lFuncType = = SMSFUNC_UBOX_GETTYPE )
{
m_bRefresh = true ; //<2F> Ѿ<EFBFBD> ˢ<EFBFBD> ¹<EFBFBD>
ANS_UBox_GetType * pStatus = ( ANS_UBox_GetType * ) pFrame ;
ANS_UBox_GetTypeData * pData = ( ANS_UBox_GetTypeData * ) ( pFrame + sizeof ( ANS_UBox_GetType ) ) ;
m_L_Type . ResetContent ( ) ;
m_CallType . RemoveAll ( ) ;
for ( int i = 0 ; i < pStatus - > lCount ; i + + )
{
m_L_Type . AddString ( pData [ i ] . szType ) ;
m_CallType . Add ( pData [ i ] ) ;
}
return true ;
}
//<2F> Ĺ<DEB8> <C4B9> õ<EFBFBD> ַ<EFBFBD> <D6B7>
if ( pHead - > lFuncType = = SMSFUNC_UBOX_GETLOG )
{
ANS_UBox_GetLog * pStatus = ( ANS_UBox_GetLog * ) pFrame ;
ANS_UBox_CallLog * pData = ( ANS_UBox_CallLog * ) ( pFrame + sizeof ( ANS_UBox_GetLog ) ) ;
m_wndList . ShowWindow ( SW_HIDE ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
//m_wndList.DeleteAllItems(); //ɾ<> <C9BE> ԭ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD>
//this->Close_CallLog();
for ( int i = 0 ; i < pStatus - > lCount ; i + + )
{
ANS_UBox_CallLog * pNewData = new ANS_UBox_CallLog ;
* pNewData = * pData ;
POSITION pos = m_CallLog . AddTail ( pNewData ) ;
m_lTotalSC = m_lTotalSC + pData - > lCallSC ;
ShowInList ( pNewData , - 1 , pos ) ;
pData + + ;
}
m_wndList . ShowWindow ( SW_SHOW ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
COleDateTimeSpan span ( 0 , 0 , 0 , m_lTotalSC ) ;
if ( span . GetDays ( ) > 0 )
str . Format ( _T ( " <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> :%d<> <64> %0d:%02d:%02d" ) , span . GetDays ( ) , span . GetHours ( ) , span . GetMinutes ( ) , span . GetSeconds ( ) ) ;
else
str . Format ( _T ( " <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> :%0d:%02d:%02d" ) , span . GetHours ( ) , span . GetMinutes ( ) , span . GetSeconds ( ) ) ;
m_S_SC . SetWindowText ( str ) ;
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_UBOX_UPLOAD2 )
{
ANS_UBox_UpLoad2 * pUpload = ( ANS_UBox_UpLoad2 * ) pFrame ;
if ( pUpload - > lUploadStatus > = 0 )
{
POSITION pos = ( POSITION ) m_wndList . GetItemData ( pUpload - > lItem ) ;
if ( pos )
{
ANS_UBox_CallLog * pData = m_CallLog . GetNext ( pos ) ;
if ( pData )
{
if ( pData - > lUBoxLogID = = pUpload - > req . callLog . lUBoxLogID )
{
_tcscpy ( pData - > szCallType , pUpload - > req . callLog . szCallType ) ;
_tcscpy ( pData - > szCallBZ , pUpload - > req . callLog . szCallBZ ) ;
m_wndList . SetItemText ( pUpload - > lItem , 10 , pUpload - > req . callLog . szCallType ) ;
m_wndList . SetItemText ( pUpload - > lItem , 11 , pUpload - > req . callLog . szCallBZ ) ;
}
}
}
}
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_UBOX_LOGDEL )
{
ANS_UBox_LogDel * pDel = ( ANS_UBox_LogDel * ) pFrame ;
ANS_UBox_LogDelData * pDelData = ( ANS_UBox_LogDelData * ) ( pFrame + sizeof ( ANS_UBox_LogDel ) ) ;
POSITION pos , pos2 ;
ANS_UBox_CallLog * pTD2Data ;
for ( int i = pDel - > lCount - 1 ; i > = 0 ; i - - )
{
if ( pDelData [ i ] . lUBoxLogID ) //ɾ<> <C9BE> <EFBFBD> ɹ<EFBFBD>
{
pos = ( POSITION ) m_wndList . GetItemData ( pDelData [ i ] . lItem ) ;
pos2 = pos ;
pTD2Data = m_CallLog . GetNext ( pos ) ;
if ( pTD2Data - > lUBoxLogID = = pDelData [ i ] . lUBoxLogID ) //ID<49> <44> ͬ<EFBFBD> IJſ <C4B2> ɾ<EFBFBD> <C9BE>
{
delete pTD2Data ; //<2F> <> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_CallLog . RemoveAt ( pos2 ) ; //<2F> <> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> ɾ<EFBFBD> <C9BE>
m_wndList . DeleteItem ( pDelData [ i ] . lItem ) ; //<2F> <> ListCtrl<72> <6C> ɾ<EFBFBD> <C9BE>
}
}
}
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_UBOX_RECORD_DOWN )
{
ANS_UBox_Record_Down * pDown = ( ANS_UBox_Record_Down * ) pFrame ;
BYTE * pFileData = ( BYTE * ) ( pFrame + sizeof ( ANS_UBox_Record_Down ) ) ;
if ( pDown - > lStatus = = 1 ) //<2F> <> <EFBFBD> سɹ<D8B3> <C9B9> <EFBFBD>
{
CString strFileName ;
strFileName . Format ( _T ( " %s \\ %d.mp3 " ) , this - > m_strRecordPath , pDown - > lUBoxLogID ) ;
CFile file ;
BOOL bFile = false ;
if ( pDown - > lDownSize = = pDown - > lSize ) //<2F> <> һ ֡
{
bFile = file . Open ( strFileName , CFile : : modeReadWrite | CFile : : modeCreate ) ;
}
else
{
bFile = file . Open ( strFileName , CFile : : modeReadWrite ) ;
}
if ( bFile )
{
file . SeekToEnd ( ) ;
file . Write ( pFileData , pDown - > lSize ) ;
file . Close ( ) ;
}
if ( pDown - > lDownSize = = pDown - > lAllSize )
{
//<2F> <> <EFBFBD> <EFBFBD>
//ֱ<> Ӳ<EFBFBD> <D3B2> <EFBFBD>
ShellExecute ( NULL , _T ( " open " ) , strFileName , NULL , m_strRecordPath , SW_SHOWNORMAL ) ;
}
}
return true ;
}
return false ;
}
UBox_Item CFUBoxLog : : GetUBoxItem ( long lItem , BOOL bID )
{
UBox_Item ubox = { 0 } ;
long lUBoxID = lItem ;
if ( ! bID )
lUBoxID = m_wndList . GetItemData ( lItem ) ;
CString strSelect ;
strSelect . Format ( _T ( " select * from ( uboxlog left join paddress on uboxlog.khaddid = paddress.userid ) left join gaddress on uboxlog.ywyaddid=gaddress.userid where uboxid=%d order by CallTime desc " ) , lUBoxID ) ;
if ( m_AdoRS . Open ( strSelect ) & & m_AdoRS . GetRecordCount ( ) )
{
COleDateTime t ;
m_AdoRS . GetCollect ( _T ( " UBoxID " ) , ubox . lUBoxID ) ;
m_AdoRS . GetCollect ( _T ( " Status " ) , ubox . lStatus ) ;
m_AdoRS . GetCollect ( _T ( " CallNum " ) , ubox . szCallNum ) ;
m_AdoRS . GetCollect ( _T ( " CallTime " ) , t ) ; t . GetAsSystemTime ( ubox . tCallTime ) ;
m_AdoRS . GetCollect ( _T ( " KHAddID " ) , ubox . lKHAddID ) ;
m_AdoRS . GetCollect ( _T ( " YWYAddID " ) , ubox . lYWYAddID ) ;
m_AdoRS . GetCollect ( _T ( " SendSms " ) , ubox . szSendSms ) ;
m_AdoRS . GetCollect ( _T ( " uboxlog.BZ " ) , ubox . szBZ ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Name " ) , ubox . szKH_Name ) ;
m_AdoRS . GetCollect ( _T ( " paddress.LTD " ) , ubox . szKH_LTD ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Addr " ) , ubox . szKH_Addr ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Mobile " ) , ubox . szKH_Mobile ) ;
m_AdoRS . GetCollect ( _T ( " paddress.Tel " ) , ubox . szKH_Tel ) ;
m_AdoRS . GetCollect ( _T ( " gaddress.Name " ) , ubox . szYWY_Name ) ;
m_AdoRS . GetCollect ( _T ( " gaddress.Mobile " ) , ubox . szYWY_Mobile ) ;
m_AdoRS . GetCollect ( _T ( " gaddress.LTD " ) , ubox . szYWY_LTD ) ;
}
return ubox ;
}
void CFUBoxLog : : OnDblclkSmslogList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
On_User_See ( ) ;
}
void CFUBoxLog : : OnKeydownSmslogList ( NMHDR * pNMHDR , LRESULT * pResult )
{
LV_KEYDOWN * pLVKeyDow = ( LV_KEYDOWN * ) pNMHDR ;
* pResult = 0 ;
if ( pLVKeyDow - > wVKey = = VK_DELETE )
{
On_User_Del ( ) ;
}
if ( pLVKeyDow - > wVKey = = VK_SPACE )
{
On_User_See ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' A ' | | pLVKeyDow - > wVKey = = ' a ' )
{
m_wndList . SelectAllItems ( ) ;
}
}
long CFUBoxLog : : GetStatusText2 ( long lStatus , TCHAR * pStatus )
{
_tcscpy ( pStatus , _T ( " δ֪ " ) ) ;
long lIcon = 0 ;
switch ( lStatus )
{
case 0 :
_tcscpy ( pStatus , _T ( " δ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 0 ;
break ;
case 1 :
_tcscpy ( pStatus , _T ( " <EFBFBD> ѽ<EFBFBD> " ) ) ;
lIcon = 1 ;
break ;
}
return lIcon ;
}
void CFUBoxLog : : OnOK ( )
{
//CDialog::OnOK();
}
void CFUBoxLog : : OnCancel ( )
{
//CDialog::OnCancel();
}
void CFUBoxLog : : SetToday ( BOOL bToday )
{
if ( m_bShowToday ! = bToday )
{
m_bShowToday = bToday ;
m_bRefresh = false ;
}
}
void CFUBoxLog : : SetBakDBName ( CString strDBName )
{
m_strBakDBName = strDBName ;
m_bNewDB = true ;
}
void CFUBoxLog : : ShowUBox ( UBox_Item ubox , long iItem )
{
CString str ;
TCHAR szStatus [ 32 ] = { 0 } ;
long lIcon = GetStatusText ( ubox . lStatus , szStatus ) ;
m_wndList . SetIconIndex ( iItem , lIcon ) ;
long lTemp = 1 ;
m_wndList . SetItemText ( iItem , lTemp + + , szStatus ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szCallNum ) ;
str . Format ( _T ( " %04d.%02d.%02d %02d:%02d " ) , ubox . tCallTime . wYear , ubox . tCallTime . wMonth , ubox . tCallTime . wDay , ubox . tCallTime . wHour , ubox . tCallTime . wMinute ) ;
m_wndList . SetItemText ( iItem , lTemp + + , str ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szKH_Name ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szKH_LTD ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szKH_Addr ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szYWY_Name ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szYWY_Mobile ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szSendSms ) ;
m_wndList . SetItemText ( iItem , lTemp + + , ubox . szBZ ) ;
}
2025-04-11 17:19:25 +08:00
LONG_PTR CFUBoxLog : : UBox_Event ( WPARAM wParam , LPARAM lParam )
2025-02-27 16:58:16 +08:00
{
return 0 ;
}
BOOL CFUBoxLog : : Close ( )
{
/*
try
{
if ( this - > m_pUBoxLog_See )
{
m_pUBoxLog_See - > PostMessage ( WM_CLOSE ) ;
}
}
catch ( . . . )
{
}
*/
Close_CallLog ( ) ;
return true ;
}
void CFUBoxLog : : Close_CallLog ( )
{
try
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD>
while ( ! m_CallLog . IsEmpty ( ) )
{
ANS_UBox_CallLog * pData = m_CallLog . GetHead ( ) ;
m_CallLog . RemoveHead ( ) ;
delete pData ;
}
}
catch ( . . . )
{
}
}
void CFUBoxLog : : OnBnClickedUboxLogQuery ( )
{
UpdateData ( true ) ;
if ( m_tEnd < m_tBegin )
{
MessageBox ( _T ( " <EFBFBD> <EFBFBD> ѯ<EFBFBD> <EFBFBD> ʼ ʱ<EFBFBD> 䲻<EFBFBD> ܴ<EFBFBD> <EFBFBD> ڽ<EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> 䣡" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
GetDlgItem ( IDC_UBOX_LOG_BEGIN ) - > SetFocus ( ) ;
return ;
}
REQ_UBox_GetLog * pGetLog = new REQ_UBox_GetLog ;
memset ( pGetLog , 0 , sizeof ( REQ_UBox_GetLog ) ) ;
pGetLog - > lCorpID = m_pMainFrame - > m_lCorpID ; //<2F> <> ҵID
pGetLog - > lUserID = m_lUserID ; //<2F> <> ѯ<EFBFBD> û<EFBFBD> ID
m_tBegin . GetAsSystemTime ( pGetLog - > tBegin ) ;
m_tEnd . GetAsSystemTime ( pGetLog - > tEnd ) ;
pGetLog - > lTagUserID = m_lUserID ;
pGetLog - > lWay = m_lCallWay ;
pGetLog - > lStatus = m_lStatus ;
_tcscpy ( pGetLog - > szType , m_strType ) ;
_tcscpy ( pGetLog - > szKey , m_strKey ) ;
m_wndList . ShowWindow ( SW_HIDE ) ;
m_wndList . DeleteAllItems ( ) ; //ɾ<> <C9BE> ԭ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD>
m_wndList . ShowWindow ( SW_SHOW ) ;
this - > Close_CallLog ( ) ;
m_S_SC . SetWindowText ( _T ( " <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> :00:00:00" ) ) ;
m_lTotalSC = 0 ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_GETLOG , ( BYTE * ) pGetLog , sizeof ( REQ_UBox_GetLog ) ) ;
}
void CFUBoxLog : : OnBnClickedUboxLog ( )
{
/*
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_SEEBILL , false ) )
{
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> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼!" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
*/
if ( m_pMainFrame - > m_ulPurviewType ! = PURVIEWTYPE_ADMIN | | ! m_pMainFrame - > GetUserPurview ( PURVIEW_USER_MANAGER , false ) )
{
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> <EFBFBD> û<EFBFBD> ͨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼!" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
DLG_UserSelect dlg ( this ) ;
dlg . SetParam ( this - > m_pMainFrame , _T ( " Users " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ա" ) , true ) ;
dlg . SetShowType ( 1 ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
UpdateData ( true ) ;
m_lUserID = dlg . GetParam ( m_strUser ) ;
UpdateData ( false ) ;
}
}
long CFUBoxLog : : GetCallLogIconIndex ( ANS_UBox_CallLog * pData )
{
long lIcon = 0 ;
if ( pData - > lCallWay = = 0 )
{
if ( pData - > lCallStatus = = 0 )
{
lIcon = 1 ;
}
else
{
lIcon = 0 ;
}
}
else
{
if ( pData - > lCallStatus = = 0 )
{
lIcon = 3 ;
}
else
{
lIcon = 2 ;
}
}
return lIcon ;
}
BOOL CFUBoxLog : : ShowInList ( ANS_UBox_CallLog * pData , long lItem2 , POSITION pos )
{
CString str ;
long lItem = lItem2 ;
if ( lItem < 0 ) //<2F> <> <EFBFBD> <EFBFBD>
{
lItem = m_wndList . GetItemCount ( ) ;
str . Format ( _T ( " %d " ) , lItem + 1 ) ;
m_wndList . InsertItem ( lItem , str , GetCallLogIconIndex ( pData ) ) ;
2025-04-11 17:19:25 +08:00
m_wndList . SetItemData ( lItem , ( DWORD_PTR ) pos ) ; //<2F> <> Pos
2025-02-27 16:58:16 +08:00
}
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,80;<3B> <> <EFBFBD> <EFBFBD> ,60;״̬,60;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,100;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,100;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,120;ͨ<> <CDA8> ʱ<EFBFBD> <CAB1> ,50;<3B> <> <EFBFBD> <EFBFBD> ,80;<3B> <> <EFBFBD> 絥λ,130;ͨ<> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,120;<3B> <> ע,200;"));
long lTemp11 = 1 ;
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szUserName ) ;
if ( pData - > lCallWay = = 0 )
m_wndList . SetItemText ( lItem , lTemp11 + + , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
else
m_wndList . SetItemText ( lItem , lTemp11 + + , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
if ( pData - > lCallStatus = = 0 )
m_wndList . SetItemText ( lItem , lTemp11 + + , _T ( " δ<EFBFBD> <EFBFBD> " ) ) ;
else
m_wndList . SetItemText ( lItem , lTemp11 + + , _T ( " <EFBFBD> ѽ<EFBFBD> " ) ) ;
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szCallNumber ) ;
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szCallLocal ) ;
str . Format ( _T ( " %04d.%02d.%02d %02d:%02d " ) , pData - > tCallTime . wYear , pData - > tCallTime . wMonth , pData - > tCallTime . wDay , pData - > tCallTime . wHour , pData - > tCallTime . wMinute ) ;
m_wndList . SetItemText ( lItem , lTemp11 + + , str ) ; //ͨ<> <CDA8> ʱ<EFBFBD> <CAB1>
COleDateTimeSpan span ( 0 , 0 , 0 , pData - > lCallSC ) ;
str . Format ( _T ( " %02d:%02d:%02d " ) , span . GetHours ( ) , span . GetMinutes ( ) , span . GetSeconds ( ) ) ;
m_wndList . SetItemText ( lItem , lTemp11 + + , str ) ; //ʱ<> <CAB1>
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szKHName ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szKHLTD ) ; //<2F> <> λ
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szCallType ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lItem , lTemp11 + + , pData - > szCallBZ ) ; //<2F> <> ע
return true ;
}
void CFUBoxLog : : OnDestroy ( )
{
CDialog : : OnDestroy ( ) ;
Close ( ) ;
}