2025-02-27 16:58:16 +08:00
// DLG_UBoxPop.cpp : ʵ<> <CAB5> <EFBFBD> ļ<EFBFBD>
//
# include "stdafx.h"
# include "CorpSms.h"
# include "DLG_UBoxPop.h"
# include "afxdialogex.h"
# include "MainFrm.h"
# include "FUBoxLog.h"
# include "DLG_SmsDY.h"
# include "DLG_UserSelect.h"
// DLG_UBoxPop <20> Ի<EFBFBD> <D4BB> <EFBFBD>
IMPLEMENT_DYNAMIC ( DLG_UBoxPop , CDialogEx )
DLG_UBoxPop : : DLG_UBoxPop ( CWnd * pParent /*=NULL*/ )
: CDialogEx ( DLG_UBoxPop : : IDD , pParent )
{
m_lCallingCount = 0 ;
m_strKH_BZ = _T ( " " ) ;
m_strKH_Job = _T ( " " ) ;
m_strCall_BZ = _T ( " " ) ;
m_strCallTime = _T ( " " ) ;
m_strCallType = _T ( " " ) ;
m_strKH_Local = _T ( " " ) ;
m_strKH_LTD = _T ( " " ) ;
m_strKH_Mobile = _T ( " " ) ;
// m_strKH_ = _T("");
m_strKH_Name = _T ( " " ) ;
m_strKH_Tel = _T ( " " ) ;
m_strCall_Number = _T ( " " ) ;
m_strCall_NumberLocal = _T ( " " ) ;
m_lCallStatus = 0 ;
m_lCallWay = 0 ;
m_bAddressModify = false ;
m_lAddressType = 0 ;
m_lUserID = 0 ;
m_bSelGroup = false ;
m_bCallModify = true ;
m_bCallSendSms = true ;
m_bAddressSave = false ;
m_bCallYModify = false ;
m_bAddressYModify = false ;
m_dwCallJT = 0 ;
m_bCallBegin = false ;
m_bCallEnd = false ;
m_lUBoxLogID = 0 ;
m_bSaveCallPro = false ;
m_lCallSC = 0 ;
m_lTickCount = GetTickCount ( ) ;
m_lBeginTime = 0 ;
m_lGroupID = 0 ;
m_bRecord = false ;
m_bRecordEnd = false ;
}
DLG_UBoxPop : : ~ DLG_UBoxPop ( )
{
int i = 10 ;
}
void DLG_UBoxPop : : DoDataExchange ( CDataExchange * pDX )
{
CDialogEx : : DoDataExchange ( pDX ) ;
DDX_Text ( pDX , IDD_UBOXPOP__KH_BZ , m_strKH_BZ ) ;
// DDV_MaxChars(pDX, m_strKH_BZ, 50);
DDX_Text ( pDX , IDD_UBOXPOP__KH_JOB , m_strKH_Job ) ;
DDV_MaxChars ( pDX , m_strKH_Job , 30 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_CALLBZ , m_strCall_BZ ) ;
DDV_MaxChars ( pDX , m_strCall_BZ , 500 ) ;
DDX_Control ( pDX , IDD_UBOXPOP_CALLSTATUS , m_S_CallStatus ) ;
DDX_Text ( pDX , IDD_UBOXPOP_CALLTIME , m_strCallTime ) ;
DDV_MaxChars ( pDX , m_strCallTime , 30 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_CALLTYPE , m_strCallType ) ;
DDV_MaxChars ( pDX , m_strCallType , 30 ) ;
DDX_Control ( pDX , IDD_UBOXPOP_CALLWAY , m_S_CallWay ) ;
DDX_Text ( pDX , IDD_UBOXPOP_KH_LOCAL , m_strKH_Local ) ;
DDV_MaxChars ( pDX , m_strKH_Local , 200 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_KH_LTD , m_strKH_LTD ) ;
DDV_MaxChars ( pDX , m_strKH_LTD , 50 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_KH_MOBILE , m_strKH_Mobile ) ;
DDV_MaxChars ( pDX , m_strKH_Mobile , 30 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_KH_NAME , m_strKH_Name ) ;
DDV_MaxChars ( pDX , m_strKH_Name , 24 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_KH_TEL , m_strKH_Tel ) ;
DDV_MaxChars ( pDX , m_strKH_Tel , 24 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_NUMBER , m_strCall_Number ) ;
DDV_MaxChars ( pDX , m_strCall_Number , 30 ) ;
DDX_Text ( pDX , IDD_UBOXPOP_NUMBERLOCAL , m_strCall_NumberLocal ) ;
DDV_MaxChars ( pDX , m_strCall_NumberLocal , 120 ) ;
DDX_Control ( pDX , IDD_UBOXPOP_LIST , m_wndList ) ;
}
BEGIN_MESSAGE_MAP ( DLG_UBoxPop , CDialogEx )
ON_WM_TIMER ( )
ON_EN_CHANGE ( IDD_UBOXPOP_KH_NAME , & DLG_UBoxPop : : OnEnChangeUboxpopKhName )
ON_EN_CHANGE ( IDD_UBOXPOP_KH_LTD , & DLG_UBoxPop : : OnEnChangeUboxpopKhLtd )
ON_EN_CHANGE ( IDD_UBOXPOP__KH_JOB , & DLG_UBoxPop : : OnEnChangeUboxpop )
ON_EN_CHANGE ( IDD_UBOXPOP_KH_MOBILE , & DLG_UBoxPop : : OnEnChangeUboxpopKhMobile )
ON_EN_CHANGE ( IDD_UBOXPOP_KH_TEL , & DLG_UBoxPop : : OnEnChangeUboxpopKhTel )
ON_EN_CHANGE ( IDD_UBOXPOP__KH_BZ , & DLG_UBoxPop : : OnEnChangeUboxpopKhBZ )
ON_BN_CLICKED ( IDD_UBOXPOP_KH_LOCAL_SEL , & DLG_UBoxPop : : OnBnClickedUboxpopKhLocalSel )
ON_BN_CLICKED ( IDD_UBOXPOP_CALLTYPE_SEL , & DLG_UBoxPop : : OnBnClickedUboxpopCalltypeSel )
ON_EN_CHANGE ( IDD_UBOXPOP_CALLBZ , & DLG_UBoxPop : : OnEnChangeUboxpopCallbz )
ON_COMMAND_RANGE ( UBOXPOP_CALLTYPE_BEGIN , UBOXPOP_CALLTYPE_END , & DLG_UBoxPop : : On_CallType )
ON_COMMAND_RANGE ( UBOXPOP_SMSDY_BEGIN , UBOXPOP_SMSDY_END , & DLG_UBoxPop : : On_SmsDY )
ON_COMMAND ( UBOXPOP_SMSDY_OTHER , & DLG_UBoxPop : : On_SmsDY_Other )
ON_COMMAND ( UBOXPOP_SMSDY_MANAGER , & DLG_UBoxPop : : On_SmsDY_Manager )
ON_MESSAGE ( UBOX_EVENT , UBox_Event )
ON_BN_CLICKED ( IDOK , & DLG_UBoxPop : : OnBnClickedOk )
ON_BN_CLICKED ( IDCANCEL , & DLG_UBoxPop : : OnBnClickedCancel )
ON_BN_CLICKED ( IDD_UBOXPOP_CALL_RESMS , & DLG_UBoxPop : : OnBnClickedUboxpopCallResms )
END_MESSAGE_MAP ( )
// DLG_UBoxPop <20> <> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void DLG_UBoxPop : : SetMainFrame ( CMainFrame * pFrame )
{
m_pMainFrame = pFrame ;
}
void DLG_UBoxPop : : ReSetTitle ( void )
{
CString str ;
if ( m_lCallWay = = 0 )
str = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
else
str = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
str = str + CString ( _T ( " " ) ) + m_strCall_NumberLocal ;
str = str + CString ( _T ( " " ) ) + m_strNumber ;
str = str + CString ( _T ( " " ) ) + m_strKH_Name ;
str = str + CString ( _T ( " " ) ) + m_strKH_LTD ;
if ( m_lCallingCount > 1 )
{
CString strTemp ;
strTemp . Format ( _T ( " %d<> <64> " ) , this - > m_lCallingCount ) ;
str = str + CString ( _T ( " " ) ) + strTemp ;
}
SetWindowText ( str ) ;
}
void DLG_UBoxPop : : SetNumber ( CString strNumber )
{
m_strNumber = strNumber ;
}
void DLG_UBoxPop : : OnTimer ( UINT_PTR nIDEvent )
{
CDialogEx : : OnTimer ( nIDEvent ) ;
if ( nIDEvent = = 1 )
{
KillTimer ( nIDEvent ) ;
GetAddress ( ) ;
}
if ( nIDEvent = = 2 )
{
if ( m_dwCallJT > 0 )
{
DWORD dwTime = : : GetTickCount ( ) - m_dwCallJT ;
long lSec = dwTime / 1000 ;
COleDateTimeSpan sc ( 0 , 0 , 0 , lSec ) ;
CString str ;
str . Format ( _T ( " %02d:%02d " ) , sc . GetMinutes ( ) , sc . GetSeconds ( ) ) ;
m_S_CallStatus . SetWindowText ( str ) ;
}
}
if ( nIDEvent = = 7 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD>
{
KillTimer ( nIDEvent ) ;
Call_Begin ( ) ;
}
if ( nIDEvent = = 8 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> <D0B6> ϴ<EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> ʱ
{
KillTimer ( nIDEvent ) ;
Call_Close ( ) ; //<2F> ر<EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
}
void DLG_UBoxPop : : GetAddress ( void )
{
m_AdoRS . SetAdoConnection ( & this - > m_pMainFrame - > m_adoConnection ) ;
m_AdoRS2 . SetAdoConnection ( & this - > m_pMainFrame - > m_adoConnection ) ;
UpdateData ( true ) ;
CString str ;
m_bCallModify = true ; //Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <DEB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_bCallSendSms = true ; //Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ظ<EFBFBD> <D8B8> <EFBFBD> <EFBFBD> ŵ<EFBFBD>
m_bAddressSave = false ; //Ĭ<> ϲ <EFBFBD> <CFB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD>
//<2F> յ<EFBFBD> DTMF<4D> <46> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_strNumber . GetLength ( ) > 0 )
{
BOOL bGetAddress = false ;
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_SEE , false ) ) //<2F> й<EFBFBD> <D0B9> <EFBFBD> ͨѶ¼<D1B6> 鿴Ȩ<E9BFB4> <C8A8>
{
//<2F> <> <EFBFBD> û<EFBFBD>
str . Format ( _T ( " select * from gaddress where Mobile='%s' or Tel='%s' " ) , m_strNumber , m_strNumber ) ;
if ( m_AdoRS . Open ( str ) & & ! m_AdoRS . IsEOF ( ) )
{
bGetAddress = true ;
m_lAddressType = 0 ; //<2F> <> <EFBFBD> <EFBFBD> ͨѶ¼
m_bSelGroup = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD>
/*
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_MODIFY , false ) ) //<2F> й<EFBFBD> <D0B9> <EFBFBD> ͨѶ¼<D1B6> 鿴Ȩ<E9BFB4> <C8A8>
{
m_bAddressModify = true ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼
}
*/
m_bAddressModify = false ; //<2F> <> <EFBFBD> <EFBFBD> ͨѶ¼<D1B6> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_AdoRS . GetCollect ( _T ( " UserID " ) , m_lUserID ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , m_strKH_Name ) ;
m_AdoRS . GetCollect ( _T ( " LTD " ) , m_strKH_LTD ) ;
m_AdoRS . GetCollect ( _T ( " Job " ) , m_strKH_Job ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , m_strKH_Mobile ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , m_strKH_Tel ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , m_strKH_BZ ) ;
TCHAR szGroupID [ 32 ] = { 0 } ;
m_AdoRS . GetCollect ( _T ( " GroupID " ) , szGroupID ) ;
TCHAR szLocal [ 512 ] = { 0 } ;
GetLocal ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼" ) , _T ( " gaddress " ) , szLocal , szGroupID ) ;
m_strKH_Local = szLocal ;
}
}
if ( ! bGetAddress )
{
//<2F> <> <EFBFBD> û<EFBFBD>
str . Format ( _T ( " select * from paddress where Mobile='%s' or Tel='%s' " ) , m_strNumber , m_strNumber ) ;
if ( m_AdoRS . Open ( str ) & & ! m_AdoRS . IsEOF ( ) )
{
bGetAddress = true ;
m_lAddressType = 1 ; //˽<> <CBBD> ͨѶ¼
m_bSelGroup = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD>
m_bAddressModify = true ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼
m_AdoRS . GetCollect ( _T ( " UserID " ) , m_lUserID ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , m_strKH_Name ) ;
m_AdoRS . GetCollect ( _T ( " LTD " ) , m_strKH_LTD ) ;
m_AdoRS . GetCollect ( _T ( " Job " ) , m_strKH_Job ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , m_strKH_Mobile ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , m_strKH_Tel ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , m_strKH_BZ ) ;
TCHAR szGroupID [ 32 ] = { 0 } ;
m_AdoRS . GetCollect ( _T ( " GroupID " ) , szGroupID ) ;
TCHAR szLocal [ 512 ] = { 0 } ;
GetLocal ( _T ( " ˽<EFBFBD> <EFBFBD> ͨѶ¼ " ) , _T ( " paddress " ) , szLocal , szGroupID ) ;
m_strKH_Local = szLocal ;
}
}
if ( ! bGetAddress )
{
m_lAddressType = - 1 ; //δ֪
m_bSelGroup = true ; //<2F> <> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD>
m_bAddressModify = true ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼
m_bAddressSave = true ; //<2F> <> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> ͨѶ¼
m_lAddressType = 1 ; //˽<> <CBBD> ͨѶ¼
m_strKH_Local = _T ( " ˽<EFBFBD> <EFBFBD> ͨѶ¼ " ) ;
m_strKHGroupID = _T ( " " ) ; //Ĭ<> ϱ <EFBFBD> <CFB1> <EFBFBD> λ<EFBFBD> <CEBB>
if ( m_strNumber . Left ( 1 ) = = _T ( " 1 " ) ) //<2F> ֻ<EFBFBD>
{
m_strKH_Mobile = m_strNumber ;
}
else
{
m_strKH_Tel = m_strNumber ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡͨ<C8A1> <CDA8> <EFBFBD> <EFBFBD> ¼.<2E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 100000<30> <30> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> ҵID<49> <44>
REQ_UBox_GetPro * pGetPro = new REQ_UBox_GetPro ;
memset ( pGetPro , 0 , sizeof ( REQ_UBox_GetPro ) ) ;
pGetPro - > lCorpID = m_pMainFrame - > m_lCorpID ;
pGetPro - > lUserID = m_pMainFrame - > m_lUserID ;
pGetPro - > lTickCount = m_lTickCount ;
pGetPro - > lAddressType = m_lAddressType ;
pGetPro - > lKH_UserID = m_lUserID ;
_tcscpy ( pGetPro - > szCallNumber , m_strNumber ) ;
pGetPro - > bGetCorpPro = false ;
if ( ! bGetAddress & & m_pMainFrame - > m_lCorpID = = 100000 )
{
pGetPro - > bGetCorpPro = true ;
}
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_GETPRO , ( BYTE * ) pGetPro , sizeof ( REQ_UBox_GetPro ) ) ;
}
else
{
m_lAddressType = - 1 ; //δ֪
m_bSelGroup = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD>
m_bAddressModify = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼
m_bCallSendSms = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD>
}
EnableCtrl ( ) ;
ReSetTitle ( ) ;
UpdateData ( false ) ;
}
void DLG_UBoxPop : : GetLocal ( CString strType , CString strDBName , TCHAR * pLocal , TCHAR * pGroupID )
{
long lLen = _tcslen ( pGroupID ) ;
TCHAR szGroup [ 16 ] = { 0 } ;
TCHAR szTemp [ 16 ] = { 0 } ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( pLocal , strType ) ;
for ( int i = 1 ; i < = lLen ; i + + )
{
_tcsncpy ( szGroup , pGroupID , i ) ;
_stprintf ( szSelect , _T ( " select Name from %s where GroupID='%s' AND UserType='0' " ) , strDBName , szGroup ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . GetCollect ( _T ( " Name " ) , szTemp ) ;
_tcscat ( pLocal , _T ( " \\ " ) ) ;
_tcscat ( pLocal , szTemp ) ;
}
}
}
BOOL DLG_UBoxPop : : OnInitDialog ( )
{
CDialogEx : : OnInitDialog ( ) ;
m_lTickCount = GetTickCount ( ) ;
//<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> <EFBFBD> ,130; ʱ <20> <> ,130;ͨ<> <CDA8> ʱ<EFBFBD> <CAB1> ,80;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,90; <20> <> <EFBFBD> <EFBFBD> ,90; <20> <> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> ,200; <20> <> ע,220;" ) ) ;
m_wndList . SetGridLines ( true ) ;
m_wndList . SetImageList ( & m_Image , LVSIL_SMALL ) ;
m_strCall_Number = m_strNumber ;
GetLocalTime ( & m_tCallTime ) ;
m_strCallTime . Format ( _T ( " %02d:%02d:%02d " ) , m_tCallTime . wHour , m_tCallTime . wMinute , m_tCallTime . wSecond ) ;
m_strCall_NumberLocal = _T ( " δ֪<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
m_strCallType = _T ( " δ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
SetCallStatus ( ) ;
SetCallWay ( ) ;
UpdateData ( false ) ;
SetTimer ( 1 , 100 , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> ȡͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
if ( m_lCallWay = = 1 ) //<2F> <> <EFBFBD> <EFBFBD>
{
long lDelay = m_pMainFrame - > m_Setup . UBox_lPhoneOutDelay ;
if ( lDelay < 7 | | lDelay > 20 )
lDelay = 7 ;
if ( m_lBeginTime > 0 )
SetTimer ( 7 , m_lBeginTime * 1000 , NULL ) ; //<2F> Զ<EFBFBD> <D4B6> <EFBFBD> ͨ,<2C> <> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ
else
SetTimer ( 7 , lDelay * 1000 , NULL ) ; //<2F> Զ<EFBFBD> <D4B6> <EFBFBD> ͨ
}
ReSetTitle ( ) ;
return TRUE ; // return TRUE unless you set the focus to a control
// <20> 쳣: OCX <20> <> <EFBFBD> <EFBFBD> ҳӦ<D2B3> <D3A6> <EFBFBD> <EFBFBD> FALSE
}
void DLG_UBoxPop : : SetCallStatus ( void )
{
if ( m_lCallStatus = = 0 )
{
m_S_CallStatus . SetWindowText ( _T ( " δ<EFBFBD> <EFBFBD> " ) ) ;
}
else
{
m_S_CallStatus . SetWindowText ( _T ( " <EFBFBD> ѽ<EFBFBD> " ) ) ;
}
}
void DLG_UBoxPop : : SetCallWay ( void )
{
if ( m_lCallWay = = 0 )
{
m_S_CallWay . SetWindowText ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
else
{
m_S_CallWay . SetWindowText ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
}
void DLG_UBoxPop : : EnableCtrl ( void )
{
if ( m_bSelGroup )
{
GetDlgItem ( IDD_UBOXPOP_KH_LOCAL_SEL ) - > EnableWindow ( true ) ;
}
else
{
GetDlgItem ( IDD_UBOXPOP_KH_LOCAL_SEL ) - > EnableWindow ( false ) ;
}
if ( m_bCallModify )
{
GetDlgItem ( IDD_UBOXPOP_CALLTYPE_SEL ) - > EnableWindow ( true ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_CALLBZ ) ) - > SetReadOnly ( false ) ;
}
else
{
GetDlgItem ( IDD_UBOXPOP_CALLTYPE_SEL ) - > EnableWindow ( false ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_CALLBZ ) ) - > SetReadOnly ( true ) ;
}
if ( m_bCallSendSms )
{
GetDlgItem ( IDD_UBOXPOP_CALL_RESMS ) - > EnableWindow ( true ) ;
}
else
{
GetDlgItem ( IDD_UBOXPOP_CALL_RESMS ) - > EnableWindow ( false ) ;
}
if ( m_bAddressModify )
{
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_NAME ) ) - > SetReadOnly ( false ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_LTD ) ) - > SetReadOnly ( false ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP__KH_JOB ) ) - > SetReadOnly ( false ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_MOBILE ) ) - > SetReadOnly ( false ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_TEL ) ) - > SetReadOnly ( false ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP__KH_BZ ) ) - > SetReadOnly ( false ) ;
}
else
{
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_NAME ) ) - > SetReadOnly ( true ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_LTD ) ) - > SetReadOnly ( true ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP__KH_JOB ) ) - > SetReadOnly ( true ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_MOBILE ) ) - > SetReadOnly ( true ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP_KH_TEL ) ) - > SetReadOnly ( true ) ;
( ( CEdit * ) GetDlgItem ( IDD_UBOXPOP__KH_BZ ) ) - > SetReadOnly ( true ) ;
}
if ( m_bAddressSave )
{
GetDlgItem ( IDD_UBOXPOP__KH_SAVE ) - > EnableWindow ( true ) ;
}
else
{
GetDlgItem ( IDD_UBOXPOP__KH_SAVE ) - > EnableWindow ( false ) ;
}
}
void DLG_UBoxPop : : OnEnChangeUboxpopKhName ( )
{
m_bAddressYModify = true ; //<2F> Ĺ<DEB8> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnEnChangeUboxpopKhLtd ( )
{
m_bAddressYModify = true ; //<2F> Ĺ<DEB8> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnEnChangeUboxpop ( )
{
m_bAddressYModify = true ; //<2F> Ĺ<DEB8> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnEnChangeUboxpopKhMobile ( )
{
m_bAddressYModify = true ; //<2F> Ĺ<DEB8> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnEnChangeUboxpopKhTel ( )
{
m_bAddressYModify = true ; //<2F> Ĺ<DEB8> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnEnChangeUboxpopKhBZ ( )
{
m_bCallYModify = true ; //<2F> Ĺ<DEB8> ͨѶ<CDA8> <D1B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnBnClickedUboxpopKhLocalSel ( )
{
DLG_UserSelect dlg ( this ) ;
dlg . SetParam ( m_pMainFrame , _T ( " paddress " ) , _T ( " <EFBFBD> <EFBFBD> Ŀ¼" ) , false ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
m_lGroupID = dlg . GetParam ( m_strGroupID ) ;
m_bAddressYModify = true ; //<2F> Ĺ<DEB8> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
m_lAddressType = 1 ; //˽<> <CBBD> ͨѶ¼
//<2F> <> GroupID
CString str ;
m_strGroupID = _T ( " " ) ;
str . Format ( _T ( " select * from paddress where UserID=%d " ) , m_lGroupID ) ;
if ( m_AdoRS . Open ( str ) & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . GetCollect ( _T ( " GroupID " ) , m_strGroupID ) ;
}
TCHAR szLocal [ 512 ] = { 0 } ;
GetLocal ( _T ( " ˽<EFBFBD> <EFBFBD> ͨѶ¼ " ) , _T ( " paddress " ) , szLocal , m_strGroupID . GetBuffer ( 0 ) ) ;
UpdateData ( true ) ;
m_strKH_Local = szLocal ;
//m_Address.lAccessGroupID = dlg.GetParam(m_strGroup);
UpdateData ( false ) ;
}
}
void DLG_UBoxPop : : OnBnClickedUboxpopCalltypeSel ( )
{
CMenu menu ;
menu . CreatePopupMenu ( ) ;
long lCount = m_CallType . GetCount ( ) ;
for ( long i = 0 ; i < lCount ; i + + )
{
menu . AppendMenu ( MF_STRING , UBOXPOP_CALLTYPE_BEGIN + i , m_CallType . GetAt ( i ) . szType ) ;
}
CRect rect ;
GetDlgItem ( IDD_UBOXPOP_CALLTYPE_SEL ) - > GetWindowRect ( & rect ) ;
//this->ClientToScreen(&rect);
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
menu . TrackPopupMenu ( TPM_RIGHTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON , rect . right , rect . bottom , this , NULL ) ;
menu . DestroyMenu ( ) ;
//m_bCallYModify = true; //<2F> Ĺ<DEB8> ͨѶ<CDA8> <D1B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnEnChangeUboxpopCallbz ( )
{
m_bCallYModify = true ; //<2F> Ĺ<DEB8> ͨѶ<CDA8> <D1B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
BOOL DLG_UBoxPop : : ProcessSocket ( Socket_Head_Add * pHead , BYTE * pFrame )
{
try
{
CString str ;
//ȡ<> Ƽ <EFBFBD> <C6BC> <EFBFBD> Ϣ
if ( pHead - > lFuncType = = SMSFUNC_UBOX_GETPRO )
{
ANS_UBox_GetPro * pGetPro = ( ANS_UBox_GetPro * ) pFrame ;
ANS_UBox_CallType * pCallType = ( ANS_UBox_CallType * ) ( pFrame + sizeof ( ANS_UBox_GetPro ) ) ;
ANS_UBox_CallLog * pCallLog = ( ANS_UBox_CallLog * ) ( pFrame + sizeof ( ANS_UBox_GetPro ) + sizeof ( ANS_UBox_CallType ) * pGetPro - > lCallTypeCount ) ;
if ( pGetPro - > lTickCount ! = m_lTickCount ) //<2F> <> <EFBFBD> Ǵ˴ <C7B4> <CBB4> ڷ<EFBFBD> <DAB7> <EFBFBD> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
return true ;
}
UpdateData ( true ) ;
m_strCall_NumberLocal = pGetPro - > szCall_Local ;
if ( pGetPro - > bGetCorpPro )
{
m_strKH_Name = pGetPro - > szKH_Name ;
m_strKH_LTD = pGetPro - > szKH_LTD ;
m_strKH_Job = pGetPro - > szKH_Job ;
m_strKH_Mobile = pGetPro - > szKH_Mobile ;
m_strKH_Tel = pGetPro - > szKH_Tel ;
m_strKH_Local = pGetPro - > szKH_Local ;
m_bCallModify = true ;
m_bCallSendSms = true ;
m_bAddressSave = false ;
m_bAddressModify = false ;
m_bAddressYModify = false ;
m_bSelGroup = false ;
EnableCtrl ( ) ;
}
ReSetTitle ( ) ;
UpdateData ( false ) ;
m_CallType . RemoveAll ( ) ;
for ( long i = 0 ; i < pGetPro - > lCallTypeCount ; i + + )
{
ANS_UBox_CallType callType = pCallType [ i ] ;
m_CallType . Add ( callType ) ;
}
m_wndList . DeleteAllItems ( ) ;
for ( i = 0 ; i < pGetPro - > lCallLogCount ; i + + )
{
//m_wndList.SetHeadings(_T("<22> 绰<EFBFBD> <E7BBB0> <EFBFBD> <EFBFBD> ,90;<3B> <> <EFBFBD> <EFBFBD> ,50; ʱ <20> <> ,120;ͨ<> <CDA8> ʱ<EFBFBD> <CAB1> ,60; <20> <> <EFBFBD> <EFBFBD> ,80; <20> <> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> ,120; <20> <> ע,120;"));
m_wndList . InsertItem ( i , pCallLog [ i ] . szCallNumber , CFUBoxLog : : GetCallLogIconIndex ( & pCallLog [ i ] ) ) ;
long lTemp = 1 ;
str . Format ( _T ( " %04d.%02d.%02d %02d:%02d " ) , pCallLog [ i ] . tCallTime . wYear , pCallLog [ i ] . tCallTime . wMonth , pCallLog [ i ] . tCallTime . wDay , pCallLog [ i ] . tCallTime . wHour , pCallLog [ i ] . tCallTime . wMinute ) ;
m_wndList . SetItemText ( i , lTemp + + , str ) ; //ͨ<> <CDA8> ʱ<EFBFBD> <CAB1>
COleDateTimeSpan span ( 0 , 0 , 0 , pCallLog [ i ] . lCallSC ) ;
str . Format ( _T ( " %02d:%02d:%02d " ) , span . GetHours ( ) , span . GetMinutes ( ) , span . GetSeconds ( ) ) ;
m_wndList . SetItemText ( i , lTemp + + , str ) ; //ʱ<> <CAB1>
m_wndList . SetItemText ( i , lTemp + + , pCallLog [ i ] . szUserName ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( i , lTemp + + , pCallLog [ i ] . szKHName ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( i , lTemp + + , pCallLog [ i ] . szKHLTD ) ; //<2F> <> λ
m_wndList . SetItemText ( i , lTemp + + , pCallLog [ i ] . szCallBZ ) ; //<2F> <> ע
}
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_UBOX_UPLOAD )
{
ANS_UBox_UpLoad * pUpload = ( ANS_UBox_UpLoad * ) pFrame ;
if ( pUpload - > req . lTickCount ! = m_lTickCount ) //<2F> <> <EFBFBD> Ǵ˴ <C7B4> <CBB4> ڷ<EFBFBD> <DAB7> <EFBFBD> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
return true ;
}
if ( pUpload - > lUploadStatus = = 1 )
{
m_lUBoxLogID = pUpload - > req . callLog . lUBoxLogID ;
}
Call_Close ( ) ;
return true ;
}
return false ;
}
catch ( . . . )
{
}
return false ;
}
void DLG_UBoxPop : : On_CallType ( UINT nID )
{
UpdateData ( true ) ;
long lID = nID ;
long lBegin = UBOXPOP_CALLTYPE_BEGIN ;
long lIndex = nID - lBegin ;
m_strCallType = m_CallType . GetAt ( lIndex ) . szType ;
m_bCallYModify = true ; //<2F> Ĺ<DEB8> ͨѶ<CDA8> <D1B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
UpdateData ( false ) ;
}
void DLG_UBoxPop : : On_SmsDY_Other ( )
{
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 ( " " ) ) ;
//<2F> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD>
long lCount = 1 ;
//<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 ;
_tcscpy ( pUser - > szName , this - > m_strKH_Name ) ;
_tcscpy ( pUser - > szMobile , this - > m_strNumber ) ;
m_pMainFrame - > m_pFuncView - > On_User_List_AddUser ( lCount , ( Send_User * ) pS ) ;
delete pS ;
}
}
void DLG_UBoxPop : : On_SmsDY_Manager ( )
{
DLG_SmsDY dlg ( this ) ;
dlg . SetParam ( & m_AdoRS ) ;
dlg . m_bDblclkSelect = false ; //˫<> <CBAB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1>
dlg . DoModal ( ) ;
}
void DLG_UBoxPop : : On_SmsDY ( UINT nID )
{
long lID = nID ;
long lBegin = UBOXPOP_SMSDY_BEGIN ;
long lIndex = nID - lBegin ;
if ( lIndex < m_SmsDY . GetCount ( ) )
{
CString strSmsDY = m_SmsDY . GetAt ( lIndex ) ;
if ( strSmsDY . GetLength ( ) > 0 & & m_strNumber . GetLength ( ) > 0 )
{
m_pMainFrame - > SendSms ( m_strNumber , strSmsDY ) ;
}
}
}
2025-04-11 17:19:25 +08:00
LONG_PTR DLG_UBoxPop : : UBox_Event ( WPARAM wParam , LPARAM lParam )
2025-02-27 16:58:16 +08:00
{
long lCmd = ( long ) wParam ;
CString str ;
if ( lCmd = = UBOX_EVENT_HOOK_UP | | lCmd = = UBOX_EVENT_HOOK_UP2 ) //<2F> һ <EFBFBD>
{
if ( lCmd = = UBOX_EVENT_HOOK_UP2 ) //<2F> ظ<EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> ģ<EFBFBD> <C4A3> ر<EFBFBD> ǰһ <C7B0> <D2BB> ͨ<EFBFBD> <CDA8>
{
CDialogEx : : OnCancel ( ) ;
}
Call_End ( ) ;
return true ;
}
if ( lCmd = = UBOX_EVENT_HOOK_OFF ) //ժ<> <D5AA>
{
if ( m_lCallWay = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> ʱժ<CAB1> <D5AA> Ϊ<EFBFBD> <CEAA> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD>
{
Call_Begin ( ) ; //<2F> <> <EFBFBD> п<EFBFBD> ʼ
}
if ( m_lCallWay = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ժ<EFBFBD> <D5AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܲ<EFBFBD> <DCB2> ŵģ<C5B5> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٴ<EFBFBD> ժ<EFBFBD> <D5AA> <EFBFBD> <EFBFBD> <EFBFBD> ϶<EFBFBD> <CFB6> ǽ<EFBFBD> <C7BD> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD>
{
Call_End ( ) ; //<2F> <> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
}
return true ;
}
if ( lCmd = = UBOX_EVENT_WJ ) //δ<> <CEB4>
{
if ( m_lCallWay = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> δ<EFBFBD> <CEB4> Ϊ<EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> Ϊ0
{
Call_End ( ) ; //<2F> <> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
}
if ( m_lCallWay = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ժ<EFBFBD> <D5AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܲ<EFBFBD> <DCB2> ŵģ<C5B5> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٴ<EFBFBD> ժ<EFBFBD> <D5AA> <EFBFBD> <EFBFBD> <EFBFBD> ϶<EFBFBD> <CFB6> ǽ<EFBFBD> <C7BD> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD>
{
Call_End ( ) ; //<2F> <> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
}
return true ;
}
return 0 ;
}
void DLG_UBoxPop : : Call_End ( void )
{
# ifdef SUPPER_UBOX
KillTimer ( 2 ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ ʱ<CABE> <CAB1> <EFBFBD> <EFBFBD> Timer
KillTimer ( 7 ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Timer
//if ( m_bCallEnd ) //<2F> ˺<EFBFBD> <CBBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѽ<EFBFBD> <D1BD> <EFBFBD> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٴ<EFBFBD> <D9B4> <EFBFBD>
// return;
m_bCallEnd = true ;
//<2F> <> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> ʱ<EFBFBD> <CAB1>
if ( m_dwCallJT > 0 & & m_lCallSC < = 0 )
{
DWORD dwTime = : : GetTickCount ( ) - m_dwCallJT ;
m_lCallSC = dwTime / 1000 ;
}
//ֹͣ¼<D6B9> <C2BC>
if ( m_bRecord )
{
m_bRecordEnd = true ;
m_pMainFrame - > m_ubox_stop_record ( m_pMainFrame - > m_ubox_endHandle ) ;
}
if ( this - > m_lUBoxLogID < = 0 )
{
//Ϊ<> <CEAA> <EFBFBD> Ž<EFBFBD> <C5BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӳ<EFBFBD> <D3B2> <EFBFBD> <EFBFBD> <EFBFBD> ־
this - > m_pMainFrame - > m_DlgUBoxDial . AddCallLog ( m_strNumber , m_lCallWay , m_lCallStatus ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϴ<EFBFBD> <CFB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Call_Upload ( ) ;
}
# endif
}
void DLG_UBoxPop : : Call_Begin ( void )
{
# ifdef SUPPER_UBOX
KillTimer ( 7 ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Timer
if ( m_bCallBegin ) //<2F> ˺<EFBFBD> <CBBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѿ<EFBFBD> ʼ <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> ô<EFBFBD> <C3B4> <EFBFBD>
return ;
if ( m_bCallEnd ) //<2F> ˺<EFBFBD> <CBBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѽ<EFBFBD> <D1BD> <EFBFBD> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> ô<EFBFBD> <C3B4> <EFBFBD>
return ;
m_bCallBegin = true ;
m_dwCallJT = GetTickCount ( ) ;
m_lCallStatus = 1 ; //ͨ<> <CDA8> ״̬<D7B4> 仯<EFBFBD> ѽ<EFBFBD>
m_S_CallStatus . SetWindowText ( _T ( " 00:00 " ) ) ;
SetTimer ( 2 , 1000 , NULL ) ;
if ( ! m_bRecord & & m_pMainFrame - > m_Setup . UBox_bAutoRecord ) //δ<> <CEB4> ʼ ¼<CABC> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
//ȡ¼<C8A1> <C2BC> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD>
m_bRecordEnd = false ; //δ¼<CEB4> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
TCHAR szPath [ 512 ] = { 0 } ;
m_pMainFrame - > GetCurrentPath ( szPath ) ;
_tcscat ( szPath , _T ( " Record " ) ) ;
: : CreateDirectory ( szPath , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> ȴ<EFBFBD> <C8B4> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD>
SYSTEMTIME t ; : : GetLocalTime ( & t ) ;
m_strRecordName . Format ( _T ( " %s \\ %04d%02d%02d%02d%02d%02d%d.mp3 " ) , szPath , t . wYear , t . wMonth , t . wDay , t . wHour , t . wMinute , t . wSecond , t . wMilliseconds ) ;
m_pMainFrame - > m_ubox_stop_record ( m_pMainFrame - > m_ubox_endHandle ) ;
//CODER_ALAW
//CODER_MP3
# ifdef _UNICODE
int iRet = m_pMainFrame - > m_ubox_record_file ( m_pMainFrame - > m_ubox_endHandle , CW2A ( m_strRecordName ) , CODER_ALAW ) ;
# else
int iRet = m_pMainFrame - > m_ubox_record_file ( m_pMainFrame - > m_ubox_endHandle , m_strRecordName , CODER_MP3 ) ;
# endif
if ( iRet = = 0 )
{
m_bRecord = true ;
}
}
# endif
}
void DLG_UBoxPop : : SetCallCount ( long lCount )
{
this - > m_lCallingCount = lCount ;
}
void DLG_UBoxPop : : SetCallWay ( long lCallWay )
{
m_lCallWay = lCallWay ;
}
void DLG_UBoxPop : : Call_Upload ( void )
{
UpdateData ( true ) ;
REQ_UBox_UpLoad * pUpload = new REQ_UBox_UpLoad ;
memset ( pUpload , 0 , sizeof ( REQ_UBox_UpLoad ) ) ;
pUpload - > callLog . lUBoxLogID = m_lUBoxLogID ;
pUpload - > lCorpID = m_pMainFrame - > m_lCorpID ;
pUpload - > lUserID = m_pMainFrame - > m_lUserID ;
pUpload - > lTickCount = m_lTickCount ;
pUpload - > callLog . lCorpID = pUpload - > lCorpID ;
pUpload - > callLog . lUserID = pUpload - > lUserID ;
_tcscpy ( pUpload - > callLog . szUserName , m_pMainFrame - > m_pCurUser - > szUser ) ;
pUpload - > callLog . lCallStatus = m_lCallStatus ;
pUpload - > callLog . lCallWay = m_lCallWay ;
pUpload - > callLog . tCallTime = m_tCallTime ;
_tcscpy ( pUpload - > callLog . szCallLocal , this - > m_strCall_NumberLocal ) ;
_tcscpy ( pUpload - > callLog . szCallNumber , m_strNumber ) ;
pUpload - > callLog . lCallSC = m_lCallSC ;
if ( m_bSaveCallPro )
{
_tcscpy ( pUpload - > callLog . szCallType , m_strCallType ) ;
_tcscpy ( pUpload - > callLog . szCallBZ , m_strCall_BZ ) ;
}
pUpload - > callLog . lKHAddressType = m_lAddressType ;
pUpload - > callLog . lKHUserID = m_lUserID ;
_tcscpy ( pUpload - > callLog . szKHName , m_strKH_Name ) ;
_tcscpy ( pUpload - > callLog . szKHLTD , m_strKH_LTD ) ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_UPLOAD , ( BYTE * ) pUpload , sizeof ( REQ_UBox_UpLoad ) ) ;
SetTimer ( 8 , 30000 , NULL ) ; //30<33> <30> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD>
}
void DLG_UBoxPop : : OnBnClickedOk ( )
{
m_bSaveCallPro = true ; //<2F> <> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
UpdateData ( true ) ;
if ( m_bAddressYModify ) //<2F> <> <EFBFBD> Ĺ<DEB8> ͨѶ¼
{
CString str ;
if ( m_bAddressModify & & m_lAddressType = = 1 & & m_lUserID > 0 ) //˽<> <CBBD> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD>
{
str . Format ( _T ( " Update paddress set Name='%s',Ltd='%s',Job='%s',Mobile='%s',Tel='%s',BZ='%s' where UserID=%d " ) , SqlStr ( m_strKH_Name ) , SqlStr ( m_strKH_LTD ) , SqlStr ( m_strKH_Job ) , SqlStr ( m_strKH_Mobile ) , SqlStr ( m_strKH_Tel ) , SqlStr ( m_strKH_BZ ) , m_lUserID ) ;
m_AdoRS . Open ( str ) ;
m_AdoRS . Close ( ) ;
}
if ( m_bAddressModify & & m_lAddressType = = 1 & & m_lUserID < = 0 ) //˽<> <CBBD> ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD>
{
//<2F> <> <EFBFBD> <EFBFBD> ˽<EFBFBD> <CBBD> ͨѶ¼
CString strGroupID = m_strGroupID ;
str . Format ( _T ( " insert into paddress (GroupID,UserType,Name,Ltd,Job,Mobile,Tel,BZ) values ('%s','1','%s','%s','%s','%s','%s','%s') " ) , strGroupID , SqlStr ( m_strKH_Name ) , SqlStr ( m_strKH_LTD ) , SqlStr ( m_strKH_Job ) , SqlStr ( m_strKH_Mobile ) , SqlStr ( m_strKH_Tel ) , SqlStr ( m_strKH_BZ ) , m_lUserID ) ;
m_AdoRS . Open ( str ) ;
str . Format ( _T ( " select top 1 * from paddress order by UserID desc " ) ) ;
if ( m_AdoRS . Open ( str ) & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . GetCollect ( _T ( " UserID " ) , m_lUserID ) ;
}
m_AdoRS . Close ( ) ;
}
}
Call_Upload ( ) ;
CDialogEx : : OnOK ( ) ;
}
void DLG_UBoxPop : : OnBnClickedCancel ( )
{
if ( this - > m_bAddressYModify | | this - > m_bCallYModify )
{
int iRet = 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> " ) , _T ( " <EFBFBD> <EFBFBD> ʾ " ) , MB_ICONQUESTION | MB_YESNO ) ;
if ( iRet = = IDYES )
{
OnBnClickedOk ( ) ;
return ;
}
}
m_bSaveCallPro = false ; //<2F> <> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CDialogEx : : OnCancel ( ) ;
Call_Close ( ) ;
}
void DLG_UBoxPop : : Call_Close ( void )
{
if ( m_bRecordEnd & & m_lUBoxLogID ) //¼<> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
CString strFileName ;
//<2F> <> <EFBFBD> <EFBFBD>
TCHAR szPath [ 512 ] = { 0 } ;
m_pMainFrame - > GetCurrentPath ( szPath ) ;
_tcscat ( szPath , _T ( " Record " ) ) ;
: : CreateDirectory ( szPath , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> ȴ<EFBFBD> <C8B4> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD>
strFileName . Format ( _T ( " %s \\ %d.mp3 " ) , szPath , m_lUBoxLogID ) ;
//<2F> <> <EFBFBD> и<EFBFBD> <D0B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( strFileName ! = m_strRecordName )
{
MoveFile ( m_strRecordName , strFileName ) ;
m_strRecordName = strFileName ;
if ( m_pMainFrame - > m_Setup . UBox_lReocrdDel > 0 & & this - > m_lCallSC < m_pMainFrame - > m_Setup . UBox_lReocrdDel ) //<2F> <> <EFBFBD> Ȳ<EFBFBD> <C8B2> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE>
{
: : DeleteFile ( m_strRecordName ) ;
}
else
{
m_pMainFrame - > UBox_AddUploadRecordFile ( m_lUBoxLogID , m_strRecordName ) ;
}
}
}
if ( m_bCallEnd & & ! IsWindowVisible ( ) )
{
//ͨ<> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҵ<EFBFBD> <D2B4> ڹرգ <D8B1> <D5A3> <EFBFBD> <EFBFBD> Խ<EFBFBD> <D4BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pMainFrame - > uboxPop_Del ( this ) ;
OnCancel ( ) ;
}
}
void DLG_UBoxPop : : OnCancel ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> ר<EFBFBD> ô<EFBFBD> <C3B4> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD>
//CDialogEx::OnCancel();
DestroyWindow ( ) ;
}
void DLG_UBoxPop : : PostNcDestroy ( )
{
CDialogEx : : PostNcDestroy ( ) ;
delete this ;
}
void DLG_UBoxPop : : SetCallBeginTime ( long lBeginTime )
{
m_lBeginTime = lBeginTime ;
}
void DLG_UBoxPop : : OnBnClickedUboxpopCallResms ( )
{
m_SmsDY . RemoveAll ( ) ;
CMenu menu ;
menu . CreatePopupMenu ( ) ;
long lMaxPopMenu = 32 ;
CMenu popMenu [ 32 ] ;
CString str ;
str . Format ( _T ( " Select * from smsdytype " ) ) ;
m_AdoRS . Open ( str ) ;
long lIndex = 0 ;
long lItemCount = 0 ;
while ( ! m_AdoRS . IsEOF ( ) & & lIndex < lMaxPopMenu )
{
CString strType ;
long lDYID ;
m_AdoRS . GetCollect ( _T ( " Title " ) , strType ) ;
m_AdoRS . GetCollect ( _T ( " DYID " ) , lDYID ) ;
popMenu [ lIndex ] . CreatePopupMenu ( ) ;
menu . AppendMenu ( MF_STRING | MF_POPUP , ( UINT ) popMenu [ lIndex ] . GetSafeHmenu ( ) , strType ) ;
str . Format ( _T ( " Select * from smsdy where Type='%d' " ) , lDYID ) ;
m_AdoRS2 . Open ( str ) ;
while ( ! m_AdoRS2 . IsEOF ( ) )
{
CString strMsg ;
m_AdoRS2 . GetCollect ( _T ( " Msg " ) , strMsg ) ;
if ( strMsg . GetLength ( ) > 0 )
{
m_SmsDY . Add ( strMsg ) ;
popMenu [ lIndex ] . AppendMenu ( MF_STRING , UBOXPOP_SMSDY_BEGIN + lItemCount , strMsg ) ;
lItemCount + + ;
}
m_AdoRS2 . MoveNext ( ) ;
}
m_AdoRS . MoveNext ( ) ;
lIndex + + ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
menu . AppendMenu ( MF_STRING , UBOXPOP_SMSDY_OTHER , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
menu . AppendMenu ( MF_STRING , UBOXPOP_SMSDY_MANAGER , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ö<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
CRect rect ;
GetDlgItem ( IDD_UBOXPOP_CALL_RESMS ) - > GetWindowRect ( & rect ) ;
//this->ClientToScreen(&rect);
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
menu . TrackPopupMenu ( TPM_RIGHTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON , rect . right , rect . bottom , this , NULL ) ;
menu . DestroyMenu ( ) ;
}