From 1afd8aa2812453d2153d4a55f9bce2c0c5131c90 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 19 Feb 2023 20:13:24 -0700 Subject: [PATCH] -- mejoras en globalDT --- App_Code/ClsPaginas.vb | 192 +++++++++++++-------- Bancos/PopUpBuscarCuentasProveedor.aspx.vb | 11 -- Bancos/ProveedoresAbonar.aspx.vb | 29 +--- Bancos/ProveedoresCreditos.aspx.vb | 18 -- Compras/Proveedores.aspx.vb | 15 +- Global.asax | 97 ----------- Inicio.aspx.vb | 2 +- OI/Desarrollo.aspx.vb | 2 +- OI/RepDesarrollo.aspx.vb | 2 +- OI/SoporteADS.aspx.vb | 2 +- Sistemas/EmpresasModulos.aspx.vb | 2 +- Ventas/Clientes.aspx.vb | 8 +- ZDG/MensajeAutomatico.aspx.vb | 5 +- 13 files changed, 145 insertions(+), 240 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 52d10bc83..1ece45ca0 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -187,7 +187,7 @@ Public Class ClsPaginas If CveCliente <> -1 Then filtros.Add($"CveCliente = {CveCliente}") If CveProveedor <> -1 Then filtros.Add($"CveProveedor = {CveProveedor}") If filtros.Count > 0 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTUsuarios = Dv.ToTable Dv.Dispose() Else @@ -572,21 +572,37 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTProveedoresCuentas(CveProveedor As Integer, Estatus As Boolean) As DataTable + Property GlobalDTProveedoresCuentas(CveEmpresa As Integer, CveProveedor As Integer, Optional CveCuentaDeposito As Integer = -1) As DataTable Get - GlobalDTProveedoresCuentas = DirectCast(Application("GlobalDTProveedoresCuentas"), DataTable) + Dim AppNombre As String = $"GlobalDTProveedoresCuentas-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProveedoresBancos As New ClsGenerales + If ObjProveedoresBancos.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveProveedor:=-1, CveCliente:=-2, CvePersonal:=-2) Then Application(AppNombre) = ObjProveedoresBancos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveProveedor <> -1 Then filtros.Add($"CveProveedor = {CveProveedor}") + If CveCuentaDeposito <> -1 Then filtros.Add($"CveCuentaDeposito = {CveCuentaDeposito}") + + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTProveedoresCuentas = Dv.ToTable + Dv.Dispose() + Else + GlobalDTProveedoresCuentas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If End Get Set(value As DataTable) - Application("GlobalDTProveedoresCuentas") = value + Dim AppNombre As String = $"GlobalDTProveedoresCuentas-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Property GlobalDTCuentasDepositosClientes(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional Estatus As Boolean = True) As DataTable Get Dim AppNombre As String = $"GlobalDTCuentasDepositosClientes-{CveEmpresa}" - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim P As New ClsGenerales - If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-2) Then Application(AppNombre) = P.DtResultados + If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-1, CveProveedor:=-2, CvePersonal:=-2) Then Application(AppNombre) = P.DtResultados P.Dispose() End If Dim Str As New StringBuilder @@ -622,7 +638,6 @@ Public Class ClsPaginas Property GlobalDTProveedorSucursales(CveProveedor As Integer, CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTProveedorSucursales-{CveEmpresa}" - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim P As New ClsCompProveedores If P.GetSucursales(-1, CveEmpresa) Then Application(AppNombre) = P.DtResultados @@ -643,16 +658,19 @@ Public Class ClsPaginas End Property Property GlobalDTRoles(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTRoles"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTRoles = Dv.ToTable - Dv.Dispose() - Else - GlobalDTRoles = DirectCast(Application("GlobalDTRoles"), DataTable) + Dim AppNombre As String = $"GlobalDTRoles-{CveEmpresa}" + If Application(AppNombre) Is Nothing Then + Using ObjRoles As New ClsSisRoles + If ObjRoles.GetRoles(-1, CveEmpresa) Then Application(AppNombre) = ObjRoles.DtResultados + End Using End If + + GlobalDTRoles = DirectCast(Application(AppNombre), DataTable) + End Get Set(ByVal value As DataTable) - Application("GlobalDTRoles") = value + Dim AppNombre As String = $"GlobalDTRoles-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Property GlobalDTNomSatBancos() As DataTable @@ -809,7 +827,6 @@ Public Class ClsPaginas Public Shared Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones-{CveEmpresa}" - 'sino existe, recarga los datos If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados @@ -872,35 +889,48 @@ Public Class ClsPaginas End Property Property GlobalDTClasificacionesSubProyectos(Optional CveClasificacion As Integer = -1, Optional CveEmpresa As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificacionesSubProyecto"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTClasificacionesSubProyectos-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetDTClasificacionesSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") + ObjClasificaciones.Dispose() + End If + Dim filtros As New List(Of String) + If CveClasificacion <> -1 Then filtros.Add($"CveCategoria = {CveClasificacion}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTClasificacionesSubProyectos = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificacionesSubProyectos = DirectCast(Application("GlobalDTClasificacionesSubProyecto"), DataTable) + GlobalDTClasificacionesSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTClasificacionesSubProyecto") = value + Dim AppNombre As String = $"GlobalDTClasificacionesSubProyectos-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Property GlobalDTACClasificadorObjetoGasto(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - Dim Dv As New DataView(DirectCast(Application("GlobalDTACClasificadorObjetoGasto"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTACClasificadorObjetoGasto-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") + ObjClasificaciones.Dispose() + End If + Dim filtros As New List(Of String) + If CveCategoria <> -1 Then filtros.Add($"CveCategoria = {CveCategoria}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTACClasificadorObjetoGasto = Dv.ToTable Dv.Dispose() Else - GlobalDTACClasificadorObjetoGasto = DirectCast(Application("GlobalDTACClasificadorObjetoGasto"), DataTable) + GlobalDTACClasificadorObjetoGasto = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTACClasificadorObjetoGasto") = value + Dim AppNombre As String = $"GlobalDTACClasificadorObjetoGasto-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Property GlobalDTClasificacionesDetalle(Optional CveEmpresa As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable @@ -960,7 +990,6 @@ Public Class ClsPaginas Property GlobalDTCategoriasPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTCategoriasPresupuestos-{CveEmpresa}" - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjGenerales As New ClsGenerales If ObjGenerales.GetCategorias(CveEmpresa, 3) Then Application(AppNombre) = ObjGenerales.DtResultados @@ -976,7 +1005,6 @@ Public Class ClsPaginas Property GlobalDTChoferes(CveEmpresa As Integer, Optional CveChofer As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTChoferes-{CveEmpresa}" - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjAcar As New ClsAcarreos() If ObjAcar.GetChofer(-1, CveEmpresa, 1, -1) Then @@ -1024,12 +1052,29 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTModulos() As DataTable + Property GlobalDTModulos(Optional CveModulo As Integer = -1) As DataTable Get - GlobalDTModulos = DirectCast(Application("GlobalDTModulos"), DataTable) + Dim AppNombre As String = "GlobalDTModulos" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Using ObjModulos As New ClsModulos + If ObjModulos.GetModulos(-1, -1, "-1", "-1") Then Application(AppNombre) = ObjModulos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveModulo <> -1 Then filtros.Add($"CveModulo = {CveModulo}") + + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTModulos = Dv.ToTable + Dv.Dispose() + Else + GlobalDTModulos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If + End Get Set(ByVal value As DataTable) - Application("GlobalDTModulos") = value + Dim AppNombre As String = "GlobalDTModulos" + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTMonedas() As DataTable @@ -1932,43 +1977,44 @@ Public Class ClsPaginas End Set End Property 'Variables para Ventas - Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional VendedorTipo As Integer = 1) As DataTable + Public Shared Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional VendedorTipo As Integer = 1) As DataTable Get Dim AppNombre As String = $"GlobalDTVendedores-{CveEmpresa}" - 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjVendedores As New ClsVtaVendedores - If ObjVendedores.GetVendedores(CveEmpresa) Then Application(AppNombre) = ObjVendedores.DtResultados + If ObjVendedores.GetVendedores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjVendedores.DtResultados ObjVendedores.Dispose() End If Dim filtros As New List(Of String) If VendedorTipo >= 0 Then filtros.Add($"VendedorTipo = {VendedorTipo}") If Estatus >= 0 Then filtros.Add($"CveEstatus = {Estatus}") If filtros.Count > 0 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTVendedores = Dv.ToTable Dv.Dispose() Else - GlobalDTVendedores = DirectCast(Application(AppNombre), DataTable) + GlobalDTVendedores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTVendedores-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTClientesCorporativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClientesCorporativo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClientesCorporativo = DirectCast(Application("GlobalDTClientesCorporativo"), DataTable) + Dim AppNombre As String = $"GlobalDTClientesCorporativo-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjCorporativo As New ClsClientes + If ObjCorporativo.GetCorporativo(CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjCorporativo.DtResultados + End Using End If + GlobalDTClientesCorporativo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get + Set(value As DataTable) - Application("GlobalDTClientesCorporativo") = value + Dim AppNombre As String = $"GlobalDTClientesCorporativo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTCompProveedores(CveEmpresa As Integer, Optional CveProveedor As Integer = -1, Optional RFC As String = "-1") As DataTable @@ -1997,12 +2043,20 @@ Public Class ClsPaginas End Set End Property 'EstatusFactura - Property GlobalDTCompEstatusFactura() As DataTable + Public Shared Property GlobalDTCompEstatusFactura() As DataTable Get - GlobalDTCompEstatusFactura = DirectCast(Application("GlobalDTCompEstatusFactura"), DataTable).FiltraParametros("Estatus = 'Activo'") + Dim AppNombre As String = "GlobalDTCompEstatusFactura" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjEstatusFacturaCompra As New ClsCompEstatusFactura + If ObjEstatusFacturaCompra.GetEstatusFactura Then HttpContext.Current.Application(AppNombre) = ObjEstatusFacturaCompra.DtResultados + End Using + End If + + GlobalDTCompEstatusFactura = DirectCast(HttpContext.Current.Application(AppNombre), DataTable).FiltraParametros("Estatus = 'Activo'") End Get Set(value As DataTable) - Application("GlobalDTCompEstatusFactura") = value + Dim AppNombre As String = "GlobalDTCompEstatusFactura" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTContratosSecciones() As DataTable @@ -2282,17 +2336,17 @@ Public Class ClsPaginas #Region "***********************************************************************DT EVENTOS****************************************************************************************" Property GlobalDTTiposEventos() As DataTable Get - Dim AppNombre As String = $"GlobalDTTiposEventos" + Dim AppNombre As String = "GlobalDTTiposEventos" If HttpContext.Current.Application(AppNombre) Is Nothing Then - Dim ObjTiposEventos As New ClsTiposEventos - If ObjTiposEventos.GetTiposEventos() Then HttpContext.Current.Application(AppNombre) = ObjTiposEventos.DtResultados - ObjTiposEventos.Dispose() + Using ObjTiposEventos As New ClsTiposEventos + If ObjTiposEventos.GetTiposEventos() Then HttpContext.Current.Application(AppNombre) = ObjTiposEventos.DtResultados + End Using End If GlobalDTTiposEventos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Dim AppNombre As String = $"GlobalDTTiposEventos" + Dim AppNombre As String = "GlobalDTTiposEventos" Application(AppNombre) = value End Set End Property @@ -3218,7 +3272,7 @@ Public Class ClsPaginas End If Dim filtros As New List(Of String) If CveUsuario > 0 Then filtros.Add($"CveUsuario = {CveUsuario}") - If Tipo <> "" Then filtros.Add($"Tipo = {Tipo}") + If Tipo <> "" Then filtros.Add($"Tipo = '{Tipo}'") If filtros.Count > 0 Then Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTOCEstatusUsuarios = Dv.ToTable @@ -6599,18 +6653,18 @@ Public Class ClsPaginas params.Add(New ReportParameter("Comprador", ObjOC.UsuarioAsignado)) End If If UsuarioActual.CveEmpresa.Contiene(13, 83) Then - Dim ObjCuentasBancos As New ClsGenerales() - If ObjCuentasBancos.GetCuentasDepositos(CveProveedor:=ObjOC.CveProveedor) Then - Dim CuentasActivas As DataTable = ObjCuentasBancos.DtResultados.FiltraParametros("EstatusTexto = 'Activo'") - Dim CuentasStr As New StringBuilder("") - For Each CuentasBancarios As DataRow In CuentasActivas.Rows - Dim CuentaClabe As String = If(CuentasBancarios.Item("BancoNombre").ToString.Contains("BBVA") Or CuentasBancarios.Item("BancoNombre").ToString.Contains("BANCOMER"), CuentasBancarios.Item("Cuenta").ToString, CuentasBancarios.Item("CLABE").ToString) - Dim infoCuenta As String = String.Format("
{0} {1}: {2}", CuentasBancarios.Item("BancoNombre").ToString, CuentasBancarios.Item("Abreviatura").ToString, CuentaClabe) - CuentasStr.AppendFormat(infoCuenta) - Next - params.Add(New ReportParameter("Cuentas", CuentasStr.ToString)) - End If - ObjCuentasBancos.Dispose() + 'Dim ObjCuentasBancos As New ClsGenerales() + 'If ObjCuentasBancos.GetCuentasDepositos(CveProveedor:=ObjOC.CveProveedor) Then + Dim CuentasActivas As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=ObjOC.CveProveedor).FiltraParametros("EstatusTexto = 'Activo'") + Dim CuentasStr As New StringBuilder("") + For Each CuentasBancarios As DataRow In CuentasActivas.Rows + Dim CuentaClabe As String = If(CuentasBancarios.Item("BancoNombre").ToString.Contains("BBVA") Or CuentasBancarios.Item("BancoNombre").ToString.Contains("BANCOMER"), CuentasBancarios.Item("Cuenta").ToString, CuentasBancarios.Item("CLABE").ToString) + Dim infoCuenta As String = String.Format("
{0} {1}: {2}", CuentasBancarios.Item("BancoNombre").ToString, CuentasBancarios.Item("Abreviatura").ToString, CuentaClabe) + CuentasStr.AppendFormat(infoCuenta) + Next + params.Add(New ReportParameter("Cuentas", CuentasStr.ToString)) + 'End If + 'ObjCuentasBancos.Dispose() End If 'params.Add(New ReportParameter("FechaOC", ObjOC.Fecha.ToShortDateString)) Dim RutaFisicaSol As String = String.Format("Empresas\{0}\Firmas\{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol) diff --git a/Bancos/PopUpBuscarCuentasProveedor.aspx.vb b/Bancos/PopUpBuscarCuentasProveedor.aspx.vb index 48c16f351..3fa053889 100644 --- a/Bancos/PopUpBuscarCuentasProveedor.aspx.vb +++ b/Bancos/PopUpBuscarCuentasProveedor.aspx.vb @@ -83,18 +83,7 @@ Partial Class Bancos_PopUpBuscarCuentasProveedor ObjCuentasBancos.Dispose() CargaPSGridCuentasBancos() - RecargaGlobalCuentasBancarias() - End Sub - Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) - If CveProveedor > 0 Then - Dim ObjCuentasBancos As New ClsGenerales - - If ObjCuentasBancos.GetCuentasDepositos() Then - GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados - End If - ObjCuentasBancos.Dispose() - End If End Sub Private Sub CargaPSGridCuentasBancos() diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 6d4a4732f..660e1a514 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1472,19 +1472,6 @@ Partial Class Bancos_ProveedoresAbonar End Sub #End Region - - 'ESTO NO DEBERIA ESTAR AQUI - Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) - If CveProveedor > 0 Then - Dim ObjCuentasBancos As New ClsGenerales - - If ObjCuentasBancos.GetCuentasDepositos() Then - GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados - End If - ObjCuentasBancos.Dispose() - End If - End Sub - Protected Sub DdllOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged If DdlOtrosPagos.SelectedValue <> "-1" Then @@ -2047,17 +2034,15 @@ Partial Class Bancos_ProveedoresAbonar Dim Transferencia = "", Banco = "", CLABE = "", Cuenta = "", Correo = "" If DdlTipoTransaccion.SelectedValue.Contiene("2", "8") Then Transferencia = "Si" Else Transferencia = "No" If DdlCuentaDeposito.SelectedValue.ToEntero > 0 Then - Dim ObjGral As New ClsGenerales - If ObjGral.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero) Then - If ObjGral.DtResultados.Rows.Count > 0 Then - Banco = ObjGral.DtResultados.Rows(0)("BancoNombre").ToString - CLABE = ObjGral.DtResultados.Rows(0)("CLABE").ToString - Cuenta = ObjGral.DtResultados.Rows(0)("Cuenta").ToString - Correo = ObjGral.DtResultados.Rows(0)("Correo").ToString - End If + Dim dtt As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero) + If dtt.Rows.Count > 0 Then + Banco = dtt.Rows(0)("BancoNombre").ToString + CLABE = dtt.Rows(0)("CLABE").ToString + Cuenta = dtt.Rows(0)("Cuenta").ToString + Correo = dtt.Rows(0)("Correo").ToString End If - ObjGral.Dispose() End If + params.Add(New ReportParameter("Transferencia", Transferencia)) params.Add(New ReportParameter("Banco", Banco)) params.Add(New ReportParameter("CLABE", CLABE)) diff --git a/Bancos/ProveedoresCreditos.aspx.vb b/Bancos/ProveedoresCreditos.aspx.vb index dd61ce7dc..a624d3129 100644 --- a/Bancos/ProveedoresCreditos.aspx.vb +++ b/Bancos/ProveedoresCreditos.aspx.vb @@ -690,11 +690,7 @@ Partial Class Bancos_ProveedoresCreditos LblPagueseA.Text = "Beneficiario" End Select - - 'RecargaCuentas CargaCuenta() - RecargaCuentasDepositos() - UpDatos.Update() End Sub @@ -1369,7 +1365,6 @@ Partial Class Bancos_ProveedoresCreditos Alert(Msg.ToString, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)) End If - RecargaGlobalCuentasBancarias() ObjIE.Dispose() ObjMov.Dispose() ObjComp.Dispose() @@ -1555,7 +1550,6 @@ Partial Class Bancos_ProveedoresCreditos trCuentaDeposito.Visible = False DdlCuentaDeposito.Items.Clear() End If - RecargaGlobalCuentasBancarias() UpCuentaDeposito.Update() UpDatos.Update() End Sub @@ -1573,18 +1567,6 @@ Partial Class Bancos_ProveedoresCreditos End If End Sub - - 'Recaga CuentasBancarias de Proveedor - Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) - If CveProveedor > 0 Then - Dim ObjCuentasBancos As New ClsGenerales - - If ObjCuentasBancos.GetCuentasDepositos() Then - GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados - End If - ObjCuentasBancos.Dispose() - End If - End Sub Protected Sub DdlCuentaDeposito_SelectedIndexChanged(sender As Object, e As EventArgs) Dim Dep As New ClsGenerales If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero) AndAlso Dep.DtResultados.Rows.Count = 1 Then diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index ebc6772bf..fe3667f6a 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -3560,22 +3560,19 @@ Partial Class Compras_Proveedores Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion) End If - If ObjCuentasBancos.GetCuentasDepositos Then - GlobalDTProveedoresCuentas(CveProveedor, True) = ObjCuentasBancos.DtResultados - End If - CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString) ObjCuentasBancos.Dispose() RecargaGlobalCuentasBancarias() End Sub Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) If CveProveedor > 0 Then - Dim ObjCuentasBancos As New ClsGenerales + GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing + 'Dim ObjCuentasBancos As New ClsGenerales - If ObjCuentasBancos.GetCuentasDepositos() Then - GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados - End If - ObjCuentasBancos.Dispose() + 'If ObjCuentasBancos.GetCuentasDepositos() Then + ' GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1, True) = ObjCuentasBancos.DtResultados + 'End If + 'ObjCuentasBancos.Dispose() End If End Sub diff --git a/Global.asax b/Global.asax index 7e6a2e2a2..c9642f892 100644 --- a/Global.asax +++ b/Global.asax @@ -128,42 +128,11 @@ End Using GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'G E N E R A L E S - - 'Using ObjGenerales As New ClsGenerales - ' 'If ObjGenerales.GetGralPaises Then Application("GlobalDTGralPaises") = ObjGenerales.DtResultados Else Application("GlobalDTGralPaises") = Nothing - ' 'If ObjGenerales.GetGralEstados Then Application("GlobalDTGralEstados") = ObjGenerales.DtResultados Else Application("GlobalDTGralEstados") = Nothing - ' 'If ObjGenerales.GetGralMunicipios Then Application("GlobalDTGralMunicipios") = ObjGenerales.DtResultados Else Application("GlobalDTGralMunicipios") = Nothing - ' 'If ObjGenerales.GetGralPoblaciones Then Application("GlobalDTGralPoblaciones") = ObjGenerales.DtResultados Else Application("GlobalDTGralPoblaciones") = Nothing - ' 'If ObjGenerales.GetEscolaridades Then Application("GlobalDTGralEscolaridades") = ObjGenerales.DtResultados Else Application("GlobalDTGralEscolaridades") = Nothing - ' 'If ObjGenerales.GetCategorias Then Application("GlobalDTGralCategorias") = ObjGenerales.DtResultados Else Application("GlobalDTGralCategorias") = Nothing - ' 'If ObjGenerales.GetCategorias(-1, 2) Then Application("GlobalDTFamilias") = ObjGenerales.DtResultados Else Application("GlobalDTFamilias") = Nothing - ' 'If ObjGenerales.GetCategorias(-1, 3) Then Application("GlobalDTCategoriasPresupuestos") = ObjGenerales.DtResultados Else Application("GlobalDTCategoriasPresupuestos") = Nothing - ' 'If ObjGenerales.GetCategorias(-1, 4) Then Application("GlobalDTCategorias2") = ObjGenerales.DtResultados Else Application("GlobalDTCategorias2") = Nothing - ' 'If ObjGenerales.GetColectivas(-1, "-1", "-1", "-1", -1) Then Application("GlobalDTGralColectivas") = ObjGenerales.DtResultados Else Application("GlobalDTGralColectivas") = Nothing - ' 'If ObjGenerales.GetGralPaqueterias Then Application("GlobalDTPaqueterias") = ObjGenerales.DtResultados Else Application("GlobalDTPaqueterias") = Nothing - ' 'If ObjGenerales.GetGralPaqueteriasGuiasTipo Then Application("GlobalDTPaqueteriaGuiaTipos") = ObjGenerales.DtResultados Else Application("GlobalDTPaqueteriaGuiaTipos") = Nothing - ' 'If ObjGenerales.GetClasificacionPorcentaje(-1, -1, -1, -1, 1) Then Application("GlobalDTClasificacionPorcentaje") = ObjGenerales.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing - 'End Using '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C L A S I F I C A C I O N E S Using ObjClasificaciones As New ClsClasificaciones() - If ObjClasificaciones.GetClasificaciones() Then - Application("GlobalDTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("Codigo is null OR Codigo = '' ") - Application("GlobalDTACClasificadorObjetoGasto") = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") - Else - Application("GlobalDTClasificaciones") = Nothing - Application("GlobalDTACClasificadorObjetoGasto") = Nothing - End If - - If ObjClasificaciones.GetDTClasificacionesSubProyectos() Then - Application("GlobalDTClasificacionesSubProyecto") = ObjClasificaciones.DtResultados - Else - Application("GlobalDTClasificacionesSubProyecto") = Nothing - End If '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'F A M I L I A S @@ -179,55 +148,6 @@ End Using GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) - - 'Using ObjVenta As New ClsVentas - ' If ObjVenta.GetClasificacionDetalle(-1, CveClasificacion:=-1) Then - ' Application("GlobalDTClasificacionesDetalle") = ObjVenta.DtResultados - ' End If - 'End Using - 'GuardaLogAsax(String.Format("Globalasax 21:{0}", DateTime.Now)) - - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'T I P O S - D E - E V E N T O S - Using ObjTiposEventos As New ClsTiposEventos - If ObjTiposEventos.GetTiposEventos() Then Application("GlobalDTTiposEventos") = ObjTiposEventos.DtResultados Else Application("GlobalDTTiposEventos") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 27:{0}", DateTime.Now)) - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'P R O V E E D O R E S C U E N T A S - Using ObjProveedoresBancos As New ClsGenerales - If ObjProveedoresBancos.GetCuentasDepositos() Then Application("GlobalDTProveedoresCuentas") = ObjProveedoresBancos.DtResultados Else Application("GlobalDTProveedoresCuentas") = Nothing - End Using - - GuardaLogAsax(String.Format("Globalasax 30:{0}", DateTime.Now)) - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'V E N D E D O R E S - - Using ObjVendedores As New ClsVtaVendedores - If ObjVendedores.GetVendedores(-1) Then Application("GlobalDTVendedores") = ObjVendedores.DtResultados Else Application("GlobalDTVendedores") = Nothing - End Using - - GuardaLogAsax(String.Format("Globalasax 31:{0}", DateTime.Now)) - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C O R P O R A T I V O - - Using ObjCorporativo As New ClsClientes - If ObjCorporativo.GetCorporativo(-1, -1) Then Application("GlobalDTClientesCorporativo") = ObjCorporativo.DtResultados Else Application("GlobalDTClientesCorporativo") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 32:{0}", DateTime.Now)) - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'E S T A T U S - F A C T U R A - - Using ObjEstatusFacturaCompra As New ClsCompEstatusFactura - If ObjEstatusFacturaCompra.GetEstatusFactura Then Application("GlobalDTCompEstatusFactura") = ObjEstatusFacturaCompra.DtResultados Else Application("GlobalDTCompEstatusFactura") = Nothing - End Using - - GuardaLogAsax(String.Format("Globalasax 33:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -239,23 +159,6 @@ GuardaLogAsax(String.Format("Globalasax 35:{0}", DateTime.Now)) - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'R O L E S - - Using ObjRoles As New ClsSisRoles - If ObjRoles.GetRoles(-1, -1) Then Application("GlobalDTRoles") = ObjRoles.DtResultados Else Application("GlobalDTRoles") = Nothing - End Using - - GuardaLogAsax(String.Format("Globalasax 37:{0}", DateTime.Now)) - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'M O D U L O S - - Using ObjModulos As New ClsModulos - If ObjModulos.GetModulos(-1, -1, "-1", "-1") Then Application("GlobalDTModulos") = ObjModulos.DtResultados Else Application("GlobalDTModulos") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 38:{0}", DateTime.Now)) - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C O M B U S T I B L E S diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index 952ef0ac1..84d0393f9 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -136,7 +136,7 @@ Partial Class Inicio Dim Codigo As String = Decripta(Request("ADCod")) Dim Msg As String = "" If Codigo.Substring(0, 10) = "CveModulo=" Then - Msg = "No tiene permisos de acceso al módulo:" & GlobalDTModulos().FiltroPrimeroValor("Modulo", Codigo) + Msg = "No tiene permisos de acceso al módulo: " & GlobalDTModulos(Codigo.Substring(10).ToEntero).FiltroPrimeroValor("Modulo") End If Alert(Msg, TipoMensaje.MsgAdvertencia) End If diff --git a/OI/Desarrollo.aspx.vb b/OI/Desarrollo.aspx.vb index 690530de1..2fdfd72b8 100644 --- a/OI/Desarrollo.aspx.vb +++ b/OI/Desarrollo.aspx.vb @@ -349,7 +349,7 @@ Partial Class OI_Desarrollo DdlUsuarioPruebas.DataBind() DdlUsuarioPruebas.Items.Insert(0, New ListItem("Selecione uno", "-1")) - DdlModulo.DataSource = GlobalDTModulos() + DdlModulo.DataSource = GlobalDTModulos(-1) DdlModulo.DataBind() DdlModulo.Items.Insert(0, New ListItem("Selecione uno", "-1")) diff --git a/OI/RepDesarrollo.aspx.vb b/OI/RepDesarrollo.aspx.vb index be24b4912..ed19e11a3 100644 --- a/OI/RepDesarrollo.aspx.vb +++ b/OI/RepDesarrollo.aspx.vb @@ -27,7 +27,7 @@ Partial Class OI_RepDesarrollo 'DdlResponsable.DataBind() 'DdlResponsable.Items.Insert(0, New ListItem("Todos", "-1")) - DdlModulo.DataSource = GlobalDTModulos() + DdlModulo.DataSource = GlobalDTModulos(-1) DdlModulo.DataBind() DdlModulo.Items.Insert(0, New ListItem("Todos", "-1")) diff --git a/OI/SoporteADS.aspx.vb b/OI/SoporteADS.aspx.vb index 13e589cda..ac36935d4 100644 --- a/OI/SoporteADS.aspx.vb +++ b/OI/SoporteADS.aspx.vb @@ -2178,7 +2178,7 @@ Partial Class OI_SoporteADS - DdlModulo.DataSource = GlobalDTModulos + DdlModulo.DataSource = GlobalDTModulos(-1) DdlModulo.DataBind() DdlModulo.Items.Insert(0, New ListItem("Seleccione uno", "-1")) diff --git a/Sistemas/EmpresasModulos.aspx.vb b/Sistemas/EmpresasModulos.aspx.vb index 9124e8729..a59b6a77a 100644 --- a/Sistemas/EmpresasModulos.aspx.vb +++ b/Sistemas/EmpresasModulos.aspx.vb @@ -70,7 +70,7 @@ Partial Class Sistemas_EmpresasModulos End Sub Private Sub CargaModulosDisponible() - Dim DtModulosDisponible = GlobalDTModulos.FiltraParametros("Liga <> ''") + Dim DtModulosDisponible = GlobalDTModulos().FiltraParametros("Liga <> ''") Dim rowsToDelete = From r1 In DtModulosDisponible.AsEnumerable() Join r2 In DtModulosEmpresa.AsEnumerable() On r1.Field(Of Integer)("CveModulo") Equals r2.Field(Of Integer)("CveModulo") diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 00a59e542..1d0794060 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -6737,12 +6737,8 @@ Partial Class Clientes Dim index = GvRow.RowIndex TempDTCuentasBancos.Rows.RemoveAt(index) Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion) - End If - - 'If ObjCuentasBancos.GetCuentasDepositos Then - ' GlobalDTProveedoresCuentas(CveCliente, True) = ObjCuentasBancos.DtResultados - 'End If - + End If + CargaPSGridCuentasBancos() ObjCuentasBancos.Dispose() RecargaGlobalCuentasBancarias() diff --git a/ZDG/MensajeAutomatico.aspx.vb b/ZDG/MensajeAutomatico.aspx.vb index c29f6d45e..5e0d5aae1 100644 --- a/ZDG/MensajeAutomatico.aspx.vb +++ b/ZDG/MensajeAutomatico.aspx.vb @@ -48,9 +48,8 @@ Partial Class ZDG_MensajeAutomatico Private Sub MandaMensajeAutomatico() - Dim pag As New ClsPaginas - pag.Alert("TODO FRENADO!!", TipoMensaje.MsgAdvertencia) - pag.Dispose() + Alert("TODO FRENADO!!", TipoMensaje.MsgAdvertencia) + Exit Sub