From d4612cdc16c584baaf8dd96a847918c6783399f7 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 May 2024 06:40:08 -0700 Subject: [PATCH] =?UTF-8?q?--=20correcci=C3=B3n=20globalinvcamiones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b94f14de9..4089af8a5 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1952,12 +1952,18 @@ Public Class ClsPaginas If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjInventarios.DtResultados ObjInventarios.Dispose() End If - Dim Str As New StringBuilder - If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion) - If CveTipoCamion > 0 Then Str.AppendFormat("CveTipoCamion = {0}", CveTipoCamion) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTInvCamiones = Dv.ToTable - Dv.Dispose() + + Dim filtros As New List(Of String) + If CveCamion >= 0 Then filtros.Add($"CveCamion = {CveCamion} ") + If CveTipoCamion >= 0 Then filtros.Add($"CveTipoCamion = {CveTipoCamion} ") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTInvCamiones = Dv.ToTable + Dv.Dispose() + Else + GlobalDTInvCamiones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If + End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}"