Mejora GlobalDT: Quitar DataViews redundantes
This commit is contained in:
@@ -219,14 +219,11 @@ Public Class ClsPaginas
|
|||||||
Dim AppNombre As String = $"GlobalDTTiposGastos-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTTiposGastos-{CveEmpresa}"
|
||||||
If Application(AppNombre) Is Nothing Then
|
If Application(AppNombre) Is Nothing Then
|
||||||
Dim ObjCompra As New ClsCompras()
|
Dim ObjCompra As New ClsCompras()
|
||||||
If ObjCompra.GetTipoGasto(-1, -1) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing
|
If ObjCompra.GetTipoGasto(-1, CveEmpresa) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing
|
||||||
ObjCompra.Dispose()
|
ObjCompra.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
If Estatus <> -1 Then
|
||||||
Dim StrSQL As New StringBuilder
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveEstatus = {Estatus}", "", DataViewRowState.CurrentRows)
|
||||||
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
|
||||||
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", Estatus)
|
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTTiposGastos = Dv.ToTable
|
GlobalDTTiposGastos = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -615,13 +612,7 @@ Public Class ClsPaginas
|
|||||||
If P.GetProveedorClasificacion(CveEmpresa) Then Application(AppNombre) = P.DtResultados
|
If P.GetProveedorClasificacion(CveEmpresa) Then Application(AppNombre) = P.DtResultados
|
||||||
P.Dispose()
|
P.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
GlobalDTProveedorClasificacion = DirectCast(Application(AppNombre), DataTable)
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa ={0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTProveedorClasificacion = Dv.ToTable
|
|
||||||
Dv.Dispose()
|
|
||||||
Else
|
|
||||||
GlobalDTProveedorClasificacion = DirectCast(Application(AppNombre), DataTable)
|
|
||||||
End If
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Dim AppNombre As String = $"GlobalDTProveedorClasificacion-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTProveedorClasificacion-{CveEmpresa}"
|
||||||
@@ -736,6 +727,7 @@ Public Class ClsPaginas
|
|||||||
Application("GlobalDTNomSatTipoIncapacidad") = value
|
Application("GlobalDTNomSatTipoIncapacidad") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
'Este GlobalDT no estoy seguro si se deba segmentar por empresa, se usa mucho en todos lados
|
||||||
Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable
|
Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable
|
||||||
Get
|
Get
|
||||||
Dim AppNombre As String = "GlobalDTEmpresas"
|
Dim AppNombre As String = "GlobalDTEmpresas"
|
||||||
@@ -754,7 +746,7 @@ Public Class ClsPaginas
|
|||||||
End Using
|
End Using
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
If CveEmpresa <> -1 Then
|
||||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEmpresa = {CveEmpresa}", "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTEmpresas = Dv.ToTable
|
GlobalDTEmpresas = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -823,13 +815,12 @@ Public Class ClsPaginas
|
|||||||
If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados
|
If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados
|
||||||
ObjClasificaciones.Dispose()
|
ObjClasificaciones.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
Dim filtros As New List(Of String)
|
||||||
Dim Str As New StringBuilder
|
If CveCategoria <> -1 Then filtros.Add($"CveCategoria = {CveCategoria}")
|
||||||
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
If UsoClasificacion <> -1 Then filtros.Add($"UsoClasificacion = {UsoClasificacion}")
|
||||||
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
|
If CveClasificacion <> -1 Then filtros.Add($"CveClasificacion = {CveClasificacion}")
|
||||||
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
|
If filtros.Count > 0 Then
|
||||||
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
||||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTClasificaciones = Dv.ToTable
|
GlobalDTClasificaciones = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -850,16 +841,7 @@ Public Class ClsPaginas
|
|||||||
If ObjRH.GetActividades(CveEmpresa) Then Application(AppNombre) = ObjRH.DtResultados
|
If ObjRH.GetActividades(CveEmpresa) Then Application(AppNombre) = ObjRH.DtResultados
|
||||||
ObjRH.Dispose()
|
ObjRH.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
GlobalDTRHActividades = DirectCast(Application(AppNombre), DataTable)
|
||||||
Dim Str As New StringBuilder
|
|
||||||
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTRHActividades = Dv.ToTable
|
|
||||||
Dv.Dispose()
|
|
||||||
Else
|
|
||||||
GlobalDTRHActividades = DirectCast(Application(AppNombre), DataTable)
|
|
||||||
End If
|
|
||||||
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Dim AppNombre As String = $"GlobalDTRHActividades-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTRHActividades-{CveEmpresa}"
|
||||||
@@ -875,11 +857,8 @@ Public Class ClsPaginas
|
|||||||
If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados
|
If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados
|
||||||
ObjClasificaciones.Dispose()
|
ObjClasificaciones.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
If CveCategoria <> -1 Then
|
||||||
Dim Str As New StringBuilder
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows)
|
||||||
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
|
||||||
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
|
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTClasificaciones2 = Dv.ToTable
|
GlobalDTClasificaciones2 = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -1118,13 +1097,7 @@ Public Class ClsPaginas
|
|||||||
If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados
|
If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados
|
||||||
ObjUnidadesMedida.Dispose()
|
ObjUnidadesMedida.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
|
||||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTUnidadesMedida = Dv.ToTable
|
|
||||||
Dv.Dispose()
|
|
||||||
Else
|
|
||||||
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
|
|
||||||
End If
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Dim AppNombre As String = $"GlobalDTUnidadesMedida-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTUnidadesMedida-{CveEmpresa}"
|
||||||
@@ -1140,20 +1113,11 @@ Public Class ClsPaginas
|
|||||||
If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
|
If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
|
||||||
ObjUnidadesMedida.Dispose()
|
ObjUnidadesMedida.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
GlobalDTUnidadesMedidaAlias = DirectCast(Application(AppNombre), DataTable)
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTUnidadesMedidaAlias = Dv.ToTable
|
|
||||||
Dv.Dispose()
|
|
||||||
Else
|
|
||||||
GlobalDTUnidadesMedidaAlias = DirectCast(Application(AppNombre), DataTable)
|
|
||||||
End If
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Dim AppNombre As String = $"GlobalDTUnidadesMedidaAlias-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTUnidadesMedidaAlias-{CveEmpresa}"
|
||||||
Application(AppNombre) = value
|
Application(AppNombre) = value
|
||||||
'Dim ObjUnidadesMedida As New ClsUnidadesMedida()
|
|
||||||
'If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
|
|
||||||
'ObjUnidadesMedida.Dispose()
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Shared Property GlobalDTSATMotivosCancelacion(Optional CveSATMotivoCancelacion As Integer = -1, Optional CodigoSAT As String = "-1") As DataTable
|
Public Shared Property GlobalDTSATMotivosCancelacion(Optional CveSATMotivoCancelacion As Integer = -1, Optional CodigoSAT As String = "-1") As DataTable
|
||||||
@@ -1332,7 +1296,7 @@ Public Class ClsPaginas
|
|||||||
If CveProyecto <> -1 Then filtros.Add($"CveProyecto = {CveProyecto}")
|
If CveProyecto <> -1 Then filtros.Add($"CveProyecto = {CveProyecto}")
|
||||||
If CveSubProyecto <> -1 Then filtros.Add($"CveSubProyecto = {CveSubProyecto}")
|
If CveSubProyecto <> -1 Then filtros.Add($"CveSubProyecto = {CveSubProyecto}")
|
||||||
If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
|
If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
|
||||||
If CveEstatus <> -1 Then filtros.Add($"CveUsuario = {CveEstatus}")
|
If CveEstatus <> -1 Then filtros.Add($"CveEstatus = {CveEstatus}")
|
||||||
If filtros.Count > 0 Then
|
If filtros.Count > 0 Then
|
||||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTSubProyectosUsuarios = Dv.ToTable
|
GlobalDTSubProyectosUsuarios = Dv.ToTable
|
||||||
@@ -1357,7 +1321,7 @@ Public Class ClsPaginas
|
|||||||
Dim filtros As New List(Of String)
|
Dim filtros As New List(Of String)
|
||||||
If CveProyecto <> -1 Then filtros.Add($"CveProyecto = {CveProyecto}")
|
If CveProyecto <> -1 Then filtros.Add($"CveProyecto = {CveProyecto}")
|
||||||
If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
|
If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
|
||||||
If CveEstatus <> -1 Then filtros.Add($"CveUsuario = {CveEstatus}")
|
If CveEstatus <> -1 Then filtros.Add($"CveEstatus = {CveEstatus}")
|
||||||
If filtros.Count > 0 Then
|
If filtros.Count > 0 Then
|
||||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTProyectosUsuarios = Dv.ToTable
|
GlobalDTProyectosUsuarios = Dv.ToTable
|
||||||
@@ -1586,11 +1550,8 @@ Public Class ClsPaginas
|
|||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveEmpresa <> -1 Then
|
If Estatus >= 0 Then
|
||||||
Dim StrSQL As New StringBuilder
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveEstado = {Estatus}", "", DataViewRowState.CurrentRows)
|
||||||
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
|
||||||
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstado = {0} ", Estatus)
|
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTProductosServiciosAlias = Dv.ToTable
|
GlobalDTProductosServiciosAlias = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -1644,19 +1605,14 @@ Public Class ClsPaginas
|
|||||||
Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable
|
Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable
|
||||||
Get
|
Get
|
||||||
Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}"
|
||||||
If CveEmpresa <> -1 Then
|
'sino existe, recarga los datos
|
||||||
'sino existe, recarga los datos
|
If Application(AppNombre) Is Nothing Then
|
||||||
If Application(AppNombre) Is Nothing Then
|
Dim ObjPS As New ClsProductosServicios
|
||||||
Dim ObjPS As New ClsProductosServicios
|
If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
|
||||||
If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
|
ObjPS.Dispose()
|
||||||
ObjPS.Dispose()
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
Dim Str As New StringBuilder
|
|
||||||
If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS)
|
|
||||||
If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa)
|
|
||||||
If CvePS > 0 Then
|
If CvePS > 0 Then
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CvePS = {CvePS}", "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTPSAdicionales = Dv.ToTable
|
GlobalDTPSAdicionales = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -1924,18 +1880,19 @@ Public Class ClsPaginas
|
|||||||
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
|
||||||
If HttpContext.Current.Application(AppNombre) Is Nothing Then
|
If HttpContext.Current.Application(AppNombre) Is Nothing Then
|
||||||
Dim ObjClientes As New ClsClientes
|
Dim ObjClientes As New ClsClientes
|
||||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados.Copy()
|
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa:=CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados.Copy()
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
End If
|
End If
|
||||||
|
Dim filtros As New List(Of String)
|
||||||
Dim StrSQL As New StringBuilder
|
If Estatus >= 0 Then filtros.Add($"EstatusBool = {Estatus}")
|
||||||
StrSQL.AppendFormat("1 = 1")
|
If CveCliente >= 0 Then filtros.Add($"CveCliente = {CveCliente}")
|
||||||
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
|
If filtros.Count > 0 Then
|
||||||
If CveCliente >= 0 Then StrSQL.AppendFormat(" AND CveCliente = {0} ", CveCliente)
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
||||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
|
GlobalDTCliente = Dv.ToTable
|
||||||
GlobalDTCliente = Dv.ToTable
|
Dv.Dispose()
|
||||||
Dv.Dispose()
|
Else
|
||||||
|
GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
|
||||||
|
End If
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
|
||||||
@@ -1951,13 +1908,7 @@ Public Class ClsPaginas
|
|||||||
If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
|
If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
GlobalDTClienteClasificaciones = DirectCast(Application(AppNombre), DataTable)
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTClienteClasificaciones = Dv.ToTable
|
|
||||||
Dv.Dispose()
|
|
||||||
Else
|
|
||||||
GlobalDTClienteClasificaciones = DirectCast(Application(AppNombre), DataTable)
|
|
||||||
End If
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Dim AppNombre As String = $"GlobalDTClienteClasificaciones-{CveEmpresa}"
|
Dim AppNombre As String = $"GlobalDTClienteClasificaciones-{CveEmpresa}"
|
||||||
@@ -1990,12 +1941,11 @@ Public Class ClsPaginas
|
|||||||
If ObjVendedores.GetVendedores(CveEmpresa) Then Application(AppNombre) = ObjVendedores.DtResultados
|
If ObjVendedores.GetVendedores(CveEmpresa) Then Application(AppNombre) = ObjVendedores.DtResultados
|
||||||
ObjVendedores.Dispose()
|
ObjVendedores.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
Dim filtros As New List(Of String)
|
||||||
Dim StrSQL As New StringBuilder
|
If VendedorTipo >= 0 Then filtros.Add($"VendedorTipo = {VendedorTipo}")
|
||||||
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
If Estatus >= 0 Then filtros.Add($"CveEstatus = {Estatus}")
|
||||||
If VendedorTipo >= 0 Then StrSQL.AppendFormat(" AND VendedorTipo = {0} ", VendedorTipo)
|
If filtros.Count > 0 Then
|
||||||
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", If(Estatus = 1, True, False))
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTVendedores = Dv.ToTable
|
GlobalDTVendedores = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
@@ -3259,23 +3209,18 @@ Public Class ClsPaginas
|
|||||||
'sino existe, recarga los datos
|
'sino existe, recarga los datos
|
||||||
If Application(AppNombre) Is Nothing Then
|
If Application(AppNombre) Is Nothing Then
|
||||||
Dim ObjOC As New ClsOC
|
Dim ObjOC As New ClsOC
|
||||||
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then
|
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa:=CveEmpresa) Then
|
||||||
Application(AppNombre) = ObjOC.DtResultados
|
Application(AppNombre) = ObjOC.DtResultados
|
||||||
Else
|
Else
|
||||||
Application(AppNombre) = Nothing
|
Application(AppNombre) = Nothing
|
||||||
End If
|
End If
|
||||||
ObjOC.Dispose()
|
ObjOC.Dispose()
|
||||||
End If
|
End If
|
||||||
If CveEmpresa <> -1 Then
|
Dim filtros As New List(Of String)
|
||||||
Dim filtro As New StringBuilder
|
If CveUsuario > 0 Then filtros.Add($"CveUsuario = {CveUsuario}")
|
||||||
filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
|
If Tipo <> "" Then filtros.Add($"Tipo = {Tipo}")
|
||||||
If CveUsuario > 0 Then
|
If filtros.Count > 0 Then
|
||||||
filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
|
||||||
End If
|
|
||||||
If Tipo <> "" Then
|
|
||||||
filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
|
|
||||||
End If
|
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
|
|
||||||
GlobalDTOCEstatusUsuarios = Dv.ToTable
|
GlobalDTOCEstatusUsuarios = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
|
|||||||
Reference in New Issue
Block a user