升龙物业 老版本 ocx IPO, 加密狗 转值班电话

AgentMap.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #include "stdafx.h"
  2. #include "AgentMap.h"
  3. CAgentMap* CAgentMap::AgentMap = NULL;
  4. /*
  5. * 函数名称:CAgentMap()
  6. * 概要分析:构造函数
  7. */
  8. CAgentMap::CAgentMap()
  9. {
  10. }
  11. /*
  12. * 函数名称:~CAgentMap()
  13. * 概要分析:析构函数
  14. */
  15. CAgentMap::~CAgentMap()
  16. {
  17. }
  18. /*
  19. * 函数名称:GetInstance()
  20. * 概要分析:返回单例指针
  21. */
  22. CAgentMap* CAgentMap::GetInstance()
  23. {
  24. if( AgentMap == NULL )
  25. {
  26. AgentMap = new CAgentMap();
  27. }
  28. return AgentMap;
  29. }
  30. /*
  31. * 函数名称:GetPromptByAgentState(int)
  32. * 概要分析:返回座席状态的中文含义
  33. */
  34. CString CAgentMap::GetPromptByAgentState(int a_nAgentState)
  35. {
  36. int AgentStateMapLength = (sizeof(AgentStatusMapTable))/(sizeof(stMapTable));
  37. int i = 0;
  38. for( i=0; i<AgentStateMapLength; i++ )
  39. {
  40. if( AgentStatusMapTable[i].codeId == a_nAgentState )
  41. {
  42. return AgentStatusMapTable[i].codeInfo;
  43. }
  44. }
  45. return "";
  46. }
  47. /*
  48. * 函数名称:GetPromptByLineState(int)
  49. * 概要分析:返回线路状态的中文含义
  50. */
  51. CString CAgentMap::GetPromptByLineState(int a_nLineState)
  52. {
  53. int LineStateMapLength = (sizeof(LineStatusMapTable))/(sizeof(stMapTable));
  54. int i = 0;
  55. for( i=0; i<LineStateMapLength; i++ )
  56. {
  57. if( LineStatusMapTable[i].codeId == a_nLineState )
  58. {
  59. return LineStatusMapTable[i].codeInfo;
  60. }
  61. }
  62. return "";
  63. }
  64. /*
  65. * 函数名称:GetPromptByLinkState(int)
  66. * 概要分析:返回连接服务器状态的中文含义
  67. */
  68. CString CAgentMap::GetPromptByLinkState(int a_nLinkState)
  69. {
  70. int LinkStateMapLength = (sizeof(LinkStatusMapTable))/(sizeof(stMapTable));
  71. int i = 0;
  72. for( i=0; i<LinkStateMapLength; i++ )
  73. {
  74. if( LinkStatusMapTable[i].codeId == a_nLinkState )
  75. {
  76. return LinkStatusMapTable[i].codeInfo;
  77. }
  78. }
  79. return "";
  80. }
  81. /*
  82. * 函数名称:GetPromptByErrorCode(int)
  83. * 概要分析:返回指定操作码的中文含义
  84. */
  85. CString CAgentMap::GetPromptByErrorCode(int a_nErrorCode)
  86. {
  87. int ErrorCodeMapLength = (sizeof(ErrorCodeMapTable))/(sizeof(stMapTable));
  88. int i = 0;
  89. char tmpStr[128];
  90. sprintf_s( tmpStr, 128, "%d--%d", ErrorCodeMapLength, a_nErrorCode );
  91. for( i=0; i<ErrorCodeMapLength; i++ )
  92. {
  93. if( ErrorCodeMapTable[i].codeId == a_nErrorCode )
  94. {
  95. return ErrorCodeMapTable[i].codeInfo;
  96. }
  97. }
  98. return "";
  99. }