141 lines
3.6 KiB
C++
141 lines
3.6 KiB
C++
// DLG_UBox_UserLog.cpp : 实现文件
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "CorpSms.h"
|
|
#include "DLG_UBox_UserLog.h"
|
|
#include "afxdialogex.h"
|
|
#include "FUBoxLog.h"
|
|
|
|
|
|
// DLG_UBox_UserLog 对话框
|
|
|
|
IMPLEMENT_DYNAMIC(DLG_UBox_UserLog, CDialogEx)
|
|
|
|
DLG_UBox_UserLog::DLG_UBox_UserLog(CWnd* pParent /*=NULL*/)
|
|
: CDialogEx(DLG_UBox_UserLog::IDD, pParent)
|
|
{
|
|
|
|
m_pGetLog2 = NULL;
|
|
m_pCallLog = NULL;
|
|
|
|
}
|
|
|
|
DLG_UBox_UserLog::~DLG_UBox_UserLog()
|
|
{
|
|
}
|
|
|
|
void DLG_UBox_UserLog::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialogEx::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_UBOX_USERLOG_LIST, m_wndList);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(DLG_UBox_UserLog, CDialogEx)
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
// DLG_UBox_UserLog 消息处理程序
|
|
|
|
|
|
BOOL DLG_UBox_UserLog::OnInitDialog()
|
|
{
|
|
CDialogEx::OnInitDialog();
|
|
|
|
// TODO: 在此添加额外的初始化
|
|
|
|
//初始化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("序号,50;处理人,90;方向,60;状态,60;来电号码,100;归属地,100;来电时间,130;通话时长,80;姓名,90;来电单位,150;通话类型,120;备注,200;"));
|
|
|
|
m_wndList.SetGridLines(true);
|
|
m_wndList.SetImageList(&m_Image,LVSIL_SMALL);
|
|
|
|
if ( m_pGetLog2 )
|
|
{
|
|
CString str;
|
|
str.Format(_T("[%s]的通话与跟进记录") , m_pGetLog2->req.szKH_Name );
|
|
SetWindowText(str);
|
|
}
|
|
ShowCallLog();
|
|
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// 异常: OCX 属性页应返回 FALSE
|
|
}
|
|
|
|
void DLG_UBox_UserLog::SetParam(ANS_UBox_GetLog2 * pLog2,ANS_UBox_CallLog * pCallLog)
|
|
{
|
|
m_pGetLog2 = pLog2;
|
|
m_pCallLog = pCallLog;
|
|
|
|
}
|
|
|
|
void DLG_UBox_UserLog::ShowCallLog()
|
|
{
|
|
if ( !m_pGetLog2 )
|
|
return ;
|
|
if ( !m_pCallLog )
|
|
return ;
|
|
|
|
m_wndList.ShowWindow(SW_HIDE);
|
|
m_wndList.DeleteAllItems();
|
|
|
|
for ( int i=0 ; i<m_pGetLog2->lCount ; i++ )
|
|
{
|
|
ShowInList(&m_pCallLog[i],-1,NULL);
|
|
}
|
|
m_wndList.ShowWindow(SW_SHOW);
|
|
}
|
|
|
|
BOOL DLG_UBox_UserLog::ShowInList(ANS_UBox_CallLog * pData,long lItem2,POSITION pos)
|
|
{
|
|
CString str;
|
|
long lItem =lItem2;
|
|
if ( lItem<0 ) //新增
|
|
{
|
|
lItem = m_wndList.GetItemCount();
|
|
str.Format(_T("%d") , lItem+1 );
|
|
m_wndList.InsertItem( lItem , str , CFUBoxLog::GetCallLogIconIndex(pData) );
|
|
m_wndList.SetItemData( lItem , (DWORD_PTR)pos ); //存Pos
|
|
}
|
|
|
|
//m_wndList.SetHeadings(_T("序号,50;处理人,80;方向,60;状态,60;来电号码,100;归属地,100;来电时间,120;通话时长,50;姓名,80;来电单位,130;通话类型,120;备注,200;"));
|
|
|
|
long lTemp11=1;
|
|
m_wndList.SetItemText( lItem , lTemp11++ , pData->szUserName ) ;
|
|
if (pData->lCallWay ==0 )
|
|
m_wndList.SetItemText(lItem,lTemp11++,_T("呼入"));
|
|
else
|
|
m_wndList.SetItemText(lItem,lTemp11++,_T("呼出"));
|
|
|
|
if (pData->lCallStatus ==0 )
|
|
m_wndList.SetItemText(lItem,lTemp11++,_T("未接"));
|
|
else
|
|
m_wndList.SetItemText(lItem,lTemp11++,_T("已接"));
|
|
|
|
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); //通话时间
|
|
|
|
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); //时长
|
|
|
|
m_wndList.SetItemText(lItem,lTemp11++,pData->szKHName); //姓名
|
|
m_wndList.SetItemText(lItem,lTemp11++,pData->szKHLTD); //单位
|
|
m_wndList.SetItemText(lItem,lTemp11++,pData->szCallType); //类型
|
|
m_wndList.SetItemText(lItem,lTemp11++,pData->szCallBZ); //备注
|
|
|
|
return true;
|
|
}
|