private void BindData()
 {
     string name = base._Site.SiteOptions["Opt_ISP_UserID"].Value.ToString();
     string password = base._Site.SiteOptions["Opt_ISP_UserPassword"].Value.ToString();
     if ((name == "") || (password == ""))
     {
         PF.GoError(1, "查询短信服务器失败,可能是参数设置错误。", base.GetType().BaseType.FullName);
     }
     else
     {
         SMS.Eucp.Gateway.Gateway gateway = new SMS.Eucp.Gateway.Gateway(name, password);
         CallResult balance = gateway.GetBalance();
         CallResult price = gateway.GetPrice();
         if (balance.Code < 0)
         {
             PF.GoError(1, "查询短信服务器失败,查询余额时:" + balance.Description, base.GetType().BaseType.FullName);
         }
         else if (price.Code < 0)
         {
             PF.GoError(1, "查询短信服务器失败,查询单价时:" + price.Description, base.GetType().BaseType.FullName);
         }
         else
         {
             this.Label1.Text = balance.Value.ToString() + " 元";
             this.Label2.Text = price.Value.ToString() + " 元/条";
             this.Label3.Text = "服务商不提供此数据";
             this.Label4.Text = "服务商不提供此数据";
             this.Label5.Text = "服务商不提供此数据";
             this.Label6.Text = "服务商不提供此数据";
         }
     }
 }
Beispiel #2
0
    private void BindData()
    {
        string name     = base._Site.SiteOptions["Opt_ISP_UserID"].Value.ToString();
        string password = base._Site.SiteOptions["Opt_ISP_UserPassword"].Value.ToString();

        if ((name == "") || (password == ""))
        {
            PF.GoError(1, "查询短信服务器失败,可能是参数设置错误。", base.GetType().BaseType.FullName);
        }
        else
        {
            SMS.Eucp.Gateway.Gateway gateway = new SMS.Eucp.Gateway.Gateway(name, password);
            CallResult balance = gateway.GetBalance();
            CallResult price   = gateway.GetPrice();
            if (balance.Code < 0)
            {
                PF.GoError(1, "查询短信服务器失败,查询余额时:" + balance.Description, base.GetType().BaseType.FullName);
            }
            else if (price.Code < 0)
            {
                PF.GoError(1, "查询短信服务器失败,查询单价时:" + price.Description, base.GetType().BaseType.FullName);
            }
            else
            {
                this.Label1.Text = balance.Value.ToString() + " 元";
                this.Label2.Text = price.Value.ToString() + " 元/条";
                this.Label3.Text = "服务商不提供此数据";
                this.Label4.Text = "服务商不提供此数据";
                this.Label5.Text = "服务商不提供此数据";
                this.Label6.Text = "服务商不提供此数据";
            }
        }
    }
Beispiel #3
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();
    }
Beispiel #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 = "服务商不提供此数据";
    }