// 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("呼入"); else m_strCallWay = _T("呼出"); if ( m_UBox.lCallStatus==0 ) m_strCallStatus= _T("未接"); else m_strCallStatus = _T("已接"); 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 ; iSetFocus(); return; } if ( m_strSendSms.GetLength()<=0 ) { MessageBox(_T("请先输入需要下发的短信内容!") , _T("错误") , 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短信 { CString strMobile=m_strYWY_Mobile; CString strMsg=m_strSendSms; CString strSendTime; long lSmID=0; //日+时+分+序号 long lSrcID=0; int iRet = (*this->m_pCFUBoxLog->m_pMainFrame->m_pFuncView->m_DLGSend.m_Mas_sendSMAdvTime)(strMobile, strMsg,strSendTime, lSmID,lSrcID); } else #endif */ /* { //以下为发送短信而备 //先生成临时存贮空间 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}; //分隔信息 long lMaxMsgLen = this->m_pCFUBoxLog->m_pMainFrame->GetMaxSendMsgLen(); //取允许的最大字符数 CString strCM; BOOL bCMFirst = this->m_pCFUBoxLog->m_pMainFrame->GetQJCM(strCM); long lMsgAll=0; long lMsgIndex = 1; BOOL bGetMsg; _tcscpy( szSendMsg , m_strSendSms ); //发送源信息 TCHAR szSendNum[32]={0}; _tcscpy( szSendNum , m_strYWY_Mobile ); //发送目标号码 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 )) { //手机号码可以支持70个汉字 //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 { //小灵通手机号码可以支持58个汉字 //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 ) //能取到信息,发送 { 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 ++; //记录号加1 lMsgIndex ++; //分隔加1 } else { break; } } //发送信息 if ( lSendCount > 0 ) { //发出指令,发送 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; //内容 memcpy( pDataSend , pTemp , sizeof(ANS_SendData2)*lSendCount ); this->m_pCFUBoxLog->m_pMainFrame->SendFrame( SMSFUNC_SEND2 , pData , lSize ); } delete pTemp; //删除临时变量 } */ } void DLG_UBoxLog_See::OnClose() { CDialog::OnClose(); } void DLG_UBoxLog_See::OnTimer(UINT_PTR nIDEvent) { /* if ( nIDEvent == 1 ) { this->FlashWindow(true); this->m_pCFUBoxLog->m_pMainFrame->FlashWindow(true); } if ( nIDEvent == 2 ) //自动隐藏此窗口 { 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); //取消闪动 KillTimer(2); //取消自动关闭 } return i; } void DLG_UBoxLog_See::OnLButtonDown(UINT nFlags, CPoint point) { CDialog::OnLButtonDown(nFlags, point); if ( this->m_bNewCall ) { KillTimer(1); //取消闪动 KillTimer(2); //取消自动关闭 } } void DLG_UBoxLog_See::OnNcLButtonDown(UINT nHitTest, CPoint point) { CDialog::OnNcLButtonDown(nHitTest, point); if ( this->m_bNewCall ) { KillTimer(1); //取消闪动 KillTimer(2); //取消自动关闭 } } 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(); }