From b540722f2f02dbec6ab13170f70ed5715b02a528 Mon Sep 17 00:00:00 2001 From: MLopez Date: Thu, 23 Feb 2023 20:59:06 -0700 Subject: [PATCH] =?UTF-8?q?Mega=20limpieza=20masiva=20GlobalDTs=20+=20de?= =?UTF-8?q?=2030=20globalDTs=20se=20movi=C3=B3=20la=20carga=20a=20ClsPagin?= =?UTF-8?q?as=20+=20se=20segmentaron=20todos=20los=20GlobalDTs=20que=20sie?= =?UTF-8?q?mpre=20hac=C3=ADan=20un=20DataView,=20a=20segmentar=20las=20tab?= =?UTF-8?q?las=20por=20empresa=20individual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CAMBIOS EN BD (YA EN VENTAS) + @CveEmpresa INT ... a la mayoría de PAs que fueron comentados en Global.asax (aprox 17) PA_Pros_ProspectosApoyosGet PA_Pros_ProspectosClasificacionGet PA_Pros_ProspectosApoyosTiposGet PA_Pros_ProspectosTiposGet PA_Pros_ProspectosSolicitudesGet PA_Pros_ProspectosSolicitudesEstatusGet PA_Pros_ProspectosSolicitudesTiposGet PA_Pros_EncuestasRespuestasGet PA_AC_FuentesRecaudacionGet PA_AC_UnidadesAdministrativasGet PA_AC_ClasificacionFuncionalGet PA_AC_ClasificacionGeograficaGet PA_AC_FuentesFinanciamientoGet PA_AC_ClasificacionAdministrativaGet PA_AC_ProgramaOperativoGet PA_AC_PD_EjeRectorGet PA_Flo_CombustiblesGet --- AC/CatClasificacionAdministrativa.aspx.vb | 10 +- AC/CatClasificacionFuncional.aspx.vb | 10 +- AC/CatClasificacionGeografica.aspx.vb | 10 +- AC/CatFuentesFinanciamiento.aspx.vb | 10 +- AC/CatFuentesRecaudacion.aspx.vb | 10 +- AC/CatUnidadesAdministrativas.aspx.vb | 10 +- App_Code/ClsAC.vb | 41 +- App_Code/ClsFlotillas.vb | 7 +- App_Code/ClsPaginas.vb | 779 ++++++++++-------- App_Code/ClsProspectos.vb | 35 +- Global.asax | 99 ++- .../CatClasificacionesCaracteristicas.aspx.vb | 21 +- 12 files changed, 563 insertions(+), 479 deletions(-) diff --git a/AC/CatClasificacionAdministrativa.aspx.vb b/AC/CatClasificacionAdministrativa.aspx.vb index d59b43943..2e7ad3f49 100644 --- a/AC/CatClasificacionAdministrativa.aspx.vb +++ b/AC/CatClasificacionAdministrativa.aspx.vb @@ -17,15 +17,7 @@ Partial Class AC_CatClasificacionAdministrativa End Sub Public Sub CargaDatos() - Dim ObjClasificacionAdministrativa As New ClsAC - If ObjClasificacionAdministrativa.GetClasificacionAdministrativa() Then - ViewState("DTClasificacionAdministrativas") = ObjClasificacionAdministrativa.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionAdministrativa(UsuarioActual.CveEmpresa) = ObjClasificacionAdministrativa.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionAdministrativa.Dispose() + ViewState("DTClasificacionAdministrativas") = GlobalDTAC_ClasificacionAdministrativa(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatClasificacionFuncional.aspx.vb b/AC/CatClasificacionFuncional.aspx.vb index 109a265fb..4261995b2 100644 --- a/AC/CatClasificacionFuncional.aspx.vb +++ b/AC/CatClasificacionFuncional.aspx.vb @@ -52,15 +52,7 @@ Partial Class AC_CatClasificacionFuncional End Sub Public Sub CargaDatos() - Dim ObjClasificacionFuncional As New ClsAC - If ObjClasificacionFuncional.GetClasificacionFuncional() Then - ViewState("DTClasificacionFuncional") = ObjClasificacionFuncional.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionFuncional(UsuarioActual.CveEmpresa) = ObjClasificacionFuncional.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionFuncional.Dispose() + ViewState("DTClasificacionFuncional") = GlobalDTAC_ClasificacionFuncional(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatClasificacionGeografica.aspx.vb b/AC/CatClasificacionGeografica.aspx.vb index 2b871ee67..f9a5434c9 100644 --- a/AC/CatClasificacionGeografica.aspx.vb +++ b/AC/CatClasificacionGeografica.aspx.vb @@ -56,15 +56,7 @@ Partial Class AC_CatClasificacionGeografica End Sub Public Sub CargaDatos() - Dim ObjClasificacionGeografica As New ClsAC - If ObjClasificacionGeografica.GetClasificacionGeografica() Then - ViewState("DTClasificacionGeografica") = ObjClasificacionGeografica.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionGeografica(UsuarioActual.CveEmpresa) = ObjClasificacionGeografica.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionGeografica.Dispose() + ViewState("DTClasificacionGeografica") = GlobalDTAC_ClasificacionGeografica(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatFuentesFinanciamiento.aspx.vb b/AC/CatFuentesFinanciamiento.aspx.vb index 89ad47690..c28547b0b 100644 --- a/AC/CatFuentesFinanciamiento.aspx.vb +++ b/AC/CatFuentesFinanciamiento.aspx.vb @@ -47,15 +47,7 @@ Partial Class AC_CatFuentesFinanciamiento End Sub Public Sub CargaDatos() - Dim ObjFuentesFinanciamiento As New ClsAC - If ObjFuentesFinanciamiento.GetFuentesFinanciamiento() Then - ViewState("DTFuentesFinanciamiento") = ObjFuentesFinanciamiento.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_FuentesFinanciamiento(-1) = ObjFuentesFinanciamiento.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjFuentesFinanciamiento.Dispose() + ViewState("DTFuentesFinanciamiento") = GlobalDTAC_FuentesFinanciamiento(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatFuentesRecaudacion.aspx.vb b/AC/CatFuentesRecaudacion.aspx.vb index 349f696f1..41d7a1105 100644 --- a/AC/CatFuentesRecaudacion.aspx.vb +++ b/AC/CatFuentesRecaudacion.aspx.vb @@ -48,15 +48,7 @@ Partial Class AC_CatFuentesRecaudacion End Sub Public Sub CargaDatos() - Dim ObjFuenteRecaudacion As New ClsAC - If ObjFuenteRecaudacion.GetFuentesRecaudacion() Then - ViewState("DTFuenteRecaudacion") = ObjFuenteRecaudacion.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa)) - GlobalDTAC_FuentesRecaudacion(-1) = ObjFuenteRecaudacion.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjFuenteRecaudacion.Dispose() + ViewState("DTFuenteRecaudacion") = GlobalDTAC_FuentesRecaudacion(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatUnidadesAdministrativas.aspx.vb b/AC/CatUnidadesAdministrativas.aspx.vb index 1ac5a94dc..ce7080619 100644 --- a/AC/CatUnidadesAdministrativas.aspx.vb +++ b/AC/CatUnidadesAdministrativas.aspx.vb @@ -26,15 +26,7 @@ Partial Class AC_CatUnidadesAdministrativas End Sub Public Sub CargaDatos() - Dim ObjUnidadAdministrativas As New ClsAC - If ObjUnidadAdministrativas.GetUnidadesAdministrativas() Then - ViewState("DTUnidadAdministrativas") = ObjUnidadAdministrativas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_UnidadesAdministrativas(-1) = ObjUnidadAdministrativas.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjUnidadAdministrativas.Dispose() + ViewState("DTUnidadAdministrativas") = GlobalDTAC_UnidadesAdministrativas(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/App_Code/ClsAC.vb b/App_Code/ClsAC.vb index 070c21364..7cfe17261 100644 --- a/App_Code/ClsAC.vb +++ b/App_Code/ClsAC.vb @@ -160,10 +160,12 @@ Public Class ClsAC Return Retorno End Function - Public Function GetProgramaOperativo() As Boolean + Public Function GetProgramaOperativo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ProgramaOperativoGet") - + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1033,9 +1035,12 @@ Public Class ClsAC #End Region #Region "AC_UnidadesAdministrativas" - Public Function GetUnidadesAdministrativas() As Boolean + Public Function GetUnidadesAdministrativas(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_UnidadesAdministrativasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1127,9 +1132,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionGeografica" - Public Function GetClasificacionGeografica() As Boolean + Public Function GetClasificacionGeografica(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionGeograficaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1761,9 +1769,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionFuncional" - Public Function GetClasificacionFuncional() As Boolean + Public Function GetClasificacionFuncional(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionFuncionalGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1852,9 +1863,12 @@ Public Class ClsAC #End Region #Region "AC_FuentesFinanciamiento" - Public Function GetFuentesFinanciamiento() As Boolean + Public Function GetFuentesFinanciamiento(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_FuentesFinanciamientoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2223,9 +2237,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionAdministrativa" - Public Function GetClasificacionAdministrativa() As Boolean + Public Function GetClasificacionAdministrativa(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionAdministrativaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2315,9 +2332,12 @@ Public Class ClsAC #End Region #Region "AC_PD_EjeRector" - Public Function GetPD_EjeRector() As Boolean + Public Function GetPD_EjeRector(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_PD_EjeRectorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2787,9 +2807,12 @@ Public Class ClsAC #End Region #Region "AC_FuentesRecaudacion" - Public Function GetFuentesRecaudacion() As Boolean + Public Function GetFuentesRecaudacion(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_FuentesRecaudacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsFlotillas.vb b/App_Code/ClsFlotillas.vb index 10ea41055..569737e73 100644 --- a/App_Code/ClsFlotillas.vb +++ b/App_Code/ClsFlotillas.vb @@ -142,11 +142,12 @@ Public Class ClsFlotillas #Region " C O M B U S T I B L E S " - Public Function GetCombustibles() As Boolean + Public Function GetCombustibles(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Flo_CombustiblesGet") - - + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 70773458b..e3e2a1b5b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -767,7 +767,7 @@ Public Class ClsPaginas Application("GlobalDTNomSatTipoIncapacidad") = value End Set End Property - 'Este GlobalDT no estoy seguro si se deba segmentar por empresa, se usa mucho en todos lados + 'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTEmpresas" @@ -852,7 +852,7 @@ Public Class ClsPaginas Dim AppNombre As String = $"GlobalDTClasificaciones-{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 + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If Dim filtros As New List(Of String) @@ -888,26 +888,26 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=4) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If If CveCategoria <> -1 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) GlobalDTClasificaciones2 = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificaciones2 = DirectCast(Application(AppNombre), DataTable) + GlobalDTClasificaciones2 = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTClasificacionesSubProyectos(Optional CveClasificacion As Integer = -1, Optional CveEmpresa As Integer = -1) As DataTable @@ -938,7 +938,7 @@ Public Class ClsPaginas 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 <> '' ") + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") ObjClasificaciones.Dispose() End If Dim filtros As New List(Of String) @@ -977,21 +977,25 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTSubFamilias(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTSubFamilias(CveEmpresa As Integer, 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("GlobalDTSubFamilias"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTSubFamilias-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=2) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + End Using + End If + If CveCategoria <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) GlobalDTSubFamilias = Dv.ToTable Dv.Dispose() Else - GlobalDTSubFamilias = DirectCast(Application("GlobalDTSubFamilias"), DataTable) + GlobalDTSubFamilias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTSubFamilias") = value + Dim AppNombre As String = $"GlobalDTSubFamilias-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable @@ -1046,18 +1050,19 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificacionesPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificacionesPresupuestos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificacionesPresupuestos"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClasificacionesPresupuestos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionesPresupuestos = DirectCast(Application("GlobalDTClasificacionesPresupuestos"), DataTable) + Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=3) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + End Using End If + GlobalDTClasificacionesPresupuestos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTClasificacionesPresupuestos") = value + Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTMetodosPago() As DataTable @@ -1475,48 +1480,48 @@ Public Class ClsPaginas Application("GlobalDTCaracteristicasOpciones") = value End Set End Property - Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquipos = DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquipos") = value - End Set - End Property - Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value - End Set - End Property - Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposOpciones = DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquiposOpciones") = value - End Set - End Property + 'Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquipos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquipos = DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquipos") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposOpciones = DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquiposOpciones") = value + ' End Set + 'End Property ''Property GlobalDTProductosServicios(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional Estatus As Integer = 1, ' Optional CvePS As Integer = -1, Optional AplicaParaVenta As Integer = -1, Optional CveTipoPS As Integer = -1, Optional SATClavePS As String = "-1") As DataTable ' Get @@ -1656,20 +1661,20 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicas") = value - End Set - End Property + 'Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProductosServiciosCaracteristicas = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTProductosServiciosCaracteristicas") = value + ' End Set + 'End Property Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}" @@ -1692,20 +1697,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value - End Set - End Property + 'Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value + ' End Set + 'End Property Property GlobalDTInvMetodosInventario() As DataTable Get Dim AppNombre As String = $"GlobalDTInvMetodosInventario" @@ -2426,42 +2431,58 @@ Public Class ClsPaginas End Property #End Region #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable + Public Shared Property GlobalDTProspectosCaracteristicasClasificaciones(CveEmpresa As Integer) As DataTable Get - GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(Application("GlobalDTProspectosCaracteristicasClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicasClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicasClasificaciones") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosTiposCaracteristicas() As DataTable + Public Shared Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable Get - GlobalDTProspectosTiposCaracteristicas = DirectCast(Application("GlobalDTProspectosTiposCaracteristicas"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosTiposCaracteristicas") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosCaracteristicasOpciones(CveEmpresa As Integer, CveCaracteristica As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosCaracteristicas = Dv.ToTable + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasOpciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicasOpciones(CveCaracteristica:=CveCaracteristica, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveCaracteristica <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCaracteristica = {CveCaracteristica}", "", DataViewRowState.CurrentRows) + GlobalDTProspectosCaracteristicasOpciones = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosCaracteristicas = DirectCast(Application("GlobalDTProspectosCaracteristicas"), DataTable) + GlobalDTProspectosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicas") = value - End Set - End Property - Property GlobalDTProspectosCaracteristicasOpciones() As DataTable - Get - GlobalDTProspectosCaracteristicasOpciones = DirectCast(Application("GlobalDTProspectosCaracteristicasOpciones"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicasOpciones") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasOpciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region @@ -2674,124 +2695,145 @@ Public Class ClsPaginas End Property #End Region #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSupervisores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSupervisores = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSupervisores = DirectCast(Application("GlobalDTProspectosSupervisores"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSupervisores-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSupervisores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSupervisores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSupervisores") = value + Dim AppNombre As String = $"GlobalDTProspectosSupervisores-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveSupervisor <> -1 Then Str.AppendFormat(" {0} CveSupervisor = {1}", If(Str.Length > 0, "AND", ""), CveSupervisor) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosCoordinadores"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosCoordinadores-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCoordinadores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveSupervisor <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveSupervisor = {CveSupervisor}", "", DataViewRowState.CurrentRows) GlobalDTProspectosCoordinadores = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosCoordinadores = DirectCast(Application("GlobalDTProspectosCoordinadores"), DataTable) + GlobalDTProspectosCoordinadores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosCoordinadores") = value + Dim AppNombre As String = $"GlobalDTProspectosCoordinadores-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyos = DirectCast(Application("GlobalDTProspectosApoyos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosApoyos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectoApoyo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosApoyos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosApoyos") = value + Dim AppNombre As String = $"GlobalDTProspectosApoyos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosClasificaciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosClasificaciones = DirectCast(Application("GlobalDTProspectosClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosClasificaciones") = value + Dim AppNombre As String = $"GlobalDTProspectosClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEventosTipo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosEventosTipo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEventosTipo = DirectCast(Application("GlobalDTProspectosEventosTipo"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEventosTipo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetEventosTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosEventosTipo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEventosTipo") = value + Dim AppNombre As String = $"GlobalDTProspectosEventosTipo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEventoTipo <> -1 Then Str.AppendFormat(" {0} CveEventoTipo = {1}", If(Str.Length > 0, "AND", ""), CveEventoTipo) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEvento"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEvento-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosEventos(CveEvento:=-1, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveEventoTipo <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEventoTipo = {CveEventoTipo}", "", DataViewRowState.CurrentRows) GlobalDTProspectosEvento = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEvento = DirectCast(Application("GlobalDTProspectosEvento"), DataTable) + GlobalDTProspectosEvento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEvento") = value + Dim AppNombre As String = $"GlobalDTProspectosEvento-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEstatus"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEstatus = DirectCast(Application("GlobalDTProspectosEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosEventos(CveEvento:=-1, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEstatus") = value + Dim AppNombre As String = $"GlobalDTProspectosEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosApoyosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyosTipos = DirectCast(Application("GlobalDTProspectosApoyosTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosApoyosTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetApoyoTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosApoyosTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosApoyosTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTProspectosApoyosTipos() As DataTable @@ -2802,138 +2844,175 @@ Public Class ClsPaginas Application("GlobalDTProspectosApoyosTipos") = value End Set End Property - Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosTiposCaracteristicas(CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEncuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEncuestas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEncuestas = DirectCast(Application("GlobalDTProspectosEncuestas"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosTiposCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetTiposCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosTiposCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestas") = value + Dim AppNombre As String = $"GlobalDTProspectosTiposCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta) - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEncuestasPreguntas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEncuestas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetEncuestas(CveEmpresa:=CveEmpresa, CveEncuesta:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosEncuestas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEncuestas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + Public Shared Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTProspectosEncuestasPreguntas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetPreguntas(CveEmpresa:=CveEmpresa, CveEncuesta:=-1, CveUsuario:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveEncuesta <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEncuesta = {CveEncuesta}", "", DataViewRowState.CurrentRows) GlobalDTProspectosEncuestasPreguntas = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEncuestasPreguntas = DirectCast(Application("GlobalDTProspectosEncuestasPreguntas"), DataTable) + GlobalDTProspectosEncuestasPreguntas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestasPreguntas") = value + Dim AppNombre As String = $"GlobalDTProspectosEncuestasPreguntas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta) - If CvePregunta <> -1 Then Str.AppendFormat(" {0} CvePregunta = {1}", If(Str.Length > 0, "AND", ""), CvePregunta) - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEncuestasRespuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEncuestasRespuestas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetRespuestas(CveEmpresa:=CveEmpresa, CvePregunta:=-1, CveEncuesta:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CvePregunta <> -1 Then filtros.Add($"CvePregunta = {CvePregunta}") + If CveEncuesta <> -1 Then filtros.Add($"CveEncuesta = {CveEncuesta}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTProspectosEncuestasRespuestas = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEncuestasRespuestas = DirectCast(Application("GlobalDTProspectosEncuestasRespuestas"), DataTable) + GlobalDTProspectosEncuestasRespuestas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestasRespuestas") = value + Dim AppNombre As String = $"GlobalDTProspectosEncuestasRespuestas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosTipos = DirectCast(Application("GlobalDTProspectosTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosTipos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #Region " DT PROSPECTOS SOLICITUDES" - Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer, Optional CveProspecto As Integer = -1, Optional CveApoyoTipo As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProspectoSolicitud As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudes"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudes-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosSolicitudes(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveProspecto <> -1 Then filtros.Add($"CveProspecto = {CveProspecto}") + If CveApoyoTipo <> -1 Then filtros.Add($"CveApoyoTipo = {CveApoyoTipo}") + If CveClasificacion <> -1 Then filtros.Add($"CveClasificacion = {CveClasificacion}") + If CveProspectoSolicitud <> -1 Then filtros.Add($"CveProspectoSolicitud = {CveProspectoSolicitud}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTProspectosSolicitudes = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosSolicitudes = DirectCast(Application("GlobalDTProspectosSolicitudes"), DataTable) + GlobalDTProspectosSolicitudes = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudes") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudes-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesEstatus = DirectCast(Application("GlobalDTProspectosSolicitudesEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSolicitudEstatus(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSolicitudesEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesEstatus") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesTipos = DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSolicitudTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - 'Property GlobalDTProspectosSolicitudesTipos() As DataTable + 'Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable ' Get - ' GlobalDTProspectosSolicitudesTipos = DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable) + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProspectosSolicitudesApoyos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProspectosSolicitudesApoyos = DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) + ' End If ' End Get ' Set(value As DataTable) - ' Application("GlobalDTProspectosSolicitudesTipos") = value + ' Application("GlobalDTProspectosSolicitudesApoyos") = value ' End Set 'End Property - Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesApoyos = DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesApoyos") = value - End Set - End Property #End Region #End Region #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" @@ -2946,19 +3025,20 @@ Public Class ClsPaginas Application("GlobalDTAC_RubrosIngreso") = value End Set End Property - Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_FuentesRecaudacion"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesRecaudacion = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesRecaudacion = DirectCast(Application("GlobalDTAC_FuentesRecaudacion"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_FuentesRecaudacion-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetFuentesRecaudacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_FuentesRecaudacion = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_FuentesRecaudacion") = value + Dim AppNombre As String = $"GlobalDTAC_FuentesRecaudacion-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_FuentesFinanciamiento() As DataTable @@ -3000,47 +3080,52 @@ Public Class ClsPaginas Application("GlobalDTAC_Ubicaciones") = value End Set End Property - Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_UnidadesAdministrativas"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_UnidadesAdministrativas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_UnidadesAdministrativas = DirectCast(Application("GlobalDTAC_UnidadesAdministrativas"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_UnidadesAdministrativas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetUnidadesAdministrativas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_UnidadesAdministrativas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_UnidadesAdministrativas") = value + Dim AppNombre As String = $"GlobalDTAC_UnidadesAdministrativas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionFuncional"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionFuncional = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionFuncional = DirectCast(Application("GlobalDTAC_ClasificacionFuncional"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionFuncional-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionFuncional(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionFuncional = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionFuncional") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionFuncional-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionGeografica"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionGeografica = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionGeografica = DirectCast(Application("GlobalDTAC_ClasificacionGeografica"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionGeografica-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionGeografica(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionGeografica = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionGeografica") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionGeografica-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_Cuentas() As DataTable @@ -3067,19 +3152,20 @@ Public Class ClsPaginas ' Application("GlobalDTAC_FuenteFinanciamiento") = value ' End Set 'End Property - Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_FuentesFinanciamiento"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesFinanciamiento = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesFinanciamiento = DirectCast(Application("GlobalDTAC_FuentesFinanciamiento"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_FuentesFinanciamiento-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetFuentesFinanciamiento(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_FuentesFinanciamiento") = value + Dim AppNombre As String = $"GlobalDTAC_FuentesFinanciamiento-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_FuentesFinanciamientoCONAC() As DataTable @@ -3138,18 +3224,20 @@ Public Class ClsPaginas Application("GlobalDTAC_SubProgramas") = value End Set End Property - Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionAdministrativa = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionAdministrativa = DirectCast(Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionAdministrativa-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionAdministrativa(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionAdministrativa = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionAdministrativa") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionAdministrativa-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_TipoGasto() As DataTable @@ -3160,18 +3248,20 @@ Public Class ClsPaginas Application("GlobalDTAC_TipoGasto") = value End Set End Property - Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ProgramaOperativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ProgramaOperativo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ProgramaOperativo = DirectCast(Application("GlobalDTAC_ProgramaOperativo"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ProgramaOperativo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetProgramaOperativo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ProgramaOperativo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ProgramaOperativo") = value + Dim AppNombre As String = $"GlobalDTAC_ProgramaOperativo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_MatrizIngresos() As DataTable @@ -3192,18 +3282,20 @@ Public Class ClsPaginas End Property #End Region - Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_PD_EjeRector"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_EjeRector = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_EjeRector = DirectCast(Application("GlobalDTAC_PD_EjeRector"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_PD_EjeRector-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetPD_EjeRector(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_PD_EjeRector = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_PD_EjeRector") = value + Dim AppNombre As String = $"GlobalDTAC_PD_EjeRector-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable @@ -3650,36 +3742,43 @@ Public Class ClsPaginas End Property #End Region #Region "*********** D T - C O M B U S T I B L E S ***********" - Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As New StringBuilder - StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTCombustibles"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCombustibles = Dv.ToTable - Dv.Dispose() - Else - GlobalDTCombustibles = DirectCast(Application("GlobalDTCombustibles"), DataTable) + Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjFlotillas As New ClsFlotillas + If ObjFlotillas.GetCombustibles(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjFlotillas.DtResultados + End Using End If + GlobalDTCombustibles = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTCombustibles") = value + Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTCombustiblesTipos(Optional CveCombustibleTipo As Integer = -1) As DataTable + Public Shared Property GlobalDTCombustiblesTipos(CveEmpresa As Integer, Optional CveCombustibleTipo As Integer = -1) As DataTable Get + Dim AppNombre As String = $"GlobalDTCombustiblesTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjFlotillas As New ClsFlotillas + If ObjFlotillas.GetCombustiblesTipos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjFlotillas.DtResultados + End Using + End If + Dim filtros As New List(Of String) If CveCombustibleTipo <> -1 Then - Dim StrSQL As New StringBuilder - If CveCombustibleTipo <> -1 Then StrSQL.AppendFormat("CveCombustibleTipo = {0}", CveCombustibleTipo) - Dim Dv As New DataView(DirectCast(Application("GlobalDTCombustiblesTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCombustibleTipo = {CveCombustibleTipo}", "", DataViewRowState.CurrentRows) GlobalDTCombustiblesTipos = Dv.ToTable Dv.Dispose() Else - GlobalDTCombustiblesTipos = DirectCast(Application("GlobalDTCombustiblesTipos"), DataTable) + GlobalDTCombustiblesTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get - Set(ByVal value As DataTable) - Application("GlobalDTCombustiblesTipos") = value + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTCombustiblesTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region diff --git a/App_Code/ClsProspectos.vb b/App_Code/ClsProspectos.vb index 2866b3324..47fe6ac76 100644 --- a/App_Code/ClsProspectos.vb +++ b/App_Code/ClsProspectos.vb @@ -1409,9 +1409,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - C L A S I F I C A C I O N" - Public Function GetClasificacion() As Boolean + Public Function GetClasificacion(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosClasificacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1674,9 +1677,12 @@ Public Class ClsProspectos #Region "P R O S P E C T O S - T I P O S" - Public Function GetProspectosTipos() As Boolean + Public Function GetProspectosTipos(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1957,9 +1963,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - A P O Y O S " - Public Function GetProspectoApoyo() As Boolean + Public Function GetProspectoApoyo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosApoyosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2265,7 +2274,7 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S " - Public Function GetProspectosSolicitudes(CveProspecto As Integer, CveApoyoTipo As Integer, CveClasificacion As Integer, CveProspectoSolicitud As Integer, CveEmpresa As Integer) As Boolean + Public Function GetProspectosSolicitudes(CveEmpresa As Integer, Optional CveProspecto As Integer = -1, Optional CveApoyoTipo As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProspectoSolicitud As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesGet") With SqlAdapter.SelectCommand.Parameters @@ -2586,9 +2595,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - A P O Y O S - T I P O S " - Public Function GetApoyoTipo() As Boolean + Public Function GetApoyoTipo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosApoyosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2679,9 +2691,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - E S T A T U S " - Public Function GetSolicitudEstatus() As Boolean + Public Function GetSolicitudEstatus(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesEstatusGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2772,9 +2787,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - T I P O S " - Public Function GetSolicitudTipo() As Boolean + Public Function GetSolicitudTipo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -4235,12 +4253,13 @@ Public Class ClsProspectos #End Region #Region "E N C U E S T A S - R E S P U E S T A S" - Public Function GetRespuestas(CvePregunta As Integer, CveEncuesta As Integer) As Boolean + Public Function GetRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_EncuestasRespuestasGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveEncuesta", SqlDbType.Int).Value = CveEncuesta .Add("@CvePregunta", SqlDbType.Int).Value = CvePregunta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/Global.asax b/Global.asax index c9642f892..3362f8931 100644 --- a/Global.asax +++ b/Global.asax @@ -42,23 +42,22 @@ GuardaLogAsax(String.Format("Globalasax 5:{0}", DateTime.Now)) Using ObjAC As New ClsAC - If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing - If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + 'If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing + 'If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing + 'If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing - If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing - If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing - If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing + 'If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing + 'If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing + 'If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing - If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + 'If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing - If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing + 'If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing ' If ObjAC.GetAreas() Then Application("GlobalDTAC_Areas") = ObjAC.DtResultados Else Application("GlobalDTAC_Areas") = Nothing @@ -103,50 +102,50 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'P R O S P E C T O S - GuardaLogAsax(String.Format("Globalasax 10:{0}", DateTime.Now)) - Using ObjProspectos As New ClsProspectos - If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing - If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificacionesCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificacionesCaracteristicas") = Nothing - If ObjProspectos.GetCoordinadores(-1) Then Application("GlobalDTProspectosCoordinadores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCoordinadores") = Nothing - If ObjProspectos.GetSupervisores(-1) Then Application("GlobalDTProspectosSupervisores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSupervisores") = Nothing - If ObjProspectos.GetProspectosSolicitudes(-1, -1, -1, -1, -1) Then Application("GlobalDTProspectosSolicitudes") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudes") = Nothing - If ObjProspectos.GetSolicitudTipo Then Application("GlobalDTProspectosSolicitudesTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesTipos") = Nothing - If ObjProspectos.GetApoyoTipo Then Application("GlobalDTProspectosApoyosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyosTipos") = Nothing - If ObjProspectos.GetProspectoApoyo Then Application("GlobalDTProspectosApoyos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyos") = Nothing - If ObjProspectos.GetSolicitudEstatus Then Application("GlobalDTProspectosSolicitudesEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesEstatus") = Nothing - If ObjProspectos.GetEventosTipo(-1) Then Application("GlobalDTProspectosEventosTipo") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEventosTipo") = Nothing - If ObjProspectos.GetProspectosEventos(-1, -1) Then Application("GlobalDTProspectosEvento") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEvento") = Nothing - If ObjProspectos.GetProspectosTipos() Then Application("GlobalDTProspectosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTipos") = Nothing - If ObjProspectos.GetProspectosEstatus() Then Application("GlobalDTProspectosEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEstatus") = Nothing - If ObjProspectos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTProspectosCaracteristicasClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasClasificaciones") = Nothing - If ObjProspectos.GetTiposCaracteristicas(-1) Then Application("GlobalDTProspectosTiposCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTiposCaracteristicas") = Nothing - If ObjProspectos.GetCaracteristicas(-1) Then Application("GlobalDTProspectosCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicas") = Nothing - If ObjProspectos.GetCaracteristicasOpciones(-1, -1) Then Application("GlobalDTProspectosCaracteristicasOpciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasOpciones") = Nothing - If ObjProspectos.GetEncuestas(-1, -1) Then Application("GlobalDTProspectosEncuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestas") = Nothing - If ObjProspectos.GetPreguntas(-1, -1, -1) Then Application("GlobalDTProspectosEncuestasPreguntas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasPreguntas") = Nothing - If ObjProspectos.GetRespuestas(-1, -1) Then Application("GlobalDTProspectosEncuestasRespuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasRespuestas") = Nothing - End Using + 'GuardaLogAsax(String.Format("Globalasax 10:{0}", DateTime.Now)) + 'Using ObjProspectos As New ClsProspectos + 'If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing + 'If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificacionesCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificacionesCaracteristicas") = Nothing + 'If ObjProspectos.GetCoordinadores(-1) Then Application("GlobalDTProspectosCoordinadores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCoordinadores") = Nothing + 'If ObjProspectos.GetSupervisores(-1) Then Application("GlobalDTProspectosSupervisores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSupervisores") = Nothing + 'If ObjProspectos.GetProspectosSolicitudes(-1, -1, -1, -1, -1) Then Application("GlobalDTProspectosSolicitudes") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudes") = Nothing + 'If ObjProspectos.GetSolicitudTipo Then Application("GlobalDTProspectosSolicitudesTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesTipos") = Nothing + 'If ObjProspectos.GetApoyoTipo Then Application("GlobalDTProspectosApoyosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyosTipos") = Nothing + 'If ObjProspectos.GetProspectoApoyo Then Application("GlobalDTProspectosApoyos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyos") = Nothing + 'If ObjProspectos.GetSolicitudEstatus Then Application("GlobalDTProspectosSolicitudesEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesEstatus") = Nothing + 'If ObjProspectos.GetEventosTipo(-1) Then Application("GlobalDTProspectosEventosTipo") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEventosTipo") = Nothing + 'If ObjProspectos.GetProspectosEventos(-1, -1) Then Application("GlobalDTProspectosEvento") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEvento") = Nothing + 'If ObjProspectos.GetProspectosTipos() Then Application("GlobalDTProspectosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTipos") = Nothing + 'If ObjProspectos.GetProspectosEstatus() Then Application("GlobalDTProspectosEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEstatus") = Nothing + 'If ObjProspectos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTProspectosCaracteristicasClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasClasificaciones") = Nothing + 'If ObjProspectos.GetTiposCaracteristicas(-1) Then Application("GlobalDTProspectosTiposCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTiposCaracteristicas") = Nothing + 'If ObjProspectos.GetCaracteristicas(-1) Then Application("GlobalDTProspectosCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicas") = Nothing + 'If ObjProspectos.GetCaracteristicasOpciones(-1, -1) Then Application("GlobalDTProspectosCaracteristicasOpciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasOpciones") = Nothing + 'If ObjProspectos.GetEncuestas(-1, -1) Then Application("GlobalDTProspectosEncuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestas") = Nothing + 'If ObjProspectos.GetPreguntas(-1, -1, -1) Then Application("GlobalDTProspectosEncuestasPreguntas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasPreguntas") = Nothing + 'If ObjProspectos.GetRespuestas(-1, -1) Then Application("GlobalDTProspectosEncuestasRespuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasRespuestas") = Nothing + 'End Using - GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) + 'GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C L A S I F I C A C I O N E S - Using ObjClasificaciones As New ClsClasificaciones() + 'Using ObjClasificaciones As New ClsClasificaciones() - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'F A M I L I A S - If ObjClasificaciones.GetClasificaciones(Tipo:=2) Then Application("GlobalDTSubFamilias") = ObjClasificaciones.DtResultados Else Application("GlobalDTSubFamilias") = Nothing + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'F A M I L I A S + 'If ObjClasificaciones.GetClasificaciones(Tipo:=2) Then Application("GlobalDTSubFamilias") = ObjClasificaciones.DtResultados Else Application("GlobalDTSubFamilias") = Nothing - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'P R E S U P U E S T O - If ObjClasificaciones.GetClasificaciones(Tipo:=3) Then Application("GlobalDTClasificacionesPresupuestos") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificacionesPresupuestos") = Nothing + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'P R E S U P U E S T O + 'If ObjClasificaciones.GetClasificaciones(Tipo:=3) Then Application("GlobalDTClasificacionesPresupuestos") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificacionesPresupuestos") = Nothing - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C L A S I F I C A C I O N E S 2 - If ObjClasificaciones.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificaciones2") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'C L A S I F I C A C I O N E S 2 + 'If ObjClasificaciones.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificaciones2") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- @@ -162,11 +161,11 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C O M B U S T I B L E S - Using ObjFlotillas As New ClsFlotillas - If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing - If ObjFlotillas.GetCombustiblesTipos(-1) Then Application("GlobalDTCombustiblesTipos") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustiblesTipos") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 39:{0}", DateTime.Now)) + 'Using ObjFlotillas As New ClsFlotillas + 'If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing + 'If ObjFlotillas.GetCombustiblesTipos(-1) Then Application("GlobalDTCombustiblesTipos") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustiblesTipos") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 39:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/Prospectos/CatClasificacionesCaracteristicas.aspx.vb b/Prospectos/CatClasificacionesCaracteristicas.aspx.vb index 926596cdd..a6d181150 100644 --- a/Prospectos/CatClasificacionesCaracteristicas.aspx.vb +++ b/Prospectos/CatClasificacionesCaracteristicas.aspx.vb @@ -396,20 +396,11 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas End If End Sub Public Sub CargaDatosO() - Dim ObjCaracteristicasOpciones As New ClsProspectos - If ObjCaracteristicasOpciones.GetCaracteristicasOpciones(-1, UsuarioActual.CveEmpresa) Then - ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - If CType(ViewState("DTCaracteristicasOpciones"), DataTable).Columns.Count = 0 Then - ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - End If - - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados - Else - GvDatosOpciones.DataSource = Nothing + ViewState("DTCaracteristicasOpciones") = GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) + If CType(ViewState("DTCaracteristicasOpciones"), DataTable).Columns.Count = 0 Then + ViewState("DTCaracteristicasOpciones") = GlobalDTProspectosCaracteristicasOpciones(-1, -1) End If - ObjCaracteristicasOpciones.Dispose() - If ViewState("OrdenO").ToString() <> String.Empty Then CargaGridO(ViewState("OrdenO").ToString()) Else @@ -439,7 +430,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas TxtOpcion.Text = "" Alert("La nueva Opción para Característica se guardó correctamente.", TipoMensaje.MsgInformacion) ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados + GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) = ObjCaracteristicasOpciones.DtResultados CambioCaracteristicasOpciones() End If @@ -615,7 +606,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjCaracteristicasOpciones.RemoveCaracteristicasOpciones(GvDatosOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatosOpciones.EditIndex = -1 ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados + GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) = ObjCaracteristicasOpciones.DtResultados Alert("La Opción para Característica se eliminó correctamente.", TipoMensaje.MsgInformacion) CambioCaracteristicasOpciones() @@ -732,7 +723,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjCaracteristicasOpciones.UpdateCaracteristicasOpciones(CaracteristicaOpcion, CveCaracteristica, Estatus, CveCaracteristicaOpcion) Then GvDatosOpciones.EditIndex = -1 ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados + GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) = ObjCaracteristicasOpciones.DtResultados Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) CambioCaracteristicasOpciones()