public int AddShuffleNumber(ShuffleNumber ShuffleNumber)
 {
     lock (Connection)
     {
         return(Connection.Insert(ShuffleNumber));
     }
 }
        internal void LoadNumberSetNumbersData(NumberSet numberSet, bool shuffle)
        {
            NumberSet = numberSet;
            _shuffleNumbers.Clear();
            _shuffle = new Shuffle();

            List <ShuffleNumber> shuffleNumbers = new List <ShuffleNumber>();

            foreach (NumberSetNumber numberSetNumber in numberSet.NumberSetNumbers)
            {
                ShuffleNumber shuffleNumber = new ShuffleNumber
                {
                    Number = numberSetNumber.Number,
                    Order  = -1
                };
                shuffleNumbers.Add(shuffleNumber);
            }

            if (shuffle)
            {
                IList <int> numbersToShuffle = shuffleNumbers.Select(x => x.Number).ToList();
                numbersToShuffle.FisherYatesShuffle(new Random());

                foreach (ShuffleNumber shuffleNumber in shuffleNumbers)
                {
                    shuffleNumber.Order = numbersToShuffle.IndexOf(shuffleNumber.Number);
                }
            }
            _shuffleNumbers.AddRange(shuffleNumbers.OrderBy(x => x.Order));
        }
 internal void AddShuffleNumber(ShuffleNumber shuffleNumber)
 {
     _lotteryDatabase.AddShuffleNumber(shuffleNumber);
 }
 internal void RemoveShuffleNumber(ShuffleNumber shuffleNumber)
 {
     _lotteryDatabase.DeleteShuffleNumber(shuffleNumber.ShuffleNumberID);
 }