Mostra json de productos
This commit is contained in:
@@ -392,22 +392,37 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Select Case Metodo
|
Select Case Metodo
|
||||||
Case "CrearActualizarProductos"
|
Case "CrearActualizarProductos"
|
||||||
respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
|
respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
|
||||||
|
If respuesta Then
|
||||||
|
retorno = "True"
|
||||||
|
Else
|
||||||
|
retorno = "False"
|
||||||
|
End If
|
||||||
|
Case "CrearActualizarProductosJson"
|
||||||
|
retorno = CrearActualizarProductosJson(If(FiltrarTodos = "1", True, False))
|
||||||
Case "ActualizarPrecios"
|
Case "ActualizarPrecios"
|
||||||
respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
|
respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
|
||||||
|
If respuesta Then
|
||||||
|
retorno = "True"
|
||||||
|
Else
|
||||||
|
retorno = "False"
|
||||||
|
End If
|
||||||
Case "ActualizarExistencias"
|
Case "ActualizarExistencias"
|
||||||
respuesta = ActualizarExistencias()
|
respuesta = ActualizarExistencias()
|
||||||
|
If respuesta Then
|
||||||
|
retorno = "True"
|
||||||
|
Else
|
||||||
|
retorno = "False"
|
||||||
|
End If
|
||||||
Case "ActualizarVendedores"
|
Case "ActualizarVendedores"
|
||||||
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
||||||
|
If respuesta Then
|
||||||
|
retorno = "True"
|
||||||
|
Else
|
||||||
|
retorno = "False"
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If respuesta Then
|
|
||||||
retorno = "True"
|
|
||||||
Else
|
|
||||||
retorno = "False"
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
context.Response.Write(retorno)
|
context.Response.Write(retorno)
|
||||||
@@ -1962,6 +1977,25 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function CrearActualizarProductosJson(Todos As Boolean) As String
|
||||||
|
Dim payload = New JObject()
|
||||||
|
|
||||||
|
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||||
|
|
||||||
|
Dim DtPS As DataTable = Nothing
|
||||||
|
Using ObjPS As New ClsProductosServicios
|
||||||
|
'OBTERNER PRECIOS DE PUBLICO GENERAL
|
||||||
|
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
|
||||||
|
DtPS = ObjPS.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtPS IsNot Nothing Then
|
||||||
|
payload.Add(New JProperty("products", GenerarPayloadProductos(DtPS)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return payload.ToString()
|
||||||
|
End Function
|
||||||
Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray
|
Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray
|
||||||
Dim ArrayPS As New JArray
|
Dim ArrayPS As New JArray
|
||||||
For Each RowPS As DataRow In DtPS.Rows
|
For Each RowPS As DataRow In DtPS.Rows
|
||||||
|
|||||||
Reference in New Issue
Block a user