Example #1
0
 internal static BuildResult Build(User user, LotterySpecies specie,
     FastBetItem fastBetItem, GameType gameType, LimitChecker checker = null)
 {
     var builder = new FastBetOrderBuilder();
     if (checker != null) builder.Checker = checker;
     return new BuildResult
     {
         Sheet = builder.BuildOrder(user, specie, new[] { fastBetItem },
             new Dictionary<string, object> { { "GameType", gameType } }),
         Result = builder.BetResult
     };
 }
Example #2
0
 public BetResult AddBet(User member, LotterySpecies specie, FastBetItem fastBetItem, GameType gameType = GameType.TwoDigital)
 {
     //var betSheetDic = OrderBuilder.BuildFastBetOrder(member, specie, fastBetItem, gameType);
     var result = OrderBuilder.Build(member, specie, fastBetItem, gameType);
     AddBetSheet(member, result.Sheet, result.Result.ActualTurnover);
     return result.Result;
 }
Example #3
0
 public IDictionary<BetSheet, IList<BetOrder>> BuildFastBetOrder(User user, LotterySpecies specie, FastBetItem fastBetItem, GameType gameType)
 {
     this._betResult = new BetResult();
     var todayLotteryCompany = TodayLotteryCompany.Instance.GetTodayCompany();       //获取今日开奖公司
     var memberComm = CommManager.GetMemberCommissionInSession(user, specie);        //获取会员的佣金
     Dictionary<BetSheet, IList<BetOrder>> betSheetDic = new Dictionary<BetSheet, IList<BetOrder>>();    //注单字典
     List<WagerItem> betWagerList = new List<WagerItem>();        //下注金額列表
     StringBuilder betCompanySB = new StringBuilder();
     BetSheet sheet = new BetSheet               //注单
     {
         Num = "FastBet" + EnumHelper.GetEnumDescript(gameType).Description,
         UserId = user.UserId,
         Status = BetStatus.Valid
     };
     betSheetDic.Add(sheet, new List<BetOrder>());
     foreach (var companyId in fastBetItem.Companys)
     {
         IList<long> fullArrangementNum = null;      //全排列号码
         var company = todayLotteryCompany.Find(it => it.CompanyId == companyId);        //找到对应的公司
         var companyType = company.CompanyType;
         foreach (var gpwId in fastBetItem.GamePlayWays)
         {
             CheckBetWager(gpwId, fastBetItem.IsFullPermutation, fastBetItem.Wager, betWagerList);
             var wager = new WagerItem { GamePlayTypeId = gpwId, Wager = fastBetItem.Wager, IsFullPermutation = fastBetItem.IsFullPermutation };
             foreach (var num in fastBetItem.NumList)
             {
                 AddOrderToDic(betSheetDic[sheet], companyType, company, memberComm, num, wager, user, fullArrangementNum, false);
             }
         }
         betCompanySB.AppendFormat("{0} ", company.Abbreviation);    //现在只记录公司名称即可
         sheet.BetCompany = betCompanySB.ToString();
         sheet.BetAmount = GetBetWagerData(betSheetDic[sheet], betWagerList);
     }
     return betSheetDic;
 }