| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #include "stdafx.h"
- #include "AgentMap.h"
- CAgentMap* CAgentMap::AgentMap = NULL;
- /*
- * 函数名称:CAgentMap()
- * 概要分析:构造函数
- */
- CAgentMap::CAgentMap()
- {
- }
- /*
- * 函数名称:~CAgentMap()
- * 概要分析:析构函数
- */
- CAgentMap::~CAgentMap()
- {
- }
- /*
- * 函数名称:GetInstance()
- * 概要分析:返回单例指针
- */
- CAgentMap* CAgentMap::GetInstance()
- {
- if( AgentMap == NULL )
- {
- AgentMap = new CAgentMap();
- }
- return AgentMap;
- }
- /*
- * 函数名称:GetPromptByAgentState(int)
- * 概要分析:返回座席状态的中文含义
- */
- CString CAgentMap::GetPromptByAgentState(int a_nAgentState)
- {
- int AgentStateMapLength = (sizeof(AgentStatusMapTable))/(sizeof(stMapTable));
- int i = 0;
-
- for( i=0; i<AgentStateMapLength; i++ )
- {
- if( AgentStatusMapTable[i].codeId == a_nAgentState )
- {
- return AgentStatusMapTable[i].codeInfo;
- }
- }
- return "";
- }
- /*
- * 函数名称:GetPromptByLineState(int)
- * 概要分析:返回线路状态的中文含义
- */
- CString CAgentMap::GetPromptByLineState(int a_nLineState)
- {
- int LineStateMapLength = (sizeof(LineStatusMapTable))/(sizeof(stMapTable));
- int i = 0;
- for( i=0; i<LineStateMapLength; i++ )
- {
- if( LineStatusMapTable[i].codeId == a_nLineState )
- {
- return LineStatusMapTable[i].codeInfo;
- }
- }
- return "";
- }
- /*
- * 函数名称:GetPromptByLinkState(int)
- * 概要分析:返回连接服务器状态的中文含义
- */
- CString CAgentMap::GetPromptByLinkState(int a_nLinkState)
- {
- int LinkStateMapLength = (sizeof(LinkStatusMapTable))/(sizeof(stMapTable));
- int i = 0;
- for( i=0; i<LinkStateMapLength; i++ )
- {
- if( LinkStatusMapTable[i].codeId == a_nLinkState )
- {
- return LinkStatusMapTable[i].codeInfo;
- }
- }
- return "";
- }
- /*
- * 函数名称:GetPromptByErrorCode(int)
- * 概要分析:返回指定操作码的中文含义
- */
- CString CAgentMap::GetPromptByErrorCode(int a_nErrorCode)
- {
- int ErrorCodeMapLength = (sizeof(ErrorCodeMapTable))/(sizeof(stMapTable));
- int i = 0;
- char tmpStr[128];
- sprintf_s( tmpStr, 128, "%d--%d", ErrorCodeMapLength, a_nErrorCode );
- for( i=0; i<ErrorCodeMapLength; i++ )
- {
- if( ErrorCodeMapTable[i].codeId == a_nErrorCode )
- {
- return ErrorCodeMapTable[i].codeInfo;
- }
- }
- return "";
- }
|