Esempio n. 1
0
        /* Проверяем response после сделанной ставки(place bet) */
        protected void ManagePlaceResult(Bet bet, JToken placeResult)
        {
            using (Logger.BeginScope(LoggerHelper.GetCaller()))
            {
                var responseCoupon = placeResult["responseCoupon"];
                var errors         = responseCoupon["generalErrors"];

                if (errors != null)
                {
                    IdentifyError(bet, errors);
                    return;
                }

                SetMatchedSingleOdds(responseCoupon);

                var historyCoupon = responseCoupon["historyCoupon"];
                var totalStake    = (int?)historyCoupon["stake"] ?? 0;
                var countStakes   = historyCoupon["systems"]?.First()["bets"]?.Count() ?? 0;
                var unitStake     = totalStake / countStakes;

                CurrentBetslip.Status = BetslipStatus.Placed;
                var betToPlace = CurrentBetslip.GetBetToPlace();
                CurrentBetslip.SetMatched(betToPlace, (double)unitStake / 1000, (double)totalStake / 1000, bet.EW);
            }
        }
Esempio n. 2
0
        protected Bet GetBetToPlace()
        {
            var bet = CurrentBetslip.GetBetToPlace();

            if (bet == null)
            {
                throw new Exception("No bets to place");
            }
            return(bet);
        }