private void BatchPaySend_Click(object sender, EventArgs e) { this.GetPaySetting(); string str = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { str = base.Request["CheckBoxGroup"]; } else { this.ShowMsg("参数错误!", false); return; } string str2 = this.PaybatchType.Value; if (str2 == "0") { string[] strArray = str.Split(new char[] { ',' }); List <OutPayWeiInfo> batchUserList = new List <OutPayWeiInfo>(); foreach (string str3 in strArray) { BalanceDrawRequestInfo balanceDrawRequestById = DistributorsBrower.GetBalanceDrawRequestById(str3.ToString()); if (((balanceDrawRequestById != null) && (balanceDrawRequestById.IsCheck == "1")) && (this.DrawMinNum <= balanceDrawRequestById.Amount)) { OutPayWeiInfo item = new OutPayWeiInfo { Amount = ((int)balanceDrawRequestById.Amount) * 100, Partner_Trade_No = balanceDrawRequestById.SerialId.ToString(), Openid = balanceDrawRequestById.MerchantCode, Re_User_Name = balanceDrawRequestById.AccountName, Desc = " 分销商佣金发放", UserId = balanceDrawRequestById.UserId, Nonce_Str = OutPayHelp.GetRandomString(20) }; batchUserList.Add(item); } } if (batchUserList.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); } else { List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(batchUserList, wid); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); } else if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); } else { int num = 0; int num2 = 0; int num3 = 0; int count = batchUserList.Count; string str4 = "<div class='errRow'>支付失败信息如下:"; foreach (WeiPayResult result in list2) { if (result.result_code == "SUCCESS") { VShopHelper.UpdateBalanceDrawRequest(Globals.ToNum(result.partner_trade_no), "微信企业付款:流水号" + result.payment_no); int userId = result.UserId; VShopHelper.UpdateBalanceDistributors(result.UserId, result.Amount / 100); num3 += result.Amount / 100; num++; } 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[] { Globals.ToNum(result.partner_trade_no) }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, null); } else { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { Globals.ToNum(result.partner_trade_no) }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, null); } string str5 = str4; str4 = str5 + "<br>ID:" + result.partner_trade_no + ", 出错提示:" + result.return_msg; num2++; } } count = (count - num2) - num; str4 = str4 + "</div>"; if ((num3 == num) && (num3 != 0)) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", count, "笔", str4 }), false); } this.LoadParameters(); this.BindData(); } } } else if (str2 == "1") { this.ShowMsg("接口暂未开通", false); } else { this.ShowMsg("未定义支付方式", false); } }
private void BatchPaySend_Click(object sender, System.EventArgs e) { this.GetPaySetting(); if (string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { this.ShowMsg("参数错误!", false); return; } string text = base.Request["CheckBoxGroup"]; string value = this.PaybatchType.Value; if (value == "0") { string[] array = text.Split(new char[] { ',' }); System.Collections.Generic.List <OutPayWeiInfo> list = new System.Collections.Generic.List <OutPayWeiInfo>(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text2 = array2[i]; BalanceDrawRequestInfo balanceDrawRequestById = DistributorsBrower.GetBalanceDrawRequestById(text2.ToString()); if (balanceDrawRequestById != null && balanceDrawRequestById.IsCheck == "1" && this.DrawMinNum <= balanceDrawRequestById.Amount && !string.IsNullOrEmpty(balanceDrawRequestById.RedpackId)) { list.Add(new OutPayWeiInfo { Amount = (int)balanceDrawRequestById.Amount * 100, Partner_Trade_No = balanceDrawRequestById.RedpackId, Sid = balanceDrawRequestById.SerialId, Openid = balanceDrawRequestById.MerchantCode, Re_User_Name = balanceDrawRequestById.AccountName, Desc = " 分销商佣金发放", UserId = balanceDrawRequestById.UserId, Nonce_Str = OutPayHelp.GetRandomString(20) }); } } if (list.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); return; } System.Collections.Generic.List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(list); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); return; } if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); return; } int num = 0; int num2 = 0; int num3 = 0; int num4 = list.Count; string text3 = "<div class='errRow'>支付失败信息如下:"; using (System.Collections.Generic.List <WeiPayResult> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { WeiPayResult rItem = enumerator.Current; int sid = list.FirstOrDefault((OutPayWeiInfo t) => t.Partner_Trade_No == rItem.partner_trade_no).Sid; if (rItem.result_code == "SUCCESS") { VShopHelper.UpdateBalanceDrawRequest(sid, "微信企业付款:流水号" + rItem.payment_no); int arg_290_0 = rItem.UserId; decimal num5 = rItem.Amount / 100; VShopHelper.UpdateBalanceDistributors(rItem.UserId, num5); if (num5 > 0m && sid > 0) { BalanceDrawRequestInfo balanceDrawRequestById2 = DistributorsBrower.GetBalanceDrawRequestById(sid.ToString()); if (balanceDrawRequestById2 != null) { try { Messenger.SendWeiXinMsg_DrawCashRelease(balanceDrawRequestById2); } catch { } } } num3 += rItem.Amount / 100; num++; } else { if (rItem.err_code == "OPENID_ERROR" || rItem.err_code == "NAME_MISMATCH" || rItem.return_msg.Contains("openid字段") || rItem.err_code == "FATAL_ERROR") { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { sid }, 3, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, null); } else { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { sid }, 1, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, null); } object obj = text3; text3 = string.Concat(new object[] { obj, "<br>ID:", sid, ", 出错提示:", rItem.return_msg }); num2++; } } } num4 = num4 - num2 - num; text3 += "</div>"; if (num3 == num && num3 != 0) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", num4, "笔", text3 }), false); } this.LoadParameters(); this.BindData(); return; } else { if (value == "1") { this.ShowMsg("接口暂未开通", false); return; } this.ShowMsg("未定义支付方式", false); return; } }
private void BatchPaySend_Click(object sender, System.EventArgs e) { this.GetPaySetting(); if (string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { this.ShowMsg("参数错误!", false); return; } string text = base.Request["CheckBoxGroup"]; string value = this.PaybatchType.Value; if (value == "0") { string[] array = text.Split(new char[] { ',' }); System.Collections.Generic.List <OutPayWeiInfo> list = new System.Collections.Generic.List <OutPayWeiInfo>(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string s = array2[i]; MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(s)); if (amountRequestDetail != null && amountRequestDetail.State == RequesState.已审核 && this.DrawMinNum <= amountRequestDetail.Amount) { list.Add(new OutPayWeiInfo { Amount = (int)amountRequestDetail.Amount * 100, Partner_Trade_No = amountRequestDetail.RedpackId, Openid = amountRequestDetail.AccountCode, Re_User_Name = amountRequestDetail.AccountName, Desc = " 用户余额发放", UserId = amountRequestDetail.UserId, Nonce_Str = OutPayHelp.GetRandomString(20), Sid = amountRequestDetail.Id }); } } if (list.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); return; } System.Collections.Generic.List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(list); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); return; } if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); return; } int num = 0; int num2 = 0; int num3 = 0; int num4 = list.Count; string text2 = "<div class='errRow'>支付失败信息如下:"; using (System.Collections.Generic.List <WeiPayResult> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { WeiPayResult rItem = enumerator.Current; int sid = list.FirstOrDefault((OutPayWeiInfo t) => t.Partner_Trade_No == rItem.partner_trade_no).Sid; if (rItem.result_code == "SUCCESS") { int[] serialids = new int[] { sid }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "微信企业付款:流水号" + rItem.payment_no, "", ManagerHelper.GetCurrentManager().UserName); int arg_298_0 = rItem.UserId; MemberAmountRequestInfo amountRequestDetail2 = MemberAmountProcessor.GetAmountRequestDetail(sid); if (amountRequestDetail2 != null) { string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail2.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail2, url); } catch { } } num3 += rItem.Amount / 100; num++; } else { if (rItem.err_code == "OPENID_ERROR" || rItem.err_code == "NAME_MISMATCH" || rItem.return_msg.Contains("openid字段") || rItem.err_code == "FATAL_ERROR") { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 3, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 1, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } string text3 = text2; text2 = string.Concat(new string[] { text3, "<br>ID:", rItem.partner_trade_no, ", 出错提示:", rItem.return_msg }); num2++; } } } num4 = num4 - num2 - num; text2 += "</div>"; if (num3 == num && num3 != 0) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", num4, "笔", text2 }), false); } this.LoadParameters(); this.BindData(); return; } else { if (value == "1") { this.ShowMsg("接口暂未开通", false); return; } this.ShowMsg("未定义支付方式", false); return; } }
private void BatchPaySend_Click(object sender, EventArgs e) { this.GetPaySetting(); string str = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { str = base.Request["CheckBoxGroup"]; } else { this.ShowMsg("参数错误!", false); return; } string str2 = this.PaybatchType.Value; if (str2 == "0") { string[] strArray = str.Split(new char[] { ',' }); List <OutPayWeiInfo> batchUserList = new List <OutPayWeiInfo>(); foreach (string str3 in strArray) { MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(str3)); if (((amountRequestDetail != null) && (amountRequestDetail.State == RequesState.已审核)) && (this.DrawMinNum <= amountRequestDetail.Amount)) { OutPayWeiInfo item = new OutPayWeiInfo { Amount = ((int)amountRequestDetail.Amount) * 100, Partner_Trade_No = amountRequestDetail.RedpackId, Openid = amountRequestDetail.AccountCode, Re_User_Name = amountRequestDetail.AccountName, Desc = " 用户余额发放", UserId = amountRequestDetail.UserId, Nonce_Str = OutPayHelp.GetRandomString(20), Sid = amountRequestDetail.Id }; batchUserList.Add(item); } } if (batchUserList.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); } else { List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(batchUserList); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); } else if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); } else { int num = 0; int num2 = 0; int num3 = 0; int count = batchUserList.Count; string str4 = "<div class='errRow'>支付失败信息如下:"; using (List <WeiPayResult> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { Func <OutPayWeiInfo, bool> predicate = null; WeiPayResult rItem = enumerator.Current; if (predicate == null) { predicate = t => t.Partner_Trade_No == rItem.partner_trade_no; } int sid = batchUserList.FirstOrDefault <OutPayWeiInfo>(predicate).Sid; if (rItem.result_code == "SUCCESS") { int[] serialids = new int[] { sid }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "微信企业付款:流水号" + rItem.payment_no, "", ManagerHelper.GetCurrentManager().UserName); int userId = rItem.UserId; MemberAmountRequestInfo balance = MemberAmountProcessor.GetAmountRequestDetail(sid); if (balance != null) { string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + balance.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(balance, url); } catch { } } num3 += rItem.Amount / 100; num++; } else { if (((rItem.err_code == "OPENID_ERROR") || (rItem.err_code == "NAME_MISMATCH")) || (rItem.return_msg.Contains("openid字段") || (rItem.err_code == "FATAL_ERROR"))) { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } string str6 = str4; str4 = str6 + "<br>ID:" + rItem.partner_trade_no + ", 出错提示:" + rItem.return_msg; num2++; } } } count = (count - num2) - num; str4 = str4 + "</div>"; if ((num3 == num) && (num3 != 0)) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", count, "笔", str4 }), false); } this.LoadParameters(); this.BindData(); } } } else if (str2 == "1") { this.ShowMsg("接口暂未开通", false); } else { this.ShowMsg("未定义支付方式", false); } }
private void BatchPaySend_Click(object sender, EventArgs e) { this.GetPaySetting(); string str = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { str = base.Request["CheckBoxGroup"]; } else { this.ShowMsg("参数错误!", false); return; } string str2 = this.PaybatchType.Value; if (str2 == "0") { string[] strArray = str.Split(new char[] { ',' }); List <OutPayWeiInfo> batchUserList = new List <OutPayWeiInfo>(); foreach (string str3 in strArray) { BalanceDrawRequestInfo balanceDrawRequestById = DistributorsBrower.GetBalanceDrawRequestById(str3.ToString()); if (((balanceDrawRequestById != null) && (balanceDrawRequestById.IsCheck == "1")) && ((this.DrawMinNum <= balanceDrawRequestById.Amount) && !string.IsNullOrEmpty(balanceDrawRequestById.RedpackId))) { OutPayWeiInfo item = new OutPayWeiInfo { Amount = ((int)balanceDrawRequestById.Amount) * 100, Partner_Trade_No = balanceDrawRequestById.RedpackId, Sid = balanceDrawRequestById.SerialId, Openid = balanceDrawRequestById.MerchantCode, Re_User_Name = balanceDrawRequestById.AccountName, Desc = " 分销商佣金发放", UserId = balanceDrawRequestById.UserId, Nonce_Str = OutPayHelp.GetRandomString(20) }; batchUserList.Add(item); } } if (batchUserList.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); } else { List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(batchUserList); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); } else if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); } else { int num = 0; int num2 = 0; int num3 = 0; int count = batchUserList.Count; string str4 = "<div class='errRow'>支付失败信息如下:"; using (List <WeiPayResult> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { Func <OutPayWeiInfo, bool> predicate = null; WeiPayResult rItem = enumerator.Current; if (predicate == null) { predicate = t => t.Partner_Trade_No == rItem.partner_trade_no; } int sid = batchUserList.FirstOrDefault <OutPayWeiInfo>(predicate).Sid; if (rItem.result_code == "SUCCESS") { VShopHelper.UpdateBalanceDrawRequest(sid, "微信企业付款:流水号" + rItem.payment_no); int userId = rItem.UserId; decimal referralRequestBalance = rItem.Amount / 100; VShopHelper.UpdateBalanceDistributors(rItem.UserId, referralRequestBalance); if ((referralRequestBalance > 0M) && (sid > 0)) { BalanceDrawRequestInfo balance = DistributorsBrower.GetBalanceDrawRequestById(sid.ToString()); if (balance != null) { try { Messenger.SendWeiXinMsg_DrawCashRelease(balance); } catch { } } } num3 += rItem.Amount / 100; num++; } else { if (((rItem.err_code == "OPENID_ERROR") || (rItem.err_code == "NAME_MISMATCH")) || (rItem.return_msg.Contains("openid字段") || (rItem.err_code == "FATAL_ERROR"))) { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { sid }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, null); } else { DistributorsBrower.SetBalanceDrawRequestIsCheckStatus(new int[] { sid }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, null); } object obj2 = str4; str4 = string.Concat(new object[] { obj2, "<br>ID:", sid, ", 出错提示:", rItem.return_msg }); num2++; } } } count = (count - num2) - num; str4 = str4 + "</div>"; if ((num3 == num) && (num3 != 0)) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", count, "笔", str4 }), false); } this.LoadParameters(); this.BindData(); } } } else if (str2 == "1") { this.ShowMsg("接口暂未开通", false); } else { this.ShowMsg("未定义支付方式", false); } }