From cf0f9b5ebe9ebd5d61449a082a2675eedce5548c Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Sep 2021 12:18:02 -0700 Subject: [PATCH] cambio de lugar de dispose --- App_Code/ClsContabilidad.vb | 54 +++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 728d1d200..5615d03b2 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -6229,30 +6229,6 @@ Public Class ClsContabilidad #End Region -#Region "IDisposable Support" - ' IDisposable - Protected Overridable Sub Dispose(disposing As Boolean) - If Not Me.disposedValue Then - If disposing Then - - If Not Data Is Nothing Then Data.Dispose() : Data = Nothing - If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing - If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing - If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() - If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing - - End If - End If - Me.disposedValue = True - End Sub - Public Sub Dispose() Implements IDisposable.Dispose - ConexionClose() - Dispose(True) - GC.SuppressFinalize(Me) - End Sub -#End Region #Region "Periodos Bloqueo Meses" Public Function GetPeriodosBloqueo(CveEmpresa As Integer) As Boolean Dim Retorno = False @@ -6376,8 +6352,6 @@ Public Class ClsContabilidad End Function #End Region - - #Region "ESTADO RESULTADOS HORIZONTAL" @@ -6567,4 +6541,32 @@ Public Class ClsContabilidad Return Retorno End Function + + +#Region "IDisposable Support" + ' IDisposable + Protected Overridable Sub Dispose(disposing As Boolean) + If Not Me.disposedValue Then + If disposing Then + + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing + If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing + If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + + End If + End If + Me.disposedValue = True + End Sub + Public Sub Dispose() Implements IDisposable.Dispose + ConexionClose() + Dispose(True) + GC.SuppressFinalize(Me) + End Sub +#End Region + + End Class \ No newline at end of file