Example #1
0
 public void BeginTransaction(IsolationLevel objIso)
 {
     try
     {
         using (var lTC = TransactionControler.GetObject(ConnectionString))
             lTC.BeginTran(objIso);
     }
     catch (DALException ex)
     {
         throw new BLLException(ex.Message,
                                this.GetType().Name,
                                MethodBase.GetCurrentMethod().Name,
                                Properties.Mensagens.Erro_BeginTransaction,
                                ex);
     }
     catch (BLLException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new BLLException(ex.Message,
                                this.GetType().Name,
                                MethodBase.GetCurrentMethod().Name,
                                Properties.Mensagens.Erro_Geral,
                                ex);
     }
 }
Example #2
0
 public virtual void RollbackTransaction()
 {
     try
     {
         using (var lTC = TransactionControler.GetObject(ConnectionString))
             lTC.RollbackTran();
     }
     catch (DALException ex)
     {
         throw new BLLException(ex.Message,
                                this.GetType().Name,
                                MethodBase.GetCurrentMethod().Name,
                                Properties.Mensagens.Erro_RollbackTransaction,
                                ex);
     }
     catch (BLLException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new BLLException(ex.Message,
                                this.GetType().Name,
                                MethodBase.GetCurrentMethod().Name,
                                Properties.Mensagens.Erro_Geral,
                                ex);
     }
 }
Example #3
0
 public virtual bool IsTransactionStarted()
 {
     try
     {
         using (var lTC = TransactionControler.GetObject(ConnectionString))
             return(lTC.IsTransactionStarted);
     }
     catch (DALException ex)
     {
         throw new BLLException(ex.Message,
                                this.GetType().Name,
                                MethodBase.GetCurrentMethod().Name,
                                Properties.Mensagens.Erro_CommitTransaction,
                                ex);
     }
     catch (BLLException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new BLLException(ex.Message,
                                this.GetType().Name,
                                MethodBase.GetCurrentMethod().Name,
                                Properties.Mensagens.Erro_Geral,
                                ex);
     }
 }