123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LYFZ.WinicSmsInterface
- {
- /// <summary>
- /// Http方式短信发送接口返回信息
- /// </summary>
- public class HTTPSmsSendReturnInfo : LYFZ.StandardInterface.IHTTPSmsSendReturnInfo
- {
- public HTTPSmsSendReturnInfo(string returnInfoStr)
- {
- this.SourceString = returnInfoStr;
- if (!returnInfoStr.ToLower().Contains("/send:"))
- {
- this.SourceString = "-1/Send:0/Consumption:.0/Tmoney:0/sid:0/访问短信服务商服务器失败【HTTPSmsSendReturnInfo错误信息:" + returnInfoStr + "】";
-
- }
- if (returnInfoStr != "")
- {
- string[] returnInfos = this.SourceString.Split('/');
- try
- {
- if (!returnInfoStr.ToLower().Contains("/send:"))
- {
- this.ReturnStatus = returnInfoStr;
- }
- else {
- this.ReturnStatus = SendSmsResults.GetResults(returnInfos[0]);
- this.ReturnCode = returnInfos[0];
- }
- }
- catch { this.ReturnStatus = this.SourceString; }
-
- try
- {
- this.SendCount = Convert.ToInt32(returnInfos[1].Split(':')[1]);
- }
- catch { this.ReturnStatus = this.SourceString; }
-
- try
- {
- this.Consumption = Convert.ToDecimal(returnInfos[2].Split(':')[1]);
- }
- catch { }
- try
- {
- this.Tmoney = Convert.ToDecimal(returnInfos[3].Split(':')[1]);
- }
- catch { }
- try
- {
- this.Sid = returnInfos[4];
- }
- catch { }
-
- }
- }
- private string _SourceString = "";
- /// <summary>
- /// 源字符串
- /// </summary>
- public string SourceString
- {
- get { return _SourceString; }
- set { _SourceString = value; }
- }
- int _SendCount = 0;
- /// <summary>
- /// 发送条数
- /// </summary>
- public int SendCount
- {
- get { return _SendCount; }
- set { _SendCount = value; }
- }
- decimal _Consumption=0m;
- /// <summary>
- /// 当次消费金额
- /// </summary>
- public decimal Consumption
- {
- get { return _Consumption; }
- set { _Consumption = value; }
- }
- decimal _Tmoney = 0m;
- /// <summary>
- /// 总体余额
- /// </summary>
- public decimal Tmoney
- {
- get { return _Tmoney; }
- set { _Tmoney = value; }
- }
- int _RemainingNumber = -1;
- /// <summary>
- /// 总体余额_剩余条数
- /// </summary>
- public int RemainingNumber
- {
- get { return _RemainingNumber; }
- set { _RemainingNumber = value; }
- }
- string _Sid = "";
- /// <summary>
- /// 短信编号
- /// </summary>
- public string Sid
- {
- get { return _Sid; }
- set { _Sid = value; }
- }
- string _ReturnStatus = "";
- /// <summary>
- /// 返回状态 状态码:代码说明
- /// </summary>
- public string ReturnStatus
- {
- get { return _ReturnStatus; }
- set { _ReturnStatus = value; }
- }
- string returnCode = "-12";
- /// <summary>
- /// 返回发送状态码 000 为发送成功,其它为失败
- /// </summary>
- public string ReturnCode
- {
- get { return returnCode; }
- set { returnCode = value; }
- }
- decimal _Price;
- /// <summary>
- /// 单价
- /// </summary>
- public decimal Price
- {
- get {
- try
- {
- this._Price = this._Consumption / _SendCount;
- }
- catch { this._Price = 0m; }
-
- return _Price; }
- }
- string _SendSuccessTel = "";
- /// <summary>
- /// 发送成功的手机号 多个以“,”号分隔
- /// </summary>
- public string SendSuccessTel
- {
- get { return _SendSuccessTel; }
- set { _SendSuccessTel = value; }
- }
- string _SendFaileTel = "";
- /// <summary>
- /// 发送失败的手机号 多个以“,”号分隔
- /// </summary>
- public string SendFaileTel
- {
- get { return _SendFaileTel; }
- set { _SendFaileTel = value; }
- }
- /// <summary>
- /// 短信接口服务商
- /// </summary>
- public string SMSInterface
- {
- get { return "深圳吉信通"; }
- }
- }
- }
|