2025-02-27 16:58:16 +08:00
// FFaxLog.cpp : implementation file
//
# include "stdafx.h"
# include "corpsms.h"
# include "FFaxLog.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CFFaxLog dialog
# include "MainFrm.h"
# include "ProcessSocket.h"
# include "DLG_BAK.h"
//#include "DLG_Find_Fail.h"
//#include "DLG_Find_FaxLog.h"
//#include "DLG_SMSLog_Export.h"
CFFaxLog : : CFFaxLog ( CWnd * pParent /*=NULL*/ )
: CDialog ( CFFaxLog : : IDD , pParent )
{
//{{AFX_DATA_INIT(CFFaxLog)
// 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 ;
}
void CFFaxLog : : DoDataExchange ( CDataExchange * pDX )
{
CDialog : : DoDataExchange ( pDX ) ;
//{{AFX_DATA_MAP(CFFaxLog)
DDX_Control ( pDX , IDC_FAXLOG_LIST , m_wndList ) ;
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP ( CFFaxLog , CDialog )
//{{AFX_MSG_MAP(CFFaxLog)
ON_WM_SIZE ( )
ON_NOTIFY ( NM_RCLICK , IDC_FAXLOG_LIST , OnRclickSmslogList )
ON_NOTIFY ( NM_DBLCLK , IDC_FAXLOG_LIST , OnDblclkSmslogList )
ON_NOTIFY ( LVN_KEYDOWN , IDC_FAXLOG_LIST , OnKeydownSmslogList )
//}}AFX_MSG_MAP
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 )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CFFaxLog message handlers
BOOL CFFaxLog : : 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_SMSDF ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_SMSYF ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_SMSJS ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_SMSSB ) ) ;
m_wndList . SubClassWindow2 ( ) ;
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; ״̬,70;״̬˵<CCAC> <CBB5> ,180;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ,70;<3B> <> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ,100;<3B> <> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ,150; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,130;<3B> ύʱ<E1BDBB> <CAB1> ,130;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,130;" ) ) ;
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
}
BOOL CFFaxLog : : ReHide ( )
{
ShowWindow ( SW_HIDE ) ;
return true ;
}
BOOL CFFaxLog : : 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 CFFaxLog : : RefreshInfo ( )
{
m_wndList . ShowWindow ( SW_HIDE ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
m_bRefresh = true ;
m_wndList . DeleteAllItems ( ) ;
TCHAR szSelect [ 256 ] = { 0 } ;
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 )
_stprintf ( szSelect , _T ( " select %s * from faxlog where SubTime>='%04d%02d%02d' %s order by SubTime desc " ) , strTop , t . wYear , t . wMonth , t . wDay , m_strFindAdd ) ; //<2F> <> ѯ<EFBFBD> ѷ<EFBFBD> <D1B7> <EFBFBD> <EFBFBD> <EFBFBD>
else
_stprintf ( szSelect , _T ( " select %s * from faxlog where SubTime>=#%04d-%02d-%02d# %s order by SubTime desc " ) , strTop , t . wYear , t . wMonth , t . wDay , m_strFindAdd ) ; //<2F> <> ѯ<EFBFBD> ѷ<EFBFBD> <D1B7> <EFBFBD> <EFBFBD> <EFBFBD>
}
else
{
if ( m_strFindAdd . GetLength ( ) > 0 )
_stprintf ( szSelect , _T ( " select * from faxlog where 1 %s order by SubTime desc " ) , m_strFindAdd ) ; //<2F> <> ѯ<EFBFBD> <D1AF> <EFBFBD> ռ <EFBFBD> ¼
else
_stprintf ( szSelect , _T ( " select * from faxlog order by SubTime desc " ) ) ; //<2F> <> ѯ<EFBFBD> <D1AF> ־,<2C> <> ʾ ȫ<CABE> <C8AB> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> ʾ ͷ<CABE> <CDB7> <EFBFBD> <EFBFBD>
}
BOOL b = m_AdoRS . Open ( szSelect ) ;
long lSendID = 0 ;
long lStatus = 0 ;
TCHAR szStatus [ 24 ] = { 0 } ;
TCHAR szSendNum [ 24 ] = { 0 } ;
TCHAR szRecver [ 64 ] = { 0 } ;
TCHAR szRecvNum [ 64 ] = { 0 } ;
TCHAR szMsg [ 180 ] = { 0 } ;
COleDateTime tSub ;
COleDateTime tRecv ;
CString strSubTime ;
CString strRecvTime ;
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 )
{
CAdoFaxLog adoSms ;
m_AdoRS . RecordBinding ( adoSms ) ;
m_AdoRS . MoveFirst ( ) ;
long iItem = 0 ;
while ( ! m_AdoRS . IsEOF ( ) & & iItem < lCount )
{
// m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50; ״̬,70;״̬˵<CCAC> <CBB5> ,180;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ,70;<3B> <> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ,100;<3B> <> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ,150; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,130;<3B> ύʱ<E1BDBB> <CAB1> ,130;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,130;"));
long lIcon = GetStatusText ( adoSms . m_Status , szStatus ) ;
_tcscpy ( szRecvNum , adoSms . m_RecvNum ) ;
if ( _tcslen ( adoSms . m_Recver ) > 0 )
{
_tcscat ( szRecvNum , _T ( " - " ) ) ;
_tcscat ( szRecvNum , adoSms . m_Recver ) ;
}
if ( adoSms . m_SubTime . GetStatus ( ) = = COleDateTime : : valid )
{
strSubTime . Format ( _T ( " %04d.%02d.%02d %02d:%02d " ) , adoSms . m_SubTime . GetYear ( ) , adoSms . m_SubTime . GetMonth ( ) , adoSms . m_SubTime . GetDay ( ) , adoSms . m_SubTime . GetHour ( ) , adoSms . m_SubTime . GetMinute ( ) ) ;
}
if ( adoSms . m_RecvTime . GetStatus ( ) = = COleDateTime : : valid )
{
strRecvTime . Format ( _T ( " %04d.%02d.%02d %02d:%02d " ) , adoSms . m_RecvTime . GetYear ( ) , adoSms . m_RecvTime . GetMonth ( ) , adoSms . m_RecvTime . GetDay ( ) , adoSms . m_RecvTime . GetHour ( ) , adoSms . m_RecvTime . GetMinute ( ) ) ;
}
CString strTimes ;
if ( adoSms . m_Times > 0 )
strTimes . Format ( _T ( " %d " ) , adoSms . m_Times ) ;
2025-04-14 17:24:47 +08:00
m_wndList . InsertItemAndCol ( iItem , _itot ( lCount - iItem , szSelect , 10 ) , szStatus , adoSms . m_StatusMsg , strTimes , adoSms . m_SendNum , szRecvNum , adoSms . m_Title , strSubTime , strRecvTime ) ;
2025-02-27 16:58:16 +08:00
m_wndList . SetItemData ( iItem , adoSms . m_SendID ) ;
m_wndList . SetIconIndex ( iItem , lIcon ) ;
iItem + + ;
memset ( & adoSms , 0 , sizeof ( adoSms ) ) ;
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 CFFaxLog : : OnSize ( UINT nType , int cx , int cy )
{
CDialog : : OnSize ( nType , cx , cy ) ;
if ( m_bInit )
{
m_wndList . MoveWindow ( 0 , 0 , cx , cy ) ;
}
}
long CFFaxLog : : GetStatusText ( long lStatus , TCHAR * pStatus )
{
_tcscpy ( pStatus , _T ( " δ֪״̬ " ) ) ;
long lIcon = 0 ;
switch ( lStatus )
{
case SEND_STATUS_SUB_OK :
_tcscpy ( pStatus , _T ( " <EFBFBD> ύ<EFBFBD> ɹ<EFBFBD> " ) ) ;
break ;
case SEND_STATUS_SUB_FILT :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
break ;
case SEND_STATUS_SUB_ERROR :
case SEND_STATUS_SUB_USERNOSMS :
case SEND_STATUS_SUB_CORPNOSMS :
case SEND_STATUS_SUB_CORPOVRDATE :
_tcscpy ( pStatus , _T ( " <EFBFBD> ύʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_SUB_NUMNOSUP :
_tcscpy ( pStatus , _T ( " Ŀ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_FILT_ERROR :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_SEND_OK :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ͳɹ<EFBFBD> " ) ) ;
lIcon = 1 ;
break ;
case SEND_STATUS_SEND_ERROR :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_RECV_OK :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ճɹ<EFBFBD> " ) ) ;
lIcon = 2 ;
break ;
case SEND_STATUS_RECV_ERROR :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
}
return lIcon ;
}
void CFFaxLog : : OnRclickSmslogList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
ShowRMenu ( ) ;
}
void CFFaxLog : : ShowRMenu ( )
{
CMenu menu ;
menu . CreatePopupMenu ( ) ;
BOOL bLock = false ;
long lItem = this - > GetCurrentSelected ( ) ;
BOOL bNoStatus = m_pMainFrame - > m_Setup . bSDK & SDK_NOSTATUS ? true : false ;
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> " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_LOG_DEL , _T ( " ɾ <20> <> " ) ) ;
}
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> " ) ) ;
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_LOG_DEL , _T ( " ɾ <20> <> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> <EFBFBD>
menu . AppendMenu ( MF_STRING , MENU_LOG_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_LOG_FIND , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 )
menu . AppendMenu ( MF_STRING , MENU_LOG_BAK , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_LOG_BAK , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
BOOL bFindFail = m_pMainFrame - > m_Setup . bSDK & SDK_ALLOWFINDFAIL ? true : false ;
if ( bFindFail & & ! bNoStatus )
{
menu . AppendMenu ( MF_STRING , MENU_LOG_QUERYFAIL , _T ( " <20> <> ʧ<EFBFBD> ܶ<EFBFBD> <DCB6> <EFBFBD> " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
}
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_LOG_REFRESH , _T ( " ˢ <20> <> " ) ) ;
if ( ! bNoStatus ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ״̬<D7B4> <CCAC> û<EFBFBD> <C3BB> ˢ<EFBFBD> <CBA2> ״̬<D7B4> IJ˵<C4B2>
{
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_LOG_REFSTATUS , _T ( " ˢ<> <CBA2> ״̬ " ) ) ;
}
//<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 CFFaxLog : : GetCurrentSelected ( )
{
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
if ( pos )
{
return m_wndList . GetNextSelectedItem ( pos ) ;
}
return - 1 ;
}
void CFFaxLog : : On_User_See ( )
{
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
/*
SMS_See sms = GetSms ( lItem ) ;
sms . lType = SMS_SEE_TYPE_LOG ;
DLG_FaxLogSee dlg ( this ) ;
dlg . SetParam ( sms ) ;
dlg . DoModal ( ) ;
*/
}
void CFFaxLog : : 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 faxlog 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 CFFaxLog : : On_User_Del ( )
{
long lCount = m_wndList . GetSelectedCount ( ) ;
long * lDel = new long [ lCount + 2 ] ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
long i = 0 ;
while ( pos )
{
lDel [ i ] = m_wndList . GetNextSelectedItem ( pos ) ;
i + + ;
}
long lSendID = 0 ;
TCHAR szSelect [ 128 ] ;
//<2F> <> תɾ<D7AA> <C9BE>
m_wndList . ShowWindow ( SW_HIDE ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ٶ<EFBFBD>
for ( i = lCount ; i > 0 ; i - - )
{
lSendID = m_wndList . GetItemData ( lDel [ i - 1 ] ) ;
_stprintf ( szSelect , _T ( " delete from faxlog where SendID=%d " ) , lSendID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_wndList . DeleteItem ( lDel [ i - 1 ] ) ; //<2F> <> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> ɾ<EFBFBD> <C9BE>
}
}
m_wndList . ShowWindow ( SW_SHOW ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ٶ<EFBFBD>
delete lDel ;
}
void CFFaxLog : : On_User_Export ( )
{
/*
//<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 CFFaxLog : : On_User_Refresh ( )
{
RefreshInfo ( ) ;
}
void CFFaxLog : : 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 CFFaxLog : : On_User_Find ( )
{
/*
CString strTemp ;
DLG_Find_FaxLog dlg ( this ) ;
BOOL bNoStatus = m_pMainFrame - > m_Setup . bSDK & SDK_NOSTATUS ? true : false ;
dlg . SetParam ( ! m_bShowToday , ! bNoStatus ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
m_strFindAdd = _T ( " " ) ;
if ( ! m_bShowToday )
{
strTemp . Format ( _T ( " AND SubTime>=#%04d-%02d-%02d# AND SubTime<=#%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 ) ;
m_strFindAdd + = strTemp ;
}
if ( dlg . m_strSendNum . GetLength ( ) > 0 )
{
strTemp . Format ( _T ( " AND SendNum like '%%%s%%' " ) , dlg . m_strSendNum ) ;
m_strFindAdd + = strTemp ;
}
if ( dlg . m_strRecvNum . GetLength ( ) > 0 )
{
strTemp . Format ( _T ( " AND RecvNum like '%%%s%%' " ) , dlg . m_strRecvNum ) ;
m_strFindAdd + = strTemp ;
}
if ( dlg . m_strMsg . GetLength ( ) > 0 )
{
strTemp . Format ( _T ( " AND Msg like '%%%s%%' " ) , dlg . m_strMsg ) ;
m_strFindAdd + = strTemp ;
}
On_User_Refresh ( ) ;
m_strFindAdd = _T ( " " ) ; //ˢ<> º<C2BA> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD>
}
*/
}
void CFFaxLog : : 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 \\ FaxLog_%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 ( " faxlog " ) , 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 faxlog where SendID=%d " ) , lSendID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
CAdoFaxLog 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 faxlog 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_FaxLog ( strName ) ;
}
*/
}
void CFFaxLog : : On_User_RefStatus ( )
{
RefreshStatus ( ) ;
}
void CFFaxLog : : On_User_Refresh_All ( )
{
m_bShowAllRecord = true ;
On_User_Refresh ( ) ;
}
void CFFaxLog : : RefreshStatus ( BOOL bBegin )
{
//<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 ) ;
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 )
{
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_FaxStatus ) + sizeof ( ANS_FaxStatus_Data2 ) * lCount ;
BYTE * pData = new BYTE [ lSize ] ; memset ( pData , 0 , lSize ) ;
REQ_FaxStatus * pStatus = ( REQ_FaxStatus * ) pData ;
ANS_FaxStatus_Data2 * pStatusData = ( ANS_FaxStatus_Data2 * ) ( pData + sizeof ( REQ_FaxStatus ) ) ;
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_FAXSTATUS , pData , lSize ) ;
}
delete pSendID ;
}
long CFFaxLog : : GetItemStatus ( long iItem )
{
TCHAR szStatus [ 16 ] = { 0 } ;
TCHAR szTime [ 32 ] = { 0 } ;
m_wndList . GetItemText ( iItem , 1 , szStatus , sizeof ( szStatus ) ) ;
m_wndList . GetItemText ( iItem , 7 , 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 ;
}
SMS_See CFFaxLog : : GetSms ( long lItem )
{
SMS_See sms = { 0 } ;
long lSendID = m_wndList . GetItemData ( lItem ) ;
CString strSelect ;
long lStatus ;
TCHAR szSender [ 16 ] = { 0 } ;
TCHAR szRecver [ 16 ] = { 0 } ;
COleDateTime t ;
strSelect . Format ( _T ( " select * from faxlog where SendID=%d " ) , lSendID ) ;
if ( m_AdoRS . Open ( strSelect ) & & m_AdoRS . GetRecordCount ( ) )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " Status " ) , lStatus ) ;
m_AdoRS . GetCollect ( _T ( " SendNum " ) , sms . szSender ) ;
m_AdoRS . GetCollect ( _T ( " Recver " ) , szRecver ) ;
m_AdoRS . GetCollect ( _T ( " RecvNum " ) , sms . szRecver ) ;
m_AdoRS . GetCollect ( _T ( " Title " ) , sms . szMsg ) ;
m_AdoRS . GetCollect ( _T ( " SubTime " ) , t ) ; t . GetAsSystemTime ( sms . tSend ) ;
m_AdoRS . GetCollect ( _T ( " RecvTime " ) , t ) ; t . GetAsSystemTime ( sms . tRecv ) ;
GetStatusText ( lStatus , sms . szStatus ) ;
if ( _tcslen ( szSender ) > 0 )
{
_tcscat ( sms . szSender , _T ( " - " ) ) ;
_tcscat ( sms . szSender , szSender ) ;
}
if ( _tcslen ( szRecver ) > 0 )
{
_tcscat ( sms . szRecver , _T ( " - " ) ) ;
_tcscat ( sms . szRecver , szRecver ) ;
}
}
return sms ;
}
void CFFaxLog : : OnDblclkSmslogList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
On_User_See ( ) ;
}
void CFFaxLog : : 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 = = ' S ' | | pLVKeyDow - > wVKey = = ' s ' )
{
On_User_Send ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' R ' | | pLVKeyDow - > wVKey = = ' r ' )
{
On_User_Refresh ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' T ' | | pLVKeyDow - > wVKey = = ' t ' )
{
On_User_RefStatus ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' F ' | | pLVKeyDow - > wVKey = = ' f ' )
{
On_User_Find ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' B ' | | pLVKeyDow - > wVKey = = ' b ' )
{
On_User_Bak ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' A ' | | pLVKeyDow - > wVKey = = ' a ' )
{
m_wndList . SelectAllItems ( ) ;
}
}
long CFFaxLog : : GetStatusText2 ( long lStatus , TCHAR * pStatus )
{
_tcscpy ( pStatus , _T ( " δ֪״̬ " ) ) ;
long lIcon = 0 ;
switch ( lStatus )
{
case SEND_STATUS_SUB_OK :
_tcscpy ( pStatus , _T ( " <EFBFBD> ύ<EFBFBD> ɹ<EFBFBD> " ) ) ;
break ;
case SEND_STATUS_SUB_FILT :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
break ;
case SEND_STATUS_SUB_ERROR :
case SEND_STATUS_SUB_USERNOSMS :
case SEND_STATUS_SUB_CORPNOSMS :
case SEND_STATUS_SUB_CORPOVRDATE :
_tcscpy ( pStatus , _T ( " <EFBFBD> ύʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_SUB_NUMNOSUP :
_tcscpy ( pStatus , _T ( " Ŀ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_FILT_ERROR :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_SEND_OK :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ͳɹ<EFBFBD> " ) ) ;
lIcon = 1 ;
break ;
case SEND_STATUS_SEND_ERROR :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
case SEND_STATUS_RECV_OK :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ͳɹ<EFBFBD> " ) ) ;
lIcon = 1 ;
break ;
case SEND_STATUS_RECV_ERROR :
_tcscpy ( pStatus , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ) ;
lIcon = 3 ;
break ;
}
return lIcon ;
}
void CFFaxLog : : OnOK ( )
{
//CDialog::OnOK();
}
void CFFaxLog : : OnCancel ( )
{
//CDialog::OnCancel();
}
void CFFaxLog : : SetToday ( BOOL bToday )
{
if ( m_bShowToday ! = bToday )
{
m_bShowToday = bToday ;
m_bRefresh = false ;
}
}
void CFFaxLog : : SetBakDBName ( CString strDBName )
{
m_strBakDBName = strDBName ;
m_bNewDB = true ;
}
BOOL CFFaxLog : : ProcessSocket ( Socket_Head_Add * pHead , BYTE * pFrame )
{
//<2F> Ĺ<DEB8> <C4B9> õ<EFBFBD> ַ<EFBFBD> <D6B7>
if ( pHead - > lFuncType = = SMSFUNC_FAXSTATUS )
{
ANS_FaxStatus * pStatus = ( ANS_FaxStatus * ) pFrame ;
ANS_FaxStatus_Data * pData = ( ANS_FaxStatus_Data * ) ( pFrame + sizeof ( ANS_FaxStatus ) ) ;
for ( int i = 0 ; i < pStatus - > lCount ; i + + )
{
if ( pData - > lStatus ! = - 1 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֵΪ-1,֤<> <D6A4> ״̬û<CCAC> 䣬<EFBFBD> <E4A3AC> <EFBFBD> Բ<EFBFBD> <D4B2> ظ<EFBFBD> <D8B8> <EFBFBD>
{
COleDateTime tSend ( pData - > tSendTime ) ;
COleDateTime tRecv ( pData - > tRecvTime ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
TCHAR szBuf [ 32 ] ;
TCHAR szSelect [ 128 ] = { 0 } ;
CString str ;
_stprintf ( szSelect , _T ( " select * from faxlog where SendID=%d " ) , pData - > lSendID ) ;
if ( m_AdoRS . Open ( szSelect ) & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . PutCollect ( _T ( " Status " ) , pData - > lStatus ) ;
m_AdoRS . PutCollect ( _T ( " Times " ) , pData - > lTimes ) ;
m_AdoRS . PutCollect ( _T ( " StatusMsg " ) , pData - > szStatusMsg ) ;
m_AdoRS . PutCollect ( _T ( " SendTime " ) , tSend ) ;
m_AdoRS . PutCollect ( _T ( " RecvTime " ) , tRecv ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . Close ( ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
if ( pData - > lItemID > = 0 & & pData - > lItemID < m_wndList . GetItemCount ( ) )
{
long lSendID = m_wndList . GetItemData ( pData - > lItemID ) ;
if ( lSendID = = pData - > lSendID ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
{
long lIcon = GetStatusText ( pData - > lStatus , szBuf ) ;
m_wndList . SetItemText ( pData - > lItemID , 1 , szBuf ) ;
m_wndList . SetIconIndex ( pData - > lItemID , lIcon ) ;
m_wndList . SetItemText ( pData - > lItemID , 2 , pData - > szStatusMsg ) ;
if ( pData - > lTimes > 0 )
{
str . Format ( _T ( " %d " ) , pData - > lTimes ) ;
m_wndList . SetItemText ( pData - > lItemID , 3 , str ) ;
}
if ( tRecv . GetStatus ( ) = = COleDateTime : : valid )
{
_stprintf ( szBuf , _T ( " %04d.%02d.%02d %02d:%02d " ) , tRecv . GetYear ( ) , tRecv . GetMonth ( ) , tRecv . GetDay ( ) , tRecv . GetHour ( ) , tRecv . GetMinute ( ) ) ;
m_wndList . SetItemText ( pData - > lItemID , 8 , szBuf ) ;
}
}
}
}
pData + + ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB>
}
RefreshStatus ( false ) ; //<2F> <> ѯ<EFBFBD> <D1AF> 1000<30> <30> <EFBFBD> <EFBFBD> ״̬
return true ;
}
return false ;
}