/// <summary> /// 提现数据列表绑定 /// </summary> private void Bind() { ISysSettingService settingService = IoC.Resolve <ISysSettingService>(); var sh = settingService.GetAll().Where(x => x.Key == "QLZHGZ").FirstOrDefault(); if (sh != null) { if (!decimal.TryParse(sh.Value, out ShenHeMonery)) { ShenHeMonery = 5000; } } string code = this.txtUserCode.Text.Trim(); //用户编号 string seriaNo = ""; // this.txtSeriaNo.Text.Trim(); //业务单号 string beginDate = this.txtBeginDate.Text.Trim(); //业务开始日期 string endDate = this.txtEndDate.Text.Trim(); //业务截止日期 decimal beginMonery = -1; decimal endMoner = -1; if (!decimal.TryParse(this.txtBeginMonery.Text, out beginMonery) || !decimal.TryParse(this.txtEndMonery.Text.Trim(), out endMoner)) { beginMonery = -1; endMoner = -1; } int type = Convert.ToInt32(this.drpStates.SelectedValue); int recordCount = 0; IMentionQueusService mentionQueusService = IoC.Resolve <IMentionQueusService>(); List <Ytg.BasicModel.DTO.MentionDTO> result = mentionQueusService.SelectBy(code, seriaNo, beginDate, endDate, beginMonery, endMoner, type, pagerControl.CurrentPageIndex, ref recordCount); this.repList.DataSource = result; this.repList.DataBind(); this.pagerControl.RecordCount = recordCount; }
public static bool ManagerRecharge(decimal tradeAmt, int userid) { double bili = 5; ISysSettingService settingService = IoC.Resolve <ISysSettingService>(); var fs = settingService.GetAll().Where(x => x.Key == "chongzhiBili").FirstOrDefault(); if (null != fs) { if (!double.TryParse(fs.Value, out bili)) { bili = 5; } } ISysUserService userServices = IoC.Resolve <ISysUserService>(); ISysUserBalanceService userBalanceService = IoC.Resolve <ISysUserBalanceService>(); var balance = userBalanceService.GetUserBalance(userid);//获取当前用户余额 var minOutMonery = ((tradeAmt + balance.UserAmt) * (decimal)(bili / 100)); if (userServices.UpdateUserMinMinBettingMoney(userid, minOutMonery) > 0) { //更新用户提款流水要求 return(true); } return(false); }
protected void btnSave_Click(object sender, EventArgs e) { decimal changeMonery = 0m; if (!decimal.TryParse(this.txtinMonery.Text.Trim(), out changeMonery) || changeMonery <= 0) { JsAlert("充值金额格式错误!"); return; } var details = new SysUserBalanceDetail() { RelevanceNo = "system.recharge", SerialNo = "q" + Utils.BuilderNum(), Status = 0, TradeAmt = changeMonery, TradeType = radDefault.Checked?TradeType.系统充值:TradeType.分红, UserId = Convert.ToInt32(Request.QueryString["id"]) }; if (radKouk.Checked) { details.TradeType = TradeType.其他; details.TradeAmt = 0 - details.TradeAmt; changeMonery = 0 - changeMonery; } var userBalance = IoC.Resolve <ISysUserBalanceService>(); if (userBalance.UpdateUserBalance(details, changeMonery) > 0) { if (radDefault.Checked) { //普通充值,需增加提款限额 double bili = 5; ISysSettingService settingService = IoC.Resolve <ISysSettingService>(); var fs = settingService.GetAll().Where(x => x.Key == "chongzhiBili").FirstOrDefault(); if (null != fs) { if (!double.TryParse(fs.Value, out bili)) { bili = 5; } } ISysUserService userServices = IoC.Resolve <ISysUserService>(); var minOutMonery = (changeMonery * (decimal)(bili / 100)); if (userServices.UpdateUserMinMinBettingMoney(details.UserId, minOutMonery) > 0) { //更新用户提款流水要求 } } if (Request.Params["tp"] == "1")//分红 { JsAlert("分红成功", true); } else if (Request.Params["tp"] == "0") { JsAlert("充值成功", true); } else { JsAlert("扣减成功", true); } } else { JsAlert("充值失败,请关闭后重试", false); } }