From 7e075d40153327628183614916300dccc91e41ab Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 1 Jul 2024 22:08:32 -0700 Subject: [PATCH] -nuevo global --- App_Code/ClsPaginas.vb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6e721d930..4ebbbfb54 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -2344,6 +2344,31 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property + + Public Shared Property GlobalDTClientesTodosSucursales(CveEmpresa As Integer, Optional CveCliente As Integer = -1) As DataTable + Get + Dim AppNombre As String = $"GlobalDTClientesTodosSucursales-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjClientes As New ClsClientes + If ObjClientes.GetClienteSucursales(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados.Copy() + ObjClientes.Dispose() + End If + Dim filtros As New List(Of String) + + If CveCliente >= 0 Then filtros.Add($"CveCliente = {CveCliente}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTClientesTodosSucursales = Dv.ToTable + Dv.Dispose() + Else + GlobalDTClientesTodosSucursales = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTClientesTodosSucursales-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value + End Set + End Property Public Shared Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTEstatusOrdenServicios-{CveEmpresa}"