/// <summary> /// 投注 /// </summary> /// <param name="obj"></param> void DoBetWindow(object obj) { HowToPlayOfBet tH = this.HowToPlays.FirstOrDefault(x => x.Selected); HowToPlayExport howToPlay = this.Ticket .Tags.First(x => x.Name == this.Tags.First(t => t.Selected).Name) .HowToPlays.First(x => x.Name == tH.Name); #region 选号 List<BetSeatImport> bs = new List<BetSeatImport>(); if (howToPlay.IsDuplex == false && howToPlay.Interface == LotteryInterface.任N直选) { BetSeatImport bsImport = new BetSeatImport { SeatNmae = "选号", Values = this.ContextOfSelected }; bs.Add(bsImport); } else { this.Seats.ToList() .ForEach(seat => { BetSeatImport bsImport = new BetSeatImport { SeatNmae = seat.Name, Values = string.Join(",", seat.Nums.Where(x => x.Selected).OrderBy(x => x.Num).Select(x => x.Num).ToList()) }; bs.Add(bsImport); }); } #endregion #region 追号 List<BettingWithChasingImport> bws = null; if (this.BettingWithChasings.Count > 0) { bws = new List<BettingWithChasingImport>(); this.BettingWithChasings.ToList() .ForEach(bettingWithChasing => { BettingWithChasingImport bw = new BettingWithChasingImport { Issue = bettingWithChasing.Issue, Multiple = bettingWithChasing.Multiple }; bws.Add(bw); }); } #endregion BetImpoert import = new BetImpoert { HowToPlayId = howToPlay.Id, Issue = this.Ticket.NextIssue, Multiple = this.Multiple, Points = this.Point, Token = DataManager.GetValue<string>(DataKey.IWorld_Client_Token), Seats = bs, BettingWithChasings = bws }; lotteryClient.BetAsync(import); }
/// <summary> /// 投注 /// </summary> /// <param name="import">数据集</param> /// <returns>返回操作结果</returns> public NormalResult Bet(BetImpoert import) { try { import.CheckAllowExecuteOrNot(db); import.DoBet(db); return new NormalResult(); } catch (Exception ex) { return new NormalResult(ex.Message); } }