SmsUserInfo.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Xml;
  7. namespace LYFZ.BakMandaoSmsInterface
  8. {
  9. /// <summary>
  10. /// 用户查询返回信息
  11. /// </summary>
  12. public class SmsUserInfo
  13. {
  14. public SmsUserInfo(string userInfoStr,string uid) {
  15. /*
  16. <returnsms>
  17. <returnstatus>Sucess</returnstatus>
  18. <message/>
  19. <payinfo>预付费</payinfo>
  20. <overage>97</overage>
  21. <sendTotal>100</sendTotal>
  22. </returnsms>
  23. */
  24. this.SourceString = userInfoStr;
  25. if (userInfoStr != "")
  26. {
  27. System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
  28. xml.LoadXml(userInfoStr);
  29. XmlNode xmlReturnstatusNode = xml.SelectSingleNode("//returnsms//returnstatus");
  30. if (xmlReturnstatusNode.InnerText.ToLower() == "Sucess".ToLower())
  31. {
  32. XmlNode xmlNode = xml.SelectSingleNode("//returnsms//overage");
  33. try
  34. {
  35. this.ReturnStatus = SendSmsResults.GetResults("000");
  36. try
  37. {
  38. this.Balance = xmlNode.InnerText;
  39. }
  40. catch { }
  41. }
  42. catch { this.ReturnStatus = userInfoStr; }
  43. }
  44. try
  45. {
  46. this.Username = uid;
  47. }
  48. catch { this.ReturnStatus = userInfoStr; }
  49. try
  50. {
  51. this.Price =0;
  52. }
  53. catch { }
  54. try
  55. {
  56. this.SMSCharacterCount =70;
  57. }
  58. catch { }
  59. try
  60. {
  61. this.Signatures = "";
  62. }
  63. catch { }
  64. try
  65. {
  66. this.VoiceMessagingPrice = 0;
  67. }
  68. catch { }
  69. try
  70. {
  71. this.FaxMessagingPrice =0;
  72. }
  73. catch { }
  74. try
  75. {
  76. this.MMSPrice =0;
  77. }
  78. catch { }
  79. }
  80. }
  81. private string _SourceString = "";
  82. /// <summary>
  83. /// 源字符串
  84. /// </summary>
  85. public string SourceString
  86. {
  87. get { return _SourceString; }
  88. set { _SourceString = value; }
  89. }
  90. private string _Username="";
  91. private string _Balance="";
  92. private decimal _Price=0m;
  93. private int _SMSCharacterCount=0;
  94. private string _Signatures="";
  95. private decimal _VoiceMessagingPrice=0m;
  96. private decimal _FaxMessagingPrice=0m;
  97. private decimal _MMSPrice = 0m;
  98. private string _OwnedOperators = "北京漫道(备用)";
  99. string _ReturnStatus="";
  100. /// <summary>
  101. /// 返回状态
  102. /// </summary>
  103. public string ReturnStatus
  104. {
  105. get { return _ReturnStatus; }
  106. set { _ReturnStatus = value; }
  107. }
  108. ///<summary>
  109. ///用户名
  110. ///</summary>
  111. public string Username
  112. {
  113. get { return _Username; }
  114. set { _Username = value; }
  115. }
  116. ///<summary>
  117. ///余额
  118. ///</summary>
  119. public string Balance
  120. {
  121. get { return _Balance; }
  122. set { _Balance = value; }
  123. }
  124. ///<summary>
  125. ///单价
  126. ///</summary>
  127. public decimal Price
  128. {
  129. get { return _Price; }
  130. set { _Price = value; }
  131. }
  132. ///<summary>
  133. ///短信字符数
  134. ///</summary>
  135. public int SMSCharacterCount
  136. {
  137. get { return _SMSCharacterCount; }
  138. set { _SMSCharacterCount = value; }
  139. }
  140. ///<summary>
  141. ///签名
  142. ///</summary>
  143. public string Signatures
  144. {
  145. get {
  146. return _Signatures; }
  147. set { _Signatures = value; }
  148. }
  149. ///<summary>
  150. ///语音短信单价
  151. ///</summary>
  152. public decimal VoiceMessagingPrice
  153. {
  154. get { return _VoiceMessagingPrice; }
  155. set { _VoiceMessagingPrice = value; }
  156. }
  157. /// <summary>
  158. /// 传真短信单价
  159. /// </summary>
  160. public decimal FaxMessagingPrice
  161. {
  162. get { return _FaxMessagingPrice; }
  163. set { _FaxMessagingPrice = value; }
  164. }
  165. ///<summary>
  166. ///彩信单价
  167. ///</summary>
  168. public decimal MMSPrice
  169. {
  170. get { return _MMSPrice; }
  171. set { _MMSPrice = value; }
  172. }
  173. ///<summary>
  174. ///所属经营商
  175. ///</summary>
  176. public string OwnedOperators
  177. {
  178. get { return _OwnedOperators; }
  179. set { _OwnedOperators = value; }
  180. }
  181. }
  182. }