You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.5 KiB

  1. using OT.COM.SignalerMessage;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Text;
  7. namespace CounsellorBL
  8. {
  9. public class MessageBase
  10. {
  11. protected string _getCustomData(CRequestMessage i_joRequest, string i_sKey)
  12. {
  13. string sRes = null;
  14. if(i_joRequest.CUSTOMDATA != null && i_joRequest.CUSTOMDATA.ContainsKey(i_sKey) == true)
  15. {
  16. sRes = i_joRequest.CUSTOMDATA[i_sKey];
  17. }
  18. return sRes;
  19. }
  20. protected string _fetchString(CRequestMessage i_joRequest, string i_sKey)
  21. {
  22. return _fetchString(i_joRequest.DATA, i_sKey);
  23. }
  24. protected string _fetchString(Dictionary<string, object> i_dic, string i_sKey)
  25. {
  26. string sRes = null;
  27. if (true == i_dic.ContainsKey(i_sKey))
  28. {
  29. object obj = i_dic[i_sKey];
  30. if (null != obj)
  31. {
  32. sRes = obj.ToString();
  33. }
  34. }
  35. return sRes;
  36. }
  37. protected string _getKeyStr(Dictionary<string, object> i_dic, string i_sKey)
  38. {
  39. string sRes = "";
  40. if (true == i_dic.ContainsKey(i_sKey))
  41. {
  42. object obj = i_dic[i_sKey];
  43. if (null != obj)
  44. {
  45. sRes = obj.ToString();
  46. }
  47. }
  48. return sRes;
  49. }
  50. }
  51. }