diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index ed079f13c..4ed4b5dd5 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -23,11 +23,13 @@ Public Class ClsClientes 'Atributos de la clase Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN - Private CveConexion As Integer = 0 + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + #End Region - + #Region "Propiedades" - + Public Property CveCliente As Integer Public Property Nombre As String Public Property NombreComercial As String @@ -186,7 +188,8 @@ Public Class ClsClientes End Try Else SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -201,11 +204,11 @@ Public Class ClsClientes End With If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc Data = New DataTable - End Sub + End Sub #Region "Conexiones" - + Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index effb21dfd..a7b7a4a24 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5045,8 +5045,8 @@ Public Class ClsPaginas Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object) 'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks) - 'Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache - Session.Add(VSKey, pviewState) 'Store the ViewState on Cache + Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache + 'Session.Add(VSKey, pviewState) 'Store the ViewState on Cache ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", VSKey) End Sub @@ -5056,11 +5056,11 @@ Public Class ClsPaginas If Not VSKey.StartsWith("VIEWSTATE_") Then 'Request the Key from the page and validade it. Throw New Exception(String.Format("Invalid VIEWSTATE Key: {0}", VSKey)) End If - If Session(VSKey) Is Nothing Then 'si por algún motivo, el caché expiró, le dice a la página que se recargue y obtenga los datos de nuevo, y así evitar errores al obtener el viewstate vacío + If Cache(VSKey) Is Nothing Then 'si por algún motivo, el caché expiró, le dice a la página que se recargue y obtenga los datos de nuevo, y así evitar errores al obtener el viewstate vacío Response.Redirect(Request.RawUrl) Return Nothing Else - Return Session(VSKey) + Return Cache(VSKey) End If End Function @@ -5268,6 +5268,8 @@ Public Class ClsPaginas params.Add(param) Next Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + wsreport = Nothing + params = Nothing Else If IsNothing(MR) Then MR = New ReportViewer Try @@ -5340,6 +5342,7 @@ Public Class ClsPaginas End If sw.Stop() + If sw.Elapsed.TotalSeconds > 5 Then GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") End If @@ -5592,7 +5595,7 @@ Public Class ClsPaginas HttpContext.Current.Response.SuppressContent = True HttpContext.Current.ApplicationInstance.CompleteRequest() HttpContext.Current.Response.End() - + bytes = Nothing Catch ex As Exception If UsuarioActual.CveRol = 1 Then diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index 79b05c132..b63c12e88 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -209,24 +209,25 @@ Public Class ClsSisNotificaciones #Region "C O R R E O" Private Sub EnviarCorreos(DTNotificacionesCorreo As DataTable) - For Each notificacion As DataRow In DTNotificacionesCorreo.Rows - MandaMail(notificacion("CveNotificacionBitacora").ToString.ToEntero, notificacion("Encabezado").ToString, notificacion("Cuerpo").ToString, notificacion("Correo").ToString, "") + For Each notificacion As DataRow In DTNotificacionesCorreo.Rows + Dim Hilo As New System.Threading.Thread(Sub() MandaMail(notificacion("CveNotificacionBitacora").ToString.ToEntero, notificacion("Encabezado").ToString, notificacion("Cuerpo").ToString, notificacion("Correo").ToString, "")) + Hilo.Start() Next End Sub Private Sub MandaMail(CveNotificacionBitacora As Integer, Asunto As String, Cuerpo As String, Mail As String, MailCC As String) Dim ObjMail As New ClsSisMail() - + Dim ObjNotificacion As New ClsSisNotificaciones Try Dim ResultadoMail As Integer = 0 Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then - UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1) + ObjNotificacion.UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1) End If - Catch ex As Exception OnError("Ocurrió error al mandar el Mail", ex) End Try + ObjNotificacion.Dispose() End Sub #End Region @@ -1328,10 +1329,6 @@ Public Class ClsSisNotificaciones Next End If - If DTNotificacionesCorreo IsNot Nothing AndAlso DTNotificacionesCorreo.Rows.Count > 0 Then - EnviarCorreos(DTNotificacionesCorreo) - End If - If DTNotificacionesApp IsNot Nothing AndAlso DTNotificacionesApp.Rows.Count > 0 Then Dim DtTokens As DataTable = Nothing @@ -1389,6 +1386,10 @@ Public Class ClsSisNotificaciones DtTokens.Dispose() End If End If + End If + + If DTNotificacionesCorreo IsNot Nothing AndAlso DTNotificacionesCorreo.Rows.Count > 0 Then + EnviarCorreos(DTNotificacionesCorreo) End If If Not DTNotificacionesApp Is Nothing Then DTNotificacionesApp.Dispose() diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 2032e20f1..0c2141fd0 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -192,10 +192,10 @@ Namespace Extensiones Public Sub GuardaLogAD(Mensaje As String, Optional Archivo As String = "Log") Dim ArchivoW As StreamWriter - Dim MensajeFormato = $"{Chr(13)}{Chr(10)}Log: {Mensaje} | Fecha:{Now.ToString("dd/MM/yyyy HH:mm")}" + Dim MensajeFormato = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, Now.ToString("dd/MM/yyyy HH:mm")) Try - ArchivoW = New StreamWriter($"{AppDomain.CurrentDomain.BaseDirectory}\Log\{Archivo}.txt", True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\{1}.txt", AppDomain.CurrentDomain.BaseDirectory, Archivo), True, System.Text.Encoding.UTF8) Catch ex As UnauthorizedAccessException 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) Exit Sub diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 1cc586d2c..67a28c29a 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -2292,7 +2292,7 @@ Partial Class Bancos_ProveedoresAbonar 'If Archivo.Exists Then Msg.AppendFormat("
  • Imprimir movimiento
  • ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE))) 'End If - Msg.AppendFormat("
  • Listado
  • ", CveIE) + Msg.AppendFormat("
  • Listado
  • ", Encripta(String.Format("Opcion=ImprimeMov&CveIE={0}", CveIE))) If IDPoliza > 0 Then Msg.AppendFormat("
  • Póliza
  • ", IDPoliza) Dim Mensaje As String = String.Format("
    El Documento se generó correctamente.


    Descargas:", Msg.ToString) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 548e22999..afbf7ad7b 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -4047,6 +4047,7 @@ Partial Class PopUpVerFactura ObjCompra.Dispose() Dim rds2 = New ReportDataSource("DataSet2", dtnc) reportDataSetsList.Add(rds2) + dtnc.Dispose() Dim paramList As New List(Of ReportParameter) With paramList @@ -4075,15 +4076,19 @@ Partial Class PopUpVerFactura End If End With + dtMovs.Dispose() - - ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientos.rdlc", reportDataSetsList, paramList, "IE Movimient", "PDF") + ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientos.rdlc", reportDataSetsList, paramList, ObjIE.Folio, "PDF") End If End If End If + DtGvRH.Dispose() + DtComprobacion.Dispose() + ParamComprobacion.Dispose() + ObjIE.Dispose() End Sub diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 6b3f13f29..87e301517 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -1432,11 +1432,11 @@ Partial Class Compras_ReembolsosComprobaciones Dim Mensaje As New StringBuilder If CvePrePolizaExcedente > 0 Then - Mensaje.AppendFormat("Abono Registrado Correctamente.

    Cheque: {1}

    Imprimir", CveIEExcedente, TxtFolio.Text) + Mensaje.AppendFormat("Abono Registrado Correctamente.

    Cheque: {1}

    Imprimir", CveIEExcedente, TxtFolio.Text, Encripta(String.Format("Opcion=ImprimeMov&CveIE={0}", CveIEExcedente))) Mensaje.AppendFormat("

    Póliza: {1}
    ", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) Else - Mensaje.AppendFormat("Abono Registrado Correctamente.

    Imprimir", CveIERegistrado) + Mensaje.AppendFormat("Abono Registrado Correctamente.

    Imprimir", Encripta(String.Format("Opcion=ImprimeMov&CveIE={0}", CveIERegistrado))) If CvePrePolizaIERegistrado > 0 Then Mensaje.AppendFormat("

    Póliza: {1}
    ", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) End If diff --git a/Empresas/13/Formatos/OC.rdlc b/Empresas/13/Formatos/OC.rdlc index 281ecf1a6..d4506917f 100644 --- a/Empresas/13/Formatos/OC.rdlc +++ b/Empresas/13/Formatos/OC.rdlc @@ -3089,6 +3089,46 @@ 2pt + + true + true + + + + + Cuentas Bancarias: + + + + =Parameters!Cuentas.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + 5.19589in + + true + true + + + + + Cuentas Bancarias: + + + + =Parameters!Cuentas.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + 5.1933in