示例#1
0
        public void Add(HistoryLotoFacil entity)
        {
            var query = @"
                    INSERT INTO [dbo].[HistoryLotoFacil]
                        (Concourse, DateAward, ValueAward, WinnersQuantity
                        ,Dozen1, Dozen2, Dozen3, Dozen4, Dozen5, Dozen6, Dozen7, Dozen8
                        ,Dozen9, Dozen10, Dozen11, Dozen12, Dozen13, Dozen14, Dozen15])
                    VALUES
                        (@Concourse, @DateAward, @ValueAward, @WinnersQuantity, @Dozen1
                        ,@Dozen2, @Dozen3, @Dozen4, @Dozen5, @Dozen6, @Dozen7, @Dozen8,
                        ,@Dozen9, @Dozen10, @Dozen11, @Dozen12, @Dozen13, @Dozen14, @Dozen15) ";


            using (var dbConnection = this._providerConnection.GetHBApostasConnection)
            {
                dbConnection.Execute(query, entity);
            }
        }
示例#2
0
        public static List <HistoryLotoFacil> ReadLatestBetsFromFile()
        {
            var stream = new StreamReader(@"C:\LotoFacil\CurrentLotoFacil.csv");

            string linha           = null;
            string currentConcurso = string.Empty;
            string newConcurso     = string.Empty;
            var    lotoFacil       = new HistoryLotoFacil();
            var    betsLotoFacil   = new List <HistoryLotoFacil>();
            int    indiceConcurso  = 0;
            string header          = "Conc.";

            while ((linha = stream.ReadLine()) != null)
            {
                string[] currentColunas = linha.Split(',');

                newConcurso = currentColunas[0];

                if (!newConcurso.Equals(header))
                {
                    if (newConcurso != currentConcurso)
                    {
                        indiceConcurso      = 0;
                        currentConcurso     = currentColunas[0];
                        lotoFacil           = new HistoryLotoFacil();
                        lotoFacil.Concourse = currentConcurso;
                        lotoFacil.DateAward = Convert.ToDateTime(currentColunas[1], new CultureInfo("pt-BR"));
                    }


                    indiceConcurso += 1;

                    if (indiceConcurso == 1)
                    {
                        lotoFacil.Dozen1 = Convert.ToInt32(currentColunas[2]);
                        lotoFacil.Dozen2 = Convert.ToInt32(currentColunas[3]);
                        lotoFacil.Dozen3 = Convert.ToInt32(currentColunas[4]);
                        lotoFacil.Dozen4 = Convert.ToInt32(currentColunas[5]);
                        lotoFacil.Dozen5 = Convert.ToInt32(currentColunas[6]);
                    }
                    else if (indiceConcurso == 2)
                    {
                        lotoFacil.Dozen6  = Convert.ToInt32(currentColunas[2]);
                        lotoFacil.Dozen7  = Convert.ToInt32(currentColunas[3]);
                        lotoFacil.Dozen8  = Convert.ToInt32(currentColunas[4]);
                        lotoFacil.Dozen9  = Convert.ToInt32(currentColunas[5]);
                        lotoFacil.Dozen10 = Convert.ToInt32(currentColunas[6]);
                    }
                    else if (indiceConcurso == 3)
                    {
                        lotoFacil.Dozen11         = Convert.ToInt32(currentColunas[2]);
                        lotoFacil.Dozen12         = Convert.ToInt32(currentColunas[3]);
                        lotoFacil.Dozen13         = Convert.ToInt32(currentColunas[4]);
                        lotoFacil.Dozen14         = Convert.ToInt32(currentColunas[5]);
                        lotoFacil.Dozen15         = Convert.ToInt32(currentColunas[6]);
                        lotoFacil.WinnersQuantity = Convert.ToInt32(currentColunas[7]);

                        if (lotoFacil.WinnersQuantity > 0)
                        {
                            lotoFacil.ValueAward = GetValueLineBetFromFile(currentColunas[8], currentColunas[9]);
                        }

                        betsLotoFacil.Add(lotoFacil);
                    }
                }
            }

            stream.Close();

            return(betsLotoFacil);
        }
示例#3
0
 public void Update(HistoryLotoFacil entity)
 {
     this._repository.Update(entity);
 }
示例#4
0
 public void Add(HistoryLotoFacil entity)
 {
     this._repository.Add(entity);
 }
示例#5
0
 public void Update(HistoryLotoFacil entity)
 {
     throw new NotImplementedException();
 }