protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("cash_edit", "提现管理")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Cash.GetModel(id); if (model == null) { model = new Lebi_Cash(); } }
protected void Page_Load(object sender, EventArgs e) { Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel("Code='alipaybatch'"); if (pay == null) { Response.Write("参数错误"); Response.End(); return; } SortedDictionary <string, string> sPara = GetRequestPost(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]); if (verifyResult)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 string batch_no = RequestTool.RequestSafeString("batch_no"); Lebi_Cash_alipay cash = B_Lebi_Cash_alipay.GetModel("Code='" + batch_no + "'"); if (cash != null) { //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表 //批量付款数据中转账成功的详细信息 //格式为:流水号^收款方账号^收款 //账号姓名^付款金额^成功标识(S)^ //成功原因(null)^支付宝内部流水号 //^完成时间。 //每条记录以“ |”间隔 string success_details = RequestTool.RequestString("success_details"); //批量付款数据中转账失败的详细信息 string fail_details = RequestTool.RequestString("fail_details"); string[] arr = success_details.Split('|'); foreach (string temp in arr) { string[] item = temp.Split('^'); Lebi_Cash model = B_Lebi_Cash.GetModel("id=" + item[0] + ""); if (model != null) { model.Type_id_CashStatus = 402; B_Lebi_Cash.Update(model); } } cash.Time_Paid = System.DateTime.Now; cash.IsPaid = 1; cash.result_no = fail_details; cash.result_yes = success_details; B_Lebi_Cash_alipay.Update(cash); //判断是否在商户网站中已经做过了这次通知返回的处理 //如果没有做过处理,那么执行商户的业务程序 //如果有做过处理,那么不执行商户的业务程序 } Response.Write("success"); //请不要修改或删除 //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— ///////////////////////////////////////////////////////////////////////////////////////////////////////////// } else//验证失败 { Response.Write("fail"); } } else { Response.Write("无通知参数"); } }
/// <summary> /// 更新一条数据 /// </summary> public static void Update(Lebi_Cash model) { D_Lebi_Cash.Instance.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public static int Add(Lebi_Cash model) { return(D_Lebi_Cash.Instance.Add(model)); }
/// <summary> /// 安全方式绑定表单数据 /// </summary> public static Lebi_Cash SafeBindForm(Lebi_Cash model) { return(D_Lebi_Cash.Instance.SafeBindForm(model)); }
/// <summary> /// 提现 /// </summary> public void TackMoney() { string PayType = RequestTool.RequestSafeString("PayType"); string CashAccount_Code = RequestTool.RequestSafeString("CashAccount_Code"); string CashAccount_Name = RequestTool.RequestSafeString("CashAccount_Name"); string CashAccount_Bank = RequestTool.RequestSafeString("CashAccount_Bank"); string Pay_Password = RequestTool.RequestSafeString("Pay_Password"); decimal RMoney = RequestTool.RequestDecimal("RMoney", 0); decimal Fee = RMoney * Convert.ToDecimal(SYS.WithdrawalFeeRate) / 100; int count = B_Lebi_Cash.Counts("User_id=" + CurrentUser.id + " and Type_id_CashStatus=401"); if (count > 0) { Response.Write("{\"msg\":\"" + Tag("请等待上次提现处理完毕") + "\"}"); return; } if (RMoney + CurrentUser.Money_fanxian > CurrentUser.Money) { Response.Write("{\"msg\":\"" + Tag("余额不足") + "\"}"); return; } decimal TakeMoneyLimit = 0; decimal.TryParse(SYS.TakeMoneyLimit, out TakeMoneyLimit); if (RMoney < TakeMoneyLimit) { Response.Write("{\"msg\":\"" + Tag("未达到最低提现要求") + "\"}"); return; } if (Pay_Password == "") { Response.Write("{\"msg\":\"" + Tag("请输入支付密码") + "\"}"); return; } else { if (EX_User.MD5(Pay_Password) != CurrentUser.Pay_Password) { Response.Write("{\"msg\":\"" + Tag("支付密码不正确") + "\"}"); return; } } CurrentUser.CashAccount_Code = CashAccount_Code; CurrentUser.CashAccount_Name = CashAccount_Name; CurrentUser.CashAccount_Bank = CashAccount_Bank; B_Lebi_User.Update(CurrentUser); Lebi_Cash model = new Lebi_Cash(); model.PayType = PayType; model.AccountName = CashAccount_Name; model.AccountCode = CashAccount_Code; model.Bank = CashAccount_Bank; model.User_id = CurrentUser.id; model.User_UserName = CurrentUser.UserName; model.Money = RMoney; model.Fee = Fee; model.Type_id_CashStatus = 401; B_Lebi_Cash.Add(model); //扣款 Money.AddMoney(CurrentUser, 0 - RMoney, 193, null, "", ""); Response.Write("{\"msg\":\"OK\"}"); }