consulta directo la información de globaldtPS SAT
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user