Exemplo n.º 1
0
        /// <summary>
        /// Runs when selected customer is changed.
        /// </summary>
        protected override void OnSelectedCustomerChanged()
        {
            CustomerBets.Clear();

            if (KeyedCustomersData.ContainsKey(SelectedCustomer))
            {
                List <CustomerBet> unususalCustomerBets = KeyedCustomersData[SelectedCustomer].Where(b => b.WinAmount > 0.6m * b.StakeAmount).ToList();
                unususalCustomerBets.ForEach(CustomerBets.Add);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Runs when selected customer is changed.
        /// </summary>
        protected override void OnSelectedCustomerChanged()
        {
            CustomerBets.Clear();

            if (KeyedCustomersData.ContainsKey(SelectedCustomer))
            {
                List <CustomerBet> customerItems = KeyedCustomersData[SelectedCustomer];

                var average = customerItems.Sum(i => i.StakeAmount) / customerItems.Count;
                customerItems.ForEach(cb =>
                {
                    if (cb.WinAmount > 0.6m * cb.StakeAmount)
                    {
                        cb.RiskyUnsettledBetSeverity = RiskSeverity.Risky;
                    }
                    if (cb.StakeAmount > 10 * average)
                    {
                        cb.RiskyUnsettledBetSeverity = RiskSeverity.Unusual;
                    }
                    if (cb.StakeAmount > 30 * average)
                    {
                        cb.RiskyUnsettledBetSeverity = RiskSeverity.HighlyUnusual;
                    }
                    if (cb.WinAmount >= 1000m)
                    {
                        cb.RiskyUnsettledBetSeverity = RiskSeverity.HighWonAmount;
                    }
                });

                List <CustomerBet> riskyCustomerBets = (from cb in customerItems
                                                        where cb.WinAmount > 0.6m * cb.StakeAmount ||
                                                        cb.StakeAmount > 10 * average ||
                                                        cb.StakeAmount > 30 * average ||
                                                        cb.WinAmount >= 1000m
                                                        select cb).ToList();

                riskyCustomerBets.ForEach(CustomerBets.Add);
            }
        }