Пример #1
0
        /// <summary>
        /// 获取单价
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public CallResult GetPrice()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder(20);

            int Result = _GetPrice(UserName, sb);

            CallResult cr = new CallResult(Result);

            if (cr.Code == 0)
            {
                cr.Value = sb.ToString();
            }

            return(cr);
        }
Пример #2
0
    public void Do()
    {
        System.Threading.Thread.Sleep(1000);

        if (Site == null)
        {
            new Log("System").Write("Send SMS: Site is null.");
            Stop();

            return;
        }

        string Betting_SMS_UserID       = Site.SiteOptions["Opt_ISP_UserID"].Value.ToString();
        string Betting_SMS_UserPassword = Site.SiteOptions["Opt_ISP_UserPassword"].Value.ToString();
        string Betting_SMS_RegCode      = Site.SiteOptions["Opt_ISP_RegCode"].Value.ToString();

        if ((Betting_SMS_UserID == "") || (Betting_SMS_UserPassword == ""))
        {
            new Log("System").Write("Send SMS: SMS config error.");
            Stop();

            return;
        }

        SMS.Eucp.Gateway.Gateway segg = new SMS.Eucp.Gateway.Gateway(Betting_SMS_UserID, Betting_SMS_UserPassword);

        if (Betting_SMS_RegCode != "")
        {
            segg.SetKey(Betting_SMS_RegCode);
        }

        SMS.Eucp.Gateway.CallResult Result = segg.Send(Mobile, Body);

        if (Result.Code < 0)
        {
            new Log("System").Write("Send SMS: Send SMS fail." + Result.Description);
            Stop();

            return;
        }

        long NewSMSID = 0;

        DAL.Procedures.P_WriteSMS(Site.ID, -1, "", Mobile, Body, ref NewSMSID);

        Stop();
    }
Пример #3
0
        public CallResult ReceiveStatusReport()
        {
            delegSMSReport mySmsReport = new delegSMSReport(this.sqqK62JCl);
            int            code        = 2;
            int            num2        = 0;

            while (code == 2)
            {
                code = _ReceiveStatusReport(this.name, mySmsReport);
                switch (code)
                {
                case 2:
                case 1:
                    num2++;
                    break;
                }
            }
            CallResult result = new CallResult(code);

            result.Value = num2.ToString();
            return(result);
        }
Пример #4
0
    private void BindData()
    {
        string Betting_SMS_UserID       = _Site.SiteOptions["Opt_ISP_UserID"].Value.ToString();
        string Betting_SMS_UserPassword = _Site.SiteOptions["Opt_ISP_UserPassword"].Value.ToString();

        if ((Betting_SMS_UserID == "") || (Betting_SMS_UserPassword == ""))
        {
            PF.GoError(ErrorNumber.Unknow, "查询短信服务器失败,可能是参数设置错误。", this.GetType().BaseType.FullName);

            return;
        }

        SMS.Eucp.Gateway.Gateway    segg    = new SMS.Eucp.Gateway.Gateway(Betting_SMS_UserID, Betting_SMS_UserPassword);
        SMS.Eucp.Gateway.CallResult Result1 = segg.GetBalance();
        SMS.Eucp.Gateway.CallResult Result2 = segg.GetPrice();

        if (Result1.Code < 0)
        {
            PF.GoError(ErrorNumber.Unknow, "查询短信服务器失败,查询余额时:" + Result1.Description, this.GetType().BaseType.FullName);

            return;
        }

        if (Result2.Code < 0)
        {
            PF.GoError(ErrorNumber.Unknow, "查询短信服务器失败,查询单价时:" + Result2.Description, this.GetType().BaseType.FullName);

            return;
        }

        Label1.Text = Result1.Value + " 元";
        Label2.Text = Result2.Value + " 元/条";
        Label3.Text = "服务商不提供此数据";
        Label4.Text = "服务商不提供此数据";
        Label5.Text = "服务商不提供此数据";

        Label6.Text = "服务商不提供此数据";
    }
Пример #5
0
        /// <summary>
        /// 接收短信报告
        /// </summary>
        /// <returns></returns>
        public CallResult ReceiveStatusReport()
        {
            delegSMSReport mySmsReport = new delegSMSReport(getSMSReport);

            int Result = 2;
            int Count  = 0;

            while (Result == 2) //当result = 2 时,说明还有下一批短信等待接收,这时需重新再调用一次ReceiveStatusReport方法
            {
                Result = _ReceiveStatusReport(UserName, mySmsReport);

                if ((Result == 2) || (Result == 1))
                {
                    Count++;
                }
            }

            CallResult cr = new CallResult(Result);

            cr.Value = Count.ToString();

            return(cr);
        }
Пример #6
0
        public CallResult ReceiveSMSEx()
        {
            this.rsc.Clear();
            deleSQF mySmsContent = new deleSQF(this.FgF4PPDs7);
            int     code         = 2;
            int     num2         = 0;

            while (code == 2)
            {
                code = _ReceiveSMSEx(this.name, mySmsContent);
                switch (code)
                {
                case 2:
                case 1:
                    num2++;
                    break;
                }
            }
            CallResult result = new CallResult(code);

            result.Value = num2.ToString();
            return(result);
        }
Пример #7
0
 public CallResult SendEx(string ToMobile, string Content, DateTime SendTime, string AdditionalNumber)
 {
     int code = _SendScheSMSEx(this.name, ToMobile, Content, SendTime.ToString("yyyy-MM-dd hh:mm:ss"), AdditionalNumber, "5");
     CallResult result = new CallResult(code);
     if (code == 0x6d)
     {
         result.Code = 0;
         result.Value = 0x6d;
     }
     return result;
 }
Пример #8
0
 public CallResult SendEx(string ToMobile, string Content, string AdditionalNumber)
 {
     int code = _SendSMSEx(this.name, ToMobile, Content, AdditionalNumber, "5");
     CallResult result = new CallResult(code);
     if (code == 0x6d)
     {
         result.Code = 0;
         result.Value = 0x6d;
     }
     return result;
 }
Пример #9
0
 public CallResult Send(string ToMobile, string Content)
 {
     int code = _SendSMS(this.name, ToMobile, Content, "5");
     CallResult result = new CallResult(code);
     if (code == 0x6d)
     {
         result.Code = 0;
         result.Value = 0x6d;
     }
     return result;
 }
Пример #10
0
 public CallResult ReceiveStatusReport()
 {
     delegSMSReport mySmsReport = new delegSMSReport(this.sqqK62JCl);
     int code = 2;
     int num2 = 0;
     while (code == 2)
     {
         code = _ReceiveStatusReport(this.name, mySmsReport);
         switch (code)
         {
             case 2:
             case 1:
                 num2++;
                 break;
         }
     }
     CallResult result = new CallResult(code);
     result.Value = num2.ToString();
     return result;
 }
Пример #11
0
 public CallResult ReceiveSMSEx()
 {
     this.rsc.Clear();
     deleSQF mySmsContent = new deleSQF(this.FgF4PPDs7);
     int code = 2;
     int num2 = 0;
     while (code == 2)
     {
         code = _ReceiveSMSEx(this.name, mySmsContent);
         switch (code)
         {
             case 2:
             case 1:
                 num2++;
                 break;
         }
     }
     CallResult result = new CallResult(code);
     result.Value = num2.ToString();
     return result;
 }
Пример #12
0
 public CallResult GetPrice()
 {
     StringBuilder balance = new StringBuilder(20);
     CallResult result = new CallResult(_GetPrice(this.name, balance));
     if (result.Code == 0)
     {
         result.Value = balance.ToString();
     }
     return result;
 }