CorpSms/DLG_UBoxLog_See.cpp
2025-02-27 16:58:16 +08:00

392 lines
9.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// DLG_UBoxLog_See.cpp : implementation file
//
#include "stdafx.h"
#include "corpsms.h"
#include "DLG_UBoxLog_See.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DLG_UBoxLog_See dialog
#include "MainFrm.h"
#include "DLG_UserSelect.h"
#include "FUBoxLog.h"
DLG_UBoxLog_See::DLG_UBoxLog_See(CWnd* pParent /*=NULL*/)
: CDialog(DLG_UBoxLog_See::IDD, pParent)
{
//{{AFX_DATA_INIT(DLG_UBoxLog_See)
m_strCallNum = _T("");
m_strCallTime = _T("");
// m_strKH_Addr = _T("");
m_strKH_LTD = _T("");
// m_strKH_Mobile = _T("");
m_strKH_Name = _T("");
// m_strKH_Tel = _T("");
// m_strSendSms = _T("");
// m_strYWY_Mobile = _T("");
// m_strYWY_Name = _T("");
// m_strStatus = _T("");
//}}AFX_DATA_INIT
m_pCFUBoxLog = (CFUBoxLog *)pParent;
m_bNewCall = false;
memset(&m_UBox,0,sizeof(m_UBox));
m_strCallBZ = _T("");
m_strCallLocal = _T("");
m_strCallStatus = _T("");
m_strCallType = _T("");
m_strCallWay = _T("");
m_strName = _T("");
m_strCallSC = _T("");
m_bModify = false;
}
void DLG_UBoxLog_See::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DLG_UBoxLog_See)
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLNUM, m_strCallNum);
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLTIME, m_strCallTime);
DDX_Text(pDX, IDD_UBOXLOG_SEE_KH_LTD, m_strKH_LTD);
DDX_Text(pDX, IDD_UBOXLOG_SEE_KH_NAME, m_strKH_Name);
//}}AFX_DATA_MAP
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLBZ, m_strCallBZ);
DDV_MaxChars(pDX, m_strCallBZ, 500);
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLLOCAL, m_strCallLocal);
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLSTATUS, m_strCallStatus);
DDX_CBString(pDX, IDD_UBOXLOG_SEE_CALLTYPE, m_strCallType);
DDV_MaxChars(pDX, m_strCallType, 30);
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLWAY, m_strCallWay);
DDX_Text(pDX, IDD_UBOXLOG_SEE_NAME, m_strName);
DDX_Control(pDX, IDD_UBOXLOG_SEE_CALLTYPE, m_L_CallType);
DDX_Text(pDX, IDD_UBOXLOG_SEE_CALLSC, m_strCallSC);
}
BEGIN_MESSAGE_MAP(DLG_UBoxLog_See, CDialog)
//{{AFX_MSG_MAP(DLG_UBoxLog_See)
ON_BN_CLICKED(IDD_UBOXLOG_SEE_YWY_SEL, OnUboxlogSeeYwySel)
ON_BN_CLICKED(IDD_UBOXLOG_SEE_SENDSMS_CREATE, OnUboxlogSeeSendsmsCreate)
ON_BN_CLICKED(IDD_UBOXLOG_SEE_SENDSMS_SEND, OnUboxlogSeeSendsmsSend)
ON_WM_CLOSE()
ON_WM_TIMER()
ON_WM_MOUSEACTIVATE()
ON_WM_LBUTTONDOWN()
ON_WM_NCLBUTTONDOWN()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDOK, &DLG_UBoxLog_See::OnBnClickedOk)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLG_UBoxLog_See message handlers
void DLG_UBoxLog_See::OnOK()
{
CDialog::OnOK();
}
ANS_UBox_CallLog DLG_UBoxLog_See::GetParam()
{
return m_UBox;
}
void DLG_UBoxLog_See::SetParam(ANS_UBox_CallLog ubox,BOOL bMoidfy)
{
m_UBox = ubox;
m_bModify = bMoidfy;
}
void DLG_UBoxLog_See::SetCallType(CCallType & callType)
{
m_CallType.Copy(callType);
}
BOOL DLG_UBoxLog_See::OnInitDialog()
{
CDialog::OnInitDialog();
m_strCallNum = m_UBox.szCallNumber;
m_strCallTime.Format(_T("%04d.%02d.%02d %02d:%02d") , m_UBox.tCallTime.wYear,m_UBox.tCallTime.wMonth,m_UBox.tCallTime.wDay,m_UBox.tCallTime.wHour,m_UBox.tCallTime.wMinute);
if ( m_UBox.lCallWay==0 )
m_strCallWay = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
else
m_strCallWay = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
if ( m_UBox.lCallStatus==0 )
m_strCallStatus= _T("δ<EFBFBD><EFBFBD>");
else
m_strCallStatus = _T("<EFBFBD>ѽ<EFBFBD>");
m_strCallLocal = m_UBox.szCallLocal;
m_strKH_Name = m_UBox.szKHName;
m_strKH_LTD = m_UBox.szKHLTD;
m_strName = m_UBox.szUserName;
m_strCallType = m_UBox.szCallType;
m_strCallBZ = m_UBox.szCallBZ;
COleDateTimeSpan span(0,0,0,m_UBox.lCallSC);
m_strCallSC.Format(_T("%02d:%02d:%02d"),span.GetHours(),span.GetMinutes(),span.GetSeconds());
if ( m_bModify )
{
GetDlgItem(IDD_UBOXLOG_SEE_CALLTYPE)->EnableWindow(true);
((CEdit*)GetDlgItem(IDD_UBOXLOG_SEE_CALLBZ))->SetReadOnly(false);
}
UpdateData(false);
long lCount = m_CallType.GetCount();
for ( int i=0 ; i<lCount ; i++ )
{
m_L_CallType.AddString(m_CallType[i].szType);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DLG_UBoxLog_See::OnUboxlogSeeYwySel()
{
}
void DLG_UBoxLog_See::OnUboxlogSeeSendsmsCreate()
{
}
void DLG_UBoxLog_See::OnUboxlogSeeSendsmsSend()
{
return ;
/*
UpdateData(true);
if ( !::isMobileNum(m_strYWY_Mobile,m_strYWY_Mobile.GetLength()) )
{
MessageBox(_T("ҵ<><D2B5>Ա<EFBFBD><D4B1>Ŀ<EFBFBD><C4BF><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>!"), _T("<22><><EFBFBD><EFBFBD>") , MB_ICONWARNING );
GetDlgItem(IDD_UBOXLOG_SEE_YWY_SEL)->SetFocus();
return;
}
if ( m_strSendSms.GetLength()<=0 )
{
MessageBox(_T("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>·<EFBFBD><C2B7>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>") , _T("<22><><EFBFBD><EFBFBD>") , MB_ICONWARNING );
GetDlgItem(IDD_UBOXLOG_SEE_SENDSMS)->SetFocus();
return;
}
/*
#ifdef SUPPER_IM_MAS
if ( this->m_pCFUBoxLog->m_pMainFrame->m_pFuncView->m_DLGSend.Mas_OK() && !_tcscmp(sms.szRecvNum,_T("Mas")) ) //MAS<41><53><EFBFBD><EFBFBD>
{
CString strMobile=m_strYWY_Mobile;
CString strMsg=m_strSendSms;
CString strSendTime;
long lSmID=0; //<2F><>+ʱ+<2B><>+<2B><><EFBFBD><EFBFBD>
long lSrcID=0;
int iRet = (*this->m_pCFUBoxLog->m_pMainFrame->m_pFuncView->m_DLGSend.m_Mas_sendSMAdvTime)(strMobile, strMsg,strSendTime, lSmID,lSrcID);
}
else
#endif
*/
/*
{
//<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>Ͷ<EFBFBD><CDB6>Ŷ<EFBFBD><C5B6><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>
ANS_SendData2 * pTemp = new ANS_SendData2[5];
memset( pTemp , 0 , sizeof(ANS_SendData2)*5 );
long lSendCount=0;
TCHAR szSendMsg[512]={0};
TCHAR szSendMsg2[512]={0};
//<2F>ָ<EFBFBD><D6B8><EFBFBD>Ϣ
long lMaxMsgLen = this->m_pCFUBoxLog->m_pMainFrame->GetMaxSendMsgLen(); //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
CString strCM;
BOOL bCMFirst = this->m_pCFUBoxLog->m_pMainFrame->GetQJCM(strCM);
long lMsgAll=0;
long lMsgIndex = 1;
BOOL bGetMsg;
_tcscpy( szSendMsg , m_strSendSms ); //<2F><><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>Ϣ
TCHAR szSendNum[32]={0};
_tcscpy( szSendNum , m_strYWY_Mobile ); //<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
while ( true )
{
memset( szSendMsg2 , 0 , sizeof(szSendMsg2) );
if ( !_tcsncmp( szSendNum , _T("12") , 2 ) ||
!_tcsncmp( szSendNum , _T("13") , 2 ) ||
!_tcsncmp( szSendNum , _T("15") , 2 ) ||
!_tcsncmp( szSendNum , _T("14") , 2 ) ||
!_tcsncmp( szSendNum , _T("16") , 2 ) ||
!_tcsncmp( szSendNum , _T("17") , 2 ) ||
!_tcsncmp( szSendNum , _T("18") , 2 ) ||
!_tcsncmp( szSendNum , _T("19") , 2 ))
{
//<2F>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>70<37><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//if ( isChinese( m_szSendMsg,_tcslen(szSendMsg) ) )
//{
bGetMsg = GetSpiltUnicodeMsg( szSendMsg , szSendMsg2 , lMsgIndex , lMaxMsgLen ,lMsgAll);
//}
//else
//{
// bGetMsg = GetSpiltAsciiMsg( szSendMsg , szSendMsg2 , lMsgIndex , lMaxMsgLen*2+lMaxMsgLen*2/7 ,lMsgAll);
//}
}
else
{
//С<><D0A1>ͨ<EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>58<35><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//if ( isChinese( m_szSendMsg,_tcslen(szSendMsg) ) )
//{
bGetMsg = GetSpiltUnicodeMsg( szSendMsg , szSendMsg2 , lMsgIndex , lMaxMsgLen-12 ,lMsgAll);
//}
//else
//{
// bGetMsg = GetSpiltAsciiMsg( szSendMsg , szSendMsg2 , lMsgIndex , MOBILE_TYPE_PHS_MAXLEN ,lMsgAll);
//}
}
if ( bGetMsg ) //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
pTemp[lSendCount].lCorpID = this->m_pCFUBoxLog->m_pMainFrame->m_lCorpID;
pTemp[lSendCount].lUserID = this->m_pCFUBoxLog->m_pMainFrame->m_lUserID;
pTemp[lSendCount].lItem = 0;
pTemp[lSendCount].lItemID = 0; //ItemID;
if ( bCMFirst )
_stprintf( pTemp[lSendCount].szMsg ,_T("%s%s") , strCM,szSendMsg2);
else
_stprintf( pTemp[lSendCount].szMsg ,_T("%s%s") , szSendMsg2,strCM);
_tcscpy( pTemp[lSendCount].szName , _T("") );
_tcscpy( pTemp[lSendCount].szMobile , szSendNum);
lSendCount ++; //<2F><>¼<EFBFBD>ż<EFBFBD>1
lMsgIndex ++; //<2F>ָ<EFBFBD><D6B8><EFBFBD>1
}
else
{
break;
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
if ( lSendCount > 0 )
{
//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD>
long lSize = sizeof(REQ_Send2)+sizeof(ANS_SendData2)*lSendCount;
BYTE * pData = new BYTE[lSize];
REQ_Send2 * pSendSend = (REQ_Send2 *)pData;
ANS_SendData2 * pDataSend = (ANS_SendData2 *)(pData + sizeof(REQ_Send2));
pSendSend->lCount = lSendCount;
//<2F><><EFBFBD><EFBFBD>
memcpy( pDataSend , pTemp , sizeof(ANS_SendData2)*lSendCount );
this->m_pCFUBoxLog->m_pMainFrame->SendFrame( SMSFUNC_SEND2 , pData , lSize );
}
delete pTemp; //ɾ<><C9BE><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
}
*/
}
void DLG_UBoxLog_See::OnClose()
{
CDialog::OnClose();
}
void DLG_UBoxLog_See::OnTimer(UINT nIDEvent)
{
/*
if ( nIDEvent == 1 )
{
this->FlashWindow(true);
this->m_pCFUBoxLog->m_pMainFrame->FlashWindow(true);
}
if ( nIDEvent == 2 ) //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ش˴<D8B4><CBB4><EFBFBD>
{
KillTimer(nIDEvent);
CDialog::OnCancel();
}
*/
CDialog::OnTimer(nIDEvent);
}
int DLG_UBoxLog_See::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
int i= CDialog::OnMouseActivate(pDesktopWnd, nHitTest, message);
if ( this->m_bNewCall )
{
KillTimer(1); //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
KillTimer(2); //ȡ<><C8A1><EFBFBD>Զ<EFBFBD><D4B6>ر<EFBFBD>
}
return i;
}
void DLG_UBoxLog_See::OnLButtonDown(UINT nFlags, CPoint point)
{
CDialog::OnLButtonDown(nFlags, point);
if ( this->m_bNewCall )
{
KillTimer(1); //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
KillTimer(2); //ȡ<><C8A1><EFBFBD>Զ<EFBFBD><D4B6>ر<EFBFBD>
}
}
void DLG_UBoxLog_See::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
CDialog::OnNcLButtonDown(nHitTest, point);
if ( this->m_bNewCall )
{
KillTimer(1); //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
KillTimer(2); //ȡ<><C8A1><EFBFBD>Զ<EFBFBD><D4B6>ر<EFBFBD>
}
}
void DLG_UBoxLog_See::SetUBoxStatus(long lStatus)
{
}
void DLG_UBoxLog_See::OnDestroy()
{
CDialog::OnDestroy();
}
void DLG_UBoxLog_See::OnCancel()
{
CDialog::OnCancel();
}
void DLG_UBoxLog_See::OnBnClickedOk()
{
if ( m_bModify )
{
if ( !UpdateData(true))
return ;
_tcscpy(m_UBox.szCallBZ , m_strCallBZ);
_tcscpy(m_UBox.szCallType , m_strCallType);
CDialog::OnOK();
return ;
}
CDialog::OnCancel();
}