当前位置: 首页>>代码示例>>C#>>正文


C# Users.AddUserBalance方法代码示例

本文整理汇总了C#中Users.AddUserBalance方法的典型用法代码示例。如果您正苦于以下问题:C# Users.AddUserBalance方法的具体用法?C# Users.AddUserBalance怎么用?C# Users.AddUserBalance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Users的用法示例。


在下文中一共展示了Users.AddUserBalance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteUserAccount

    ////获取远程服务器ATN结果
    //public String Get_Http(String a_strUrl, int timeout)
    //{
    //    string strResult;
    //    try
    //    {
    //        HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create(a_strUrl);
    //        myReq.Timeout = timeout;
    //        HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse();
    //        Stream myStream = HttpWResp.GetResponseStream();
    //        StreamReader sr = new StreamReader(myStream, Encoding.Default);
    //        StringBuilder strBuilder = new StringBuilder();
    //        while (-1 != sr.Peek())
    //        {
    //            strBuilder.Append(sr.ReadLine());
    //        }

    //        strResult = strBuilder.ToString();
    //    }
    //    catch (Exception exp)
    //    {

    //        strResult = "错误:" + exp.Message;
    //    }

    //    return strResult;
    //}

    private bool WriteUserAccount(Users _User, string orderid, string amount, string Memo)
    {
        double Money = Shove._Convert.StrToDouble(amount, 0);
        if (Money == 0)
        {
            return false;
        }

        double FormalitiesFeesScale = so["OnlinePay_Alipay_PayFormalitiesFeesScale"].ToDouble(0) / 100;
        double FormalitiesFees = Money - Math.Round(Money / (FormalitiesFeesScale + 1), 2);
        Money -= FormalitiesFees;

        string ReturnDescription = "";
        bool ok = (_User.AddUserBalance(Money, FormalitiesFees, orderid, "支付宝支付," + so["OnlinePay_Alipay_UserName"].ToString(""), Memo, ref ReturnDescription) == 0);

        if (!ok)
        {
            DataTable dt = new DAL.Tables.T_UserPayDetails().Open("Result", "[id] = " + Shove._Convert.StrToLong(orderid, 0).ToString(), "");

            if (dt == null || dt.Rows.Count == 0)
            {
                new Log("System").Write("在线支付:返回的交易号找不到对应的数据");

                return false;
            }

            int IsOK = Shove._Convert.StrToInt(dt.Rows[0][0].ToString(), 0);

            if (IsOK == 1)
            {
                return true;
            }
            else
            {
                new Log("System").Write("在线支付:对应的数据未处理");

                return false;
            }
        }

        return ok;
    }
开发者ID:ichari,项目名称:ichari,代码行数:70,代码来源:Receive.aspx.cs

示例2: WriteUserAccount

    //充值写入账户
    private bool WriteUserAccount(Users _User, string Id, string amount, string Memo)
    {
        //充值金额
        double Money = Shove._Convert.StrToDouble(amount, 0);

        if (Money == 0)
        {
            return false;
        }


        string ReturnDescription = "";
        bool ok = (_User.AddUserBalance(Money, 0, Id, "", Memo, ref ReturnDescription) == 0);

        if (!ok)
        {
            DataTable dt = new DAL.Tables.T_UserPayDetails().Open("Result", "[PayNumber] = '" + Id + "'", "");

            if (dt == null || dt.Rows.Count == 0)
            {
                new Log("System").Write("在线支付:返回的交易号找不到对应的数据");

                return false;
            }

            int IsOK = Shove._Convert.StrToInt(dt.Rows[0][0].ToString(), 0);

            if (IsOK == 1)
            {
                return true;
            }
            else
            {
                new Log("System").Write("在线支付:对应的数据未处理");

                return false;
            }
        }

        return ok;
    }
开发者ID:ichari,项目名称:ichari,代码行数:42,代码来源:Receive.aspx.cs

