protected void gUserDistills_ItemCommand(object source, DataGridCommandEventArgs e) { HiddenField field = (HiddenField)e.Item.FindControl("tdDistillID"); int num = _Convert.StrToInt(field.Value, 0); if (e.CommandName == "QuashDistills") { string key = "Home_Room_DistillDetail_" + base._User.ID.ToString(); string returnDescription = ""; if (base._User.DistillQuash((long)num, ref returnDescription) < 0) { JavaScript.Alert(this.Page, "数据库读写错误." + returnDescription); } else if (returnDescription != "") { JavaScript.Alert(this.Page, returnDescription); } else { JavaScript.Alert(this.Page, "撤销成功。"); Shove._Web.Cache.ClearCache(key); this.BindDistills(); } } else if (e.CommandName == "ShowDistillDetail") { this.isShowDistill.Visible = true; string str3 = ""; string str4 = ""; string str5 = ""; DataTable table = new Tables.T_UserDistills().Open("BankCardNumber,AlipayName,[DateTime], BankTypeName, BankName, BankInProvince, BankInCity", "id = " + num, ""); str3 = table.Rows[0]["BankCardNumber"].ToString(); str4 = table.Rows[0]["AlipayName"].ToString(); str5 = table.Rows[0]["DateTime"].ToString(); if (str3 == "") { this.lblDistillBankType.Text = "支付宝提款"; this.lblDistillBanks.Text = "支付宝账号: "; this.lblDistillBankDetail.Text = str4; this.divBankInfo.Visible = false; } else { this.lblDistillBankType.Text = "银行卡提款"; this.lblDistillBankDetail.Text = str3; this.lblDistillBanks.Text = "银行卡号: "; this.divBankInfo.Visible = true; this.lbBankInProvince.Text = table.Rows[0]["BankInProvince"].ToString(); this.lbBankInCity.Text = table.Rows[0]["BankInCity"].ToString(); this.lbAccountBank.Text = table.Rows[0]["BankName"].ToString(); this.lbBankTypeName.Text = table.Rows[0]["BankTypeName"].ToString(); } this.lblDistillTime.Text = str5.ToString(); this.BindDistills(); } }
protected void gUserDistills_ItemCommand(object source, DataGridCommandEventArgs e) { HiddenField hidDistillID = (HiddenField)e.Item.FindControl("tdDistillID"); if (hidDistillID == null) { return; } int DistillID = Shove._Convert.StrToInt(hidDistillID.Value, 0); if (DistillID == 0) { return; } if (e.CommandName == "QuashDistills") { string CacheKeyName = "Room_UserDistills_" + _User.ID.ToString(); //int ReturnValue = 0; string ReturnDescription = ""; //int Result = DAL.Procedures.P_UserDistillCancel(1, _User.ID, -2, DistillID, "用户自行撤销提款", _User.ID, ref ReturnValue, ref ReturnDescription); int Result = _User.DistillQuash(DistillID, ref ReturnDescription); if (Result < 0) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误."); return; } if (ReturnDescription != "") { Shove._Web.JavaScript.Alert(this.Page, ReturnDescription); return; } Shove._Web.JavaScript.Alert(this.Page, "撤销成功。"); Shove._Web.Cache.ClearCache(CacheKeyName); BindDistills(); } else if (e.CommandName == "ShowDistillDetail") { this.isShowDistill.Visible = true; string CardNum = ""; string AlipayName = ""; string time = ""; DataTable dt = new DAL.Tables.T_UserDistills().Open("BankCardNumber,AlipayName,[DateTime],BankName", "id = " + DistillID, ""); CardNum = dt.Rows[0]["BankCardNumber"].ToString(); AlipayName = dt.Rows[0]["AlipayName"].ToString(); time = dt.Rows[0]["DateTime"].ToString(); if (CardNum == "") { this.lblDistillBankType.Text = "支付宝提款"; this.lblDistillBanks.Text = "支付宝账号: "; this.lblDistillBankDetail.Text = AlipayName; this.lbAccountBank.Visible = false; this.lbAccountBankDetail.Visible = false; } else { this.lblDistillBankType.Text = "银行卡提款"; this.lblDistillBankDetail.Text = CardNum; this.lblDistillBanks.Text = "银行卡号: "; this.lbAccountBank.Visible = true; this.lbAccountBankDetail.Visible = true; this.lbAccountBank.Text = dt.Rows[0]["BankName"].ToString(); } this.lblDistillTime.Text = time.ToString(); } BindDistills(); }
// 接收提款结果通知 private void DistillResultNotice(string TransMessage) { System.Xml.XmlDocument XmlDoc = new XmlDocument(); System.Xml.XmlNodeList nodes = null; System.Xml.XmlNodeList nodesDistill = null; try { XmlDoc.Load(new StringReader(TransMessage)); nodes = XmlDoc.GetElementsByTagName("*"); nodesDistill = XmlDoc.GetElementsByTagName("drawing"); } catch { } for (int i = 0; i < nodes.Count; i++) { if (!(nodes[i].Name.ToUpper() == "BODY" && nodes[i].FirstChild.Name.ToUpper() == "DRAWINGNOTIFY")) { continue; } //这里只会执行一次这样的循环 //循环更新数据库 for (int j = 0; j < nodesDistill.Count; j++) { string Id = nodesDistill[j].Attributes["id"].Value; string UserName = nodesDistill[j].Attributes["userName"].Value; int Status = Shove._Convert.StrToInt(nodesDistill[j].Attributes["status"].Value, -1); double Money = Shove._Convert.StrToDouble(nodesDistill[j].Attributes["money"].Value, 0); if ((string.IsNullOrEmpty(Id) || (String.IsNullOrEmpty(UserName)))) { continue; } //status=-1,-2,3 表示提款申请拒绝了,status=0, 1 表示提款申请正在处理,status=2 表示提款申请已经受理 bool isSuccess = false; string memo = ""; switch (Status) { case -1: memo = "无法转到银行卡"; new Log("System").Write("在线提款:" + memo + "!" + " 提款号:" + Id); break; case -2: memo = "已经退单"; new Log("System").Write("在线提款:" + memo + "!" + " 提款号:" + Id); break; case 3: memo = "提款ID不存在"; new Log("System").Write("在线提款:" + memo + "!" + " 提款号:" + Id); break; case 0: memo = "未处理提款单"; new Log("System").Write("在线提款:" + memo + "!" + " 提款号:" + Id); break; case 1: memo = "已处理提款单"; new Log("System").Write("在线提款:" + memo + "!" + " 提款号:" + Id); break; case 2: memo = "已转到银行卡"; new Log("System").Write("在线提款:" + memo + "!" + " 提款号:" + Id); isSuccess = true; break; } //如果提款申请已经处理了 if ((Status != 0) && (Status != 1)) { Users user = new Users(1)[1, UserName]; if (user == null) { new Log("System").Write("在线提款:异常用户数据!" + " 提款号:" + Id); continue; } DataTable dt = new DAL.Tables.T_UserDistills().Open("ID,AlipayID", "DistillNumber='" + Id + "'", ""); if (dt == null || dt.Rows.Count <= 0) { new Log("System").Write("在线提款:数据库不存在此条提款申请!" + " 提款号:" + Id); continue; } string ReturnDescription = ""; //完成请求之后,处理此提款记录 if (isSuccess) { //int stateResult = -1; //stateResult = user.DistillAccept(Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), 0), DataCache.Banks[user.BankType] + user.BankName, user.BankCardNumber, "", "", memo, 1, ref ReturnDescription); //if (stateResult < 0) //{ // new Log("System").Write("在线提款失败:本地处理提款出错!描述:" + ReturnDescription + " 提款号:" + Id); // continue; //} //new Log("System").Write("在线提款成功!提款号:" + Id); } else { //拒绝提款 if (user.DistillNoAccept(Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), 0), memo, user.ID, ref ReturnDescription) < 0) { new Log("System").Write("在线提款失败:本地处理提款出错!描述:" + ReturnDescription + " 提款号:" + Id); continue; } new Log("System").Write("在线提款失败:申请被拒绝!描述:" + memo + " 提款号:" + Id); } } } } string MessageID = nodes[0].Attributes["id"].Value; ReNotice(MessageID, "512"); }