diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0e4c53628..da7cfdf70 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -293,19 +293,28 @@ Public Class ClsPaginas Application("Directorio") = value End Set End Property - Property GlobalDTPSATPS() As DataTable + Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String) As DataTable Get - If Application("GlobalDTPSATPS") Is Nothing Then - Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing - ObjGrales.Dispose() + 'If Application("GlobalDTPSATPS") Is Nothing Then + ' Dim ObjGrales As New ClsGenerales + ' If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing + ' ObjGrales.Dispose() + 'End If + + 'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable + + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio) Then + GlobalDTPSATPS = ObjGrales.DtResultados + Else + GlobalDTPSATPS = Nothing End If + ObjGrales.Dispose() - GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable End Get - Set(value As DataTable) - Application("GlobalDTPSATPS") = value - End Set + 'Set(value As DataTable) + ' Application("GlobalDTPSATPS") = value + 'End Set End Property #Region "GLOBALES DE SAT COMERCIO EXTERIOR" diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index de2c67ba8..43e27b789 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -701,7 +701,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'verifica existencias If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then UsaGlobal = False - + Dim objInv As New ClsInventarios If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca) Then @@ -933,20 +933,25 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Private Function GETPSSAT(ByVal context As HttpContext) As String Dim retorno As String = "" - Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)) + 'Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)) Dim DtPSRetorno As DataTable Dim Name = IfNull(context.Request("Name"), "-1").ToString - If Name <> "-1" Then - DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*"))) - End If - - DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"}) + 'If Name <> "-1" Then + ' DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*"))) + 'End If + 'DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"}) + DtPSRetorno = ClsPaginas.GlobalDTPSATPS(Name.ToLower) If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then DtPSRetorno.Columns("CveSATPS").ColumnName = "id" DtPSRetorno.Columns("SATClaveProductoServicio").ColumnName = "text" + 'limpia las columnas + For Each dc As DataColumn In DtPSRetorno.Clone.Columns + If Not dc.ColumnName.Contiene("id", "text") Then DtPSRetorno.Columns.Remove(dc.ColumnName) + Next + retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString context.Response.Write(retorno) Else