Пример #1
0
        public override void PopulateManagerFromExcelUsingDb(string path)
        {
            var easyLotteryResults = new List<EasyLottery>();

            IList<int> dozens = new List<int>();

            var connectionString = string.Format(_connectionStringFormat, path);

            var dt = GetDataTable(connectionString);

            foreach (DataRow rowValue in dt.Rows)
            {
                if (rowValue[0] == DBNull.Value)
                    continue;

                var easyLottery = new EasyLottery
                {
                    Concourse = Convert.ToInt16(rowValue[0]),
                    Date = Convert.ToDateTime(rowValue[1]),
                    FirstDozen = Convert.ToInt16(rowValue[2]),
                    SecondDozen = Convert.ToInt16(rowValue[3]),
                    ThirdDozen = Convert.ToInt16(rowValue[4]),
                    FourthDozen = Convert.ToInt16(rowValue[5]),
                    FifthDozen = Convert.ToInt16(rowValue[6]),
                    SixthDozen = Convert.ToInt16(rowValue[7]),
                    SeventhDozen = Convert.ToInt16(rowValue[8]),
                    EighthDozen = Convert.ToInt16(rowValue[9]),
                    NinethDozen = Convert.ToInt16(rowValue[10]),
                    TenthDozen = Convert.ToInt16(rowValue[11]),
                    EleventhDozen = Convert.ToInt16(rowValue[12]),
                    TwelfthDozen = Convert.ToInt16(rowValue[13]),
                    ThirteenthDozen = Convert.ToInt16(rowValue[14]),
                    FourteenthDozen= Convert.ToInt16(rowValue[15]),
                    FifteenthDozen = Convert.ToInt16(rowValue[16]),
                };

                easyLotteryResults.Add(easyLottery);

                PopulateHowMany(easyLottery);
            }

            PopulateLastTenResults(easyLotteryResults);

            //Manager.Instance.Results = easyLotteryResults;
        }
Пример #2
0
 private static void PopulateHowMany(EasyLottery easyLottery)
 {
     Manager.Instance.IncludeDozenInHowMany(easyLottery.FirstDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.SecondDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.ThirdDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.FourthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.FifthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.SixthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.SeventhDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.EighthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.NinethDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.TenthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.EleventhDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.TwelfthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.ThirteenthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.FourteenthDozen);
     Manager.Instance.IncludeDozenInHowMany(easyLottery.FifteenthDozen);
 }