private void weipaySend_Click(object sender, System.EventArgs e) { int num = Globals.ToNum(this.HiddenSid.Value); decimal num2 = decimal.Parse(this.hdreferralblance.Value); BalanceDrawRequestInfo balanceDrawRequestById = DistributorsBrower.GetBalanceDrawRequestById(num.ToString()); if (balanceDrawRequestById == null) { this.ShowMsg("参数错误!", false); return; } if (balanceDrawRequestById.IsCheck == "2") { this.ShowMsg("该申请已经支付,请检查", false); return; } WeiPayResult weiPayResult = OutPayHelp.SingleWeiPay((int)(num2 * 100m), "分销商佣金发放!", balanceDrawRequestById.MerchantCode, balanceDrawRequestById.AccountName, balanceDrawRequestById.SerialId.ToString(), balanceDrawRequestById.UserId); if (weiPayResult.result_code == "SUCCESS") { VShopHelper.UpdateBalanceDrawRequest(num, "微信企业付款"); int arg_B6_0 = balanceDrawRequestById.UserId; VShopHelper.UpdateBalanceDistributors(balanceDrawRequestById.UserId, num2); if (num2 > 0m) { BalanceDrawRequestInfo balanceDrawRequestById2 = DistributorsBrower.GetBalanceDrawRequestById(num.ToString()); if (balanceDrawRequestById2 != null) { Messenger.SendWeiXinMsg_DrawCashRelease(balanceDrawRequestById2); } } this.LoadParameters(); this.BindData(); this.ShowMsg("支付成功!", true); return; } if (weiPayResult.err_code == "OPENID_ERROR" || weiPayResult.err_code == "NAME_MISMATCH" || weiPayResult.return_msg.Contains("openid字段") || weiPayResult.err_code == "FATAL_ERROR") { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { num }, 3, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + weiPayResult.return_msg, num2.ToString()); this.LoadParameters(); this.BindData(); } else { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { num }, 1, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + weiPayResult.return_msg, num2.ToString()); } this.ShowMsg("微信企业付款失败," + weiPayResult.return_msg, false); }
private void weipaySend_Click(object sender, EventArgs e) { int id = Globals.ToNum(this.HiddenSid.Value); decimal referralRequestBalance = decimal.Parse(this.hdreferralblance.Value); BalanceDrawRequestInfo balanceDrawRequestById = DistributorsBrower.GetBalanceDrawRequestById(id.ToString()); if (balanceDrawRequestById != null) { if (balanceDrawRequestById.IsCheck == "2") { this.ShowMsg("该申请已经支付,请检查", false); } else { WeiPayResult result = OutPayHelp.SingleWeiPay((int)(referralRequestBalance * 100M), "分销商佣金发放!", balanceDrawRequestById.MerchantCode, balanceDrawRequestById.AccountName, balanceDrawRequestById.SerialId.ToString(), balanceDrawRequestById.UserId); if (result.result_code == "SUCCESS") { VShopHelper.UpdateBalanceDrawRequest(id, "微信企业付款"); int userId = balanceDrawRequestById.UserId; VShopHelper.UpdateBalanceDistributors(balanceDrawRequestById.UserId, referralRequestBalance); if (referralRequestBalance > 0M) { BalanceDrawRequestInfo balance = DistributorsBrower.GetBalanceDrawRequestById(id.ToString()); if (balance != null) { Messenger.SendWeiXinMsg_DrawCashRelease(balance); } } this.LoadParameters(); this.BindData(); this.ShowMsg("支付成功!", true); } else { if (((result.err_code == "OPENID_ERROR") || (result.err_code == "NAME_MISMATCH")) || (result.return_msg.Contains("openid字段") || (result.err_code == "FATAL_ERROR"))) { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { id }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, referralRequestBalance.ToString()); this.LoadParameters(); this.BindData(); } else { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { id }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, referralRequestBalance.ToString()); } this.ShowMsg("微信企业付款失败," + result.return_msg, false); } } } else { this.ShowMsg("参数错误!", false); } }
private void weipaySend_Click(object sender, EventArgs e) { int serialid = Globals.ToNum(this.HiddenSid.Value); decimal num2 = decimal.Parse(this.hdreferralblance.Value); MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(serialid); if (amountRequestDetail != null) { if (amountRequestDetail.State == RequesState.已发放) { this.ShowMsg("该申请已经支付,请检查", false); } else if (amountRequestDetail.State == RequesState.驳回) { this.ShowMsg("该申请已经驳回,请检查", false); } else if (string.IsNullOrEmpty(amountRequestDetail.RedpackId)) { this.ShowMsg("商户订单ID为空,请重试!", false); } else { WeiPayResult result = OutPayHelp.SingleWeiPay((int)(num2 * 100M), "用户余额发放!", amountRequestDetail.AccountCode, amountRequestDetail.AccountName, amountRequestDetail.RedpackId, amountRequestDetail.UserId); if (result.result_code == "SUCCESS") { int[] serialids = new int[] { serialid }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "微信企业付款", "", ManagerHelper.GetCurrentManager().UserName); int userId = amountRequestDetail.UserId; string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail, url); } catch { } this.LoadParameters(); this.BindData(); this.ShowMsg("支付成功!", true); } else { if (((result.err_code == "OPENID_ERROR") || (result.err_code == "NAME_MISMATCH")) || (result.return_msg.Contains("openid字段") || (result.err_code == "FATAL_ERROR"))) { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, num2.ToString(), ManagerHelper.GetCurrentManager().UserName); this.LoadParameters(); this.BindData(); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, num2.ToString(), ManagerHelper.GetCurrentManager().UserName); } this.ShowMsg("微信企业付款失败," + result.return_msg, false); } } } else { this.ShowMsg("参数错误!", false); } }