Ejemplo n.º 1
0
        public void StartTransactionCommitRollback(MetodosGenericosEnum metodosGenericos)
        {
            try
            {
                using (var cn = Conexao.AbrirConexao())
                {
                    switch (metodosGenericos)
                    {
                    case MetodosGenericosEnum.START:
                        cn.Execute("START TRANSACTION");
                        break;

                    case MetodosGenericosEnum.COMMIT:
                        cn.Execute("COMMIT");
                        break;

                    case MetodosGenericosEnum.ROLLBACK:
                        cn.Execute("ROLLBACK");
                        break;

                    default:
                        cn.Execute("ROLLBACK");
                        break;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
 public void StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum metodosGenericos)
 {
     try
     {
         MetodosGenericosRepository.StartTransactionCommitRollback(metodosGenericos);
     }
     catch (Exception)
     {
         throw;
     }
 }