using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FilterAPI.Systems
{
    public class LuckyNumber
    {
        public static Int32 GetRandomNumber()
        {
            Random RandomGenerator = new Random();

            return RandomGenerator.Next(0, 1000);
        }

        public static List<Int32> GetWinners(Database SQL)
        {
            Int32 nLuckyNo = GetRandomNumber();

            List<Int32> nCharNos = SQL.GetnCharNosFromnLuckyNo(nLuckyNo);

            if (nCharNos.Count == 0) { return GetWinners(SQL); }
            else { return nCharNos; }
        }
    }
}
