public ActionResult UserBankList(string Account = "", string UserName = "", int pageSize = 15, int pageNumber = 1) { ShopUtils.SetAdminRefererCookie(Url.Action("userbanklist")); StringBuilder strb = new StringBuilder(); strb.Append(" where 1=1"); if (Account != string.Empty) { strb.Append(" and (rtrim(b.mobile)='" + Account + "' or b.username like '%" + Account + "%')"); } if (UserName != string.Empty) { strb.Append(" and a.username = '******'"); } List <MD_DrawAccount> list = Recharge.GetDrawAccountList(pageNumber, pageSize, strb.ToString()); UserBankListModel userlist = new UserBankListModel { Mobile = Account, UserName = UserName, PageModel = new PageModel(pageSize, pageNumber, list.Count > 0 ? list[0].TotalCount : 0), BankList = list }; return(View(userlist)); }
/// <summary> /// 获取银行卡 /// </summary> /// <returns></returns> public ActionResult GetDrawAccount() { try { NameValueCollection parmas = WorkContext.postparms; if (parmas.Keys.Count != 2) { return(APIResult("error", "缺少请求参数")); } List <MD_DrawAccount> draw = Recharge.GetDrawAccountList(1, 1, " where rtrim(b.mobile)='" + parmas["account"] + "'"); if (draw.Count > 0) { JsonSerializerSettings jsetting = new JsonSerializerSettings(); jsetting.ContractResolver = new JsonLimitOutPut(new string[] { "Account", "Username", "Card", "Cardnum", "Cardaddress" }, true); string data = JsonConvert.SerializeObject(draw[0], jsetting).ToLower(); return(APIResult("success", data, true)); } else { return(APIResult("error", "没有提现账户信息")); } } catch (Exception ex) { return(APIResult("error", "获取失败")); } }
public ActionResult ExistsDrawAcc() { List <MD_DrawAccount> draw = Recharge.GetDrawAccountList(1, -1, " where b.Uid=" + WorkContext.Uid + ""); if (draw == null || draw.Count == 0) { return(Content("1")); } else { return(Content("2")); } }
public ActionResult EditBank(int id = -1) { ViewData["referer"] = ShopUtils.GetAdminRefererCookie(); List <MD_DrawAccount> list = Recharge.GetDrawAccountList(1, 1, " where a.drawaccid=" + id); if (list.Count > 0) { MD_DrawAccount draw = list[0]; return(View(draw)); } else { return(PromptView("获取用户银行卡信息失败")); } }
public ActionResult EditDraw(int uid = -1) { UserInfo userInfo = AdminUsers.GetUserById(uid); if (userInfo == null) { return(PromptView("用户不存在")); } Load(0); List <MD_DrawAccount> list = Recharge.GetDrawAccountList(1, 1, " where a.uid=" + uid); MD_DrawAccount draw = new MD_DrawAccount(); if (list.Count > 0) { draw = list[0]; draw.Drawpwd = ""; return(View(draw)); } else { return(PromptView("用户未绑定银行卡")); } }
public ActionResult EditBank(MD_DrawAccount model) { ViewData["referer"] = ShopUtils.GetAdminRefererCookie(); List <MD_DrawAccount> list = Recharge.GetDrawAccountList(1, 1, " where rtrim(b.mobile)='" + model.Account + "'"); if (list.Count > 0) { MD_DrawAccount draw = list[0]; draw.Username = model.Username; bool result = Recharge.UpdateDrawCardInfo(draw); if (result) { return(PromptView("更新成功")); } else { return(PromptView("更新失败")); } } else { return(PromptView("获取用户银行卡信息失败")); } }
/// <summary> /// 获取银行卡 /// </summary> /// <returns></returns> public ActionResult GetDrawAccount() { try { NameValueCollection parmas = WorkContext.postparms; List <MD_DrawAccount> draw = Recharge.GetDrawAccountList(1, 20, " where b.Uid=" + WorkContext.Uid + ""); if (draw.Count > 0) { JsonSerializerSettings jsetting = new JsonSerializerSettings(); jsetting.ContractResolver = new JsonLimitOutPut(new string[] { "Drawaccid", "Account", "Username", "Card", "Cardnum", "Cardaddress" }, true); string data = JsonConvert.SerializeObject(draw, jsetting).ToLower(); return(APIResult("success", data, true)); } else { return(APIResult("error", "没有提现账户信息")); } } catch (Exception ex) { return(APIResult("error", "获取失败")); } }
/// <summary> /// 提现申请 /// </summary> /// <returns></returns> public ActionResult UserDraw() { NameValueCollection parmas = WorkContext.postparms; if (!Recharge.ValidateDrawPwdByUid(WorkContext.Uid)) { return(Content("5"));//没有设置提现密码 } if (parmas["drawaccid"] == "") { return(Content("6"));//没有添加银行卡信息 } List <MD_DrawAccount> drawgt = Recharge.GetDrawAccountList(1, 1, " where a.drawaccid=" + parmas["drawaccid"].ToString() + ""); if (drawgt == null || drawgt.Count == 0) { return(Content("6"));//没有添加银行卡信息 } //string account = parmas["account"]; decimal money = decimal.Parse(parmas["money"]); if (money < 100) { //return APIResult("error", "最低请提现100元"); return(Content("2")); } PartUserInfo partUserInfo = Users.GetPartUserById(WorkContext.Uid); if (partUserInfo.TotalMoney < money) { //return APIResult("error", "账户余额不足"); return(Content("2")); } string mdpwd = parmas["password"];// Users.CreateUserPassword(parmas["password"], partUserInfo.Salt); bool pwdres = Recharge.ValidateDrawPwdByUid(WorkContext.Uid, mdpwd); if (!pwdres) { //return APIResult("error", "提现密码错误"); return(Content("1")); } DrawInfoModel draw = new DrawInfoModel { Uid = WorkContext.Uid, Money = int.Parse(parmas["money"]), Drawaccid = int.Parse(parmas["drawaccid"]) }; string addres = Recharge.AddDraw(draw); if (addres.EndsWith("成功")) { return(Content("4")); //return APIResult("success", "已经提交请等待客服处理"); } else if (addres == "-1") { //return APIResult("error", "账户余额不足"); return(Content("2")); } else { return(Content("3")); //return APIResult("error", "提交失败"); } }