示例3: WriteUserAccount

 private bool WriteUserAccount(Users _User, string orderid, string amount, string Memo)
 {
     double money = _Convert.StrToDouble(amount, 0.0);
     if (money != 0.0)
     {
         double num2 = this.so["OnlinePay_Alipay_PayFormalitiesFeesScale"].ToDouble(0.0) / 100.0;
         double formalitiesFees = money - Math.Round((double)(money / (num2 + 1.0)), 2);
         money -= formalitiesFees;
         string returnDescription = "";
         bool flag = _User.AddUserBalance(money, formalitiesFees, orderid, "支付宝支付," + this.so["OnlinePay_Alipay_UserName"].ToString(""), Memo, ref returnDescription) == 0;
         if (flag)
         {
             return flag;
         }
         DataTable table = new Tables.T_UserPayDetails().Open("Result", "[id] = " + _Convert.StrToLong(orderid, 0L).ToString(), "");
         if ((table == null) || (table.Rows.Count == 0))
         {
             new Log("System").Write("在线支付:返回的交易号找不到对应的数据");
             return false;
         }
         if (_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1)
         {
             return true;
         }
         new Log("System").Write("在线支付:对应的数据未处理");
     }
     return false;
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:28,代码来源:Receive.aspx.cs

示例4: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     string str = Utility.GetUrl() + "/Home/Room/OnlinePay/";
     try
     {
         this.SettingParams();
     }
     catch (Exception exception)
     {
         this.errorMessage = "007在线充值:充值未完成。错误描述:参数有误 详细:" + exception.Message;
         new Log("OnlinePay").Write(this.errorMessage);
         base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
         return;
     }
     this.key = this.so["OnlinePay_007Ka_Key"].ToString("");
     if (base.Request.QueryString.AllKeys.Length >= 1)
     {
         if (this.SignCounterpart != this.GetMD5(this.Orderinfo))
         {
             this.errorMessage = "007在线充值:充值未完成。错误描述:认证签名失败!";
             new Log("OnlinePay").Write(this.errorMessage);
             base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
         }
         else if (this.MerID != this.so["OnlinePay_007Ka_MerchantId"].ToString("").Trim())
         {
             this.errorMessage = "007在线充值:充值未完成。错误描述:商户号错误,数据非法!";
             new Log("OnlinePay").Write(this.errorMessage);
             base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
         }
         else if (this.MerAccount != this.so["OnlinePay_007Ka_MerAccount"].ToString("").Trim())
         {
             this.errorMessage = "007在线充值:充值未完成。错误描述:商户银行账号错误,数据非法!";
             new Log("OnlinePay").Write(this.errorMessage);
             base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
         }
         else if ((this.TranStat.ToString().Trim() != "1") && (this.TranStat.ToString().Trim() != "29"))
         {
             this.errorMessage = "007充值失败。";
             new Log("OnlinePay").Write(this.errorMessage + " 错误号:" + this.TranStat.ToString() + " 错误描述:" + this.TranInfo);
             base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
         }
         else
         {
             DataTable table = new Tables.T_UserPayDetails().Open("Result,UserID", "ID=" + this.OrderID, "");
             if ((table == null) || (table.Rows.Count < 1))
             {
                 this.errorMessage = "007在线充值:充值未完成。错误描述:生成支付流水号未成功。";
                 new Log("OnlinePay").Write(this.errorMessage);
                 base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
             }
             else if (_Convert.StrToLong(table.Rows[0][1].ToString(), 0L) != 0L)
             {
                 if (_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1)
                 {
                     this.errorMessage = this.OrderID + "订单充值已经成功!";
                     base.Response.Write("OK");
                     new Log("OnlinePay").Write(this.errorMessage);
                     JavaScript.Alert(this.Page, this.errorMessage);
                 }
                 else
                 {
                     string returnDescription = "";
                     double num = this.so["OnlinePay_007Ka_FormalitiesFees"].ToDouble(0.0) / 100.0;
                     double formalitiesFees = Math.Round((double)((_Convert.StrToDouble(this.Value, 0.0) / 100.0) * num), 2);
                     Users users = new Users(base._Site.ID)[base._Site.ID, _Convert.StrToLong(table.Rows[0][1].ToString(), 0L)];
                     if (users.AddUserBalance((_Convert.StrToDouble(this.Value, 0.0) / 100.0) - formalitiesFees, formalitiesFees, this.OrderID, "007Ka", "系统交易号:" + this.OrderID + "007Ka支付", ref returnDescription) < 0)
                     {
                         this.errorMessage = "增加电子货币错误。错误原因:" + returnDescription;
                         new Log("OnlinePay").Write(this.errorMessage);
                         base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
                     }
                     else
                     {
                         base.Response.Write("OK");
                         this.errorMessage = "007在线充值:充值完成!";
                         new Log("OnlinePay").Write(this.errorMessage);
                         base.Response.Redirect(Utility.GetUrl() + "/Home/Room/OnlinePay/OK.aspx?BuyID=" + this.Attach);
                     }
                 }
             }
             else
             {
                 this.errorMessage = "007在线充值:充值未完成。错误描述:用户不存在!";
                 new Log("OnlinePay").Write(this.errorMessage);
                 base.Response.Redirect(Utility.GetUrl() + "/Home/Room/OnlinePay/OK.aspx?BuyID=" + this.Attach);
             }
         }
     }
     else
     {
         this.errorMessage = "007在线充值:充值未完成。错误描述:数据传输错误!";
         new Log("OnlinePay").Write(this.errorMessage);
         base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage);
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:95,代码来源:Receive1.aspx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string returnUrl = Shove._Web.Utility.GetUrl() + "/Home/Room/OnlinePay/";
        try
        {
            SettingParams();
        }
        catch (Exception ee)
        {
            errorMessage = "007在线充值:充值未完成。错误描述:参数有误 详细:" + ee.Message;
            new Log("OnlinePay").Write(errorMessage);

            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        key = so["OnlinePay_007Ka_Key"].ToString("");
        if (Request.QueryString.AllKeys.Length < 1)
        {
            errorMessage = "007在线充值:充值未完成。错误描述:数据传输错误!";
            new Log("OnlinePay").Write(errorMessage);

            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        if (SignCounterpart != GetMD5(Orderinfo))
        {
            errorMessage = "007在线充值:充值未完成。错误描述:认证签名失败!";
            new Log("OnlinePay").Write(errorMessage);
            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        if (MerID != so["OnlinePay_007Ka_MerchantId"].ToString("").Trim())
        {
            errorMessage = "007在线充值:充值未完成。错误描述:商户号错误,数据非法!";
            new Log("OnlinePay").Write(errorMessage);
            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        if (MerAccount != so["OnlinePay_007Ka_MerAccount"].ToString("").Trim())
        {
            errorMessage = "007在线充值:充值未完成。错误描述:商户银行账号错误,数据非法!";
            new Log("OnlinePay").Write(errorMessage);
            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        if (TranStat.ToString().Trim() != "1" && TranStat.ToString().Trim() != "29")
        {
            errorMessage = "007充值失败。";
            new Log("OnlinePay").Write(errorMessage + " 错误号:" + TranStat.ToString()+" 错误描述:"+TranInfo);
            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        DataTable dt = new DAL.Tables.T_UserPayDetails().Open("Result,UserID", "ID=" + OrderID, "");
        if (dt == null || dt.Rows.Count < 1)
        {
            errorMessage = "007在线充值:充值未完成。错误描述:生成支付流水号未成功。";
            new Log("OnlinePay").Write(errorMessage);
            Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

            return;
        }
        else
        {
            if (Shove._Convert.StrToLong(dt.Rows[0][1].ToString(), 0) != 0)
            {
                if (Shove._Convert.StrToInt(dt.Rows[0][0].ToString(), 0) == 1)
                {
                    errorMessage = OrderID + "订单充值已经成功!";
                    Response.Write("OK");
                    new Log("OnlinePay").Write(errorMessage);
                    Shove._Web.JavaScript.Alert(this.Page, errorMessage);

                    return;
                }
                string returnDescription = "";
                double FormalitiesFeesScale = so["OnlinePay_007Ka_FormalitiesFees"].ToDouble(0) / 100;
                double FormalitiesFees = Math.Round((Shove._Convert.StrToDouble(Value, 0)/100) * FormalitiesFeesScale, 2);
                Users user = new Users(_Site.ID)[_Site.ID, Shove._Convert.StrToLong(dt.Rows[0][1].ToString(), 0)];
                int temp = user.AddUserBalance(Shove._Convert.StrToDouble(Value, 0)/100.0 - FormalitiesFees, FormalitiesFees, OrderID, "007Ka", "系统交易号:" + OrderID + "007Ka支付", ref returnDescription);
                if (temp < 0)
                {
                    errorMessage = "增加电子货币错误。错误原因:" + returnDescription;
                    new Log("OnlinePay").Write(errorMessage);
                    Response.Redirect(returnUrl + "Fail.aspx?errMsg=" + errorMessage);

                    return;
                }
                else
                {
                    Response.Write("OK");
                    errorMessage = "007在线充值:充值完成!";
                    new Log("OnlinePay").Write(errorMessage);
                    Response.Redirect(Shove._Web.Utility.GetUrl() + "/Home/Room/OnlinePay/OK.aspx?BuyID=" + Attach);

//.........这里部分代码省略.........
开发者ID:ichari,项目名称:ichari,代码行数:101,代码来源:Receive1.aspx.cs


注:本文中的Users.AddUserBalance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。