Example #1
0
        public static void Persiste(IList <IAcaoProbabilidade> acaoProbabilidade)
        {
            DBConnect.AbreConexaoSeNaoEstiverAberta();

            try
            {
                foreach (IAcaoProbabilidade p in acaoProbabilidade)
                {
                    IDbCommand command = DBConnect.Connection.CreateCommand();
                    command.CommandText = AcaoProbabilidadeContexto.ToInsertQuery(p);
                    command.ExecuteNonQuery();
                }
            }
            catch (Exception e)
            {
                throw;
            }
            finally
            {
                DBConnect.FecharConexao();
            }
        }
Example #2
0
        public static void Persiste(IAcaoProbabilidade simulacaoCallPreFlop)
        {
            if (simulacaoCallPreFlop == null)
            {
                return;
            }

            DBConnect.AbreConexaoSeNaoEstiverAberta();

            try
            {
                IDbCommand command = DBConnect.Connection.CreateCommand();
                command.CommandText = AcaoProbabilidadeContexto.ToInsertQuery(simulacaoCallPreFlop);
                command.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                DBConnect.FecharConexao();
            }
        }