This commit is contained in:
@@ -406,6 +406,8 @@ Public Class E141 : Implements IHttpHandler
|
||||
Else
|
||||
retorno = "False"
|
||||
End If
|
||||
Case "ActualizarPreciosJson"
|
||||
retorno = ActualizarPreciosJson(If(FiltrarTodos = "1", True, False))
|
||||
Case "ActualizarExistencias"
|
||||
respuesta = ActualizarExistencias()
|
||||
If respuesta Then
|
||||
@@ -413,6 +415,8 @@ Public Class E141 : Implements IHttpHandler
|
||||
Else
|
||||
retorno = "False"
|
||||
End If
|
||||
Case "ActualizarExistenciasJson"
|
||||
retorno = ActualizarExistenciasJson(If(FiltrarTodos = "1", True, False))
|
||||
Case "ActualizarVendedores"
|
||||
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
||||
If respuesta Then
|
||||
@@ -2118,6 +2122,26 @@ Public Class E141 : Implements IHttpHandler
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function ActualizarPreciosJson(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.GetPreciosModificados(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", GenerarPayloadPrecios(DtPS)))
|
||||
End If
|
||||
|
||||
Return payload.ToString()
|
||||
End Function
|
||||
|
||||
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
@@ -2215,6 +2239,25 @@ Public Class E141 : Implements IHttpHandler
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function ActualizarExistenciasJson(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
|
||||
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
|
||||
DtPS = ObjPS.DtResultados.Copy()
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DtPS IsNot Nothing Then
|
||||
payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS)))
|
||||
End If
|
||||
|
||||
Return payload.ToString()
|
||||
End Function
|
||||
|
||||
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
@@ -2233,7 +2276,7 @@ Public Class E141 : Implements IHttpHandler
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
|
||||
#Region "A C T U A L I Z A R - V E N D E D O R E S"
|
||||
|
||||
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -92,6 +92,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
ActualizaPrePoliza(context)
|
||||
Case "getpersonal"
|
||||
getpersonal(context)
|
||||
Case "getcuentascontables"
|
||||
GetCuentasContables(context)
|
||||
Case "getcontratos"
|
||||
GetContratos(context)
|
||||
Case "GettingCURP"
|
||||
@@ -580,6 +582,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
|
||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||
'Dim i As Integer = 0 'limpieza de columnas
|
||||
'While i < DtRetorno.Columns.Count
|
||||
' If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
|
||||
' DtRetorno.Columns.RemoveAt(i)
|
||||
' Else
|
||||
' i = i + 1
|
||||
' End If
|
||||
'End While
|
||||
|
||||
DtRetorno.Columns("CveCliente").ColumnName = "id"
|
||||
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
|
||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||
@@ -615,11 +626,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
ObjProveedores.Dispose()
|
||||
End If
|
||||
|
||||
'Dim ObjProveedores As New ClsCompProveedores
|
||||
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
||||
' DtRetorno = ObjProveedores.DtResultados
|
||||
'End If
|
||||
'ObjProveedores.Dispose()
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
||||
@@ -628,14 +634,24 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
|
||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||
Dim i As Integer = 0 'limpieza de columnas
|
||||
While i < DtRetorno.Columns.Count
|
||||
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
|
||||
DtRetorno.Columns.RemoveAt(i)
|
||||
Else
|
||||
i = i + 1
|
||||
End If
|
||||
End While
|
||||
|
||||
DtRetorno.Columns("CveProveedor").ColumnName = "id"
|
||||
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
|
||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||
context.Response.Write(retorno)
|
||||
DtRetorno.Dispose()
|
||||
Else
|
||||
context.Response.Write("[]")
|
||||
End If
|
||||
DtRetorno.Dispose()
|
||||
|
||||
Return retorno
|
||||
End Function
|
||||
#End Region
|
||||
@@ -1169,11 +1185,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
ObjPersonal.Dispose()
|
||||
End If
|
||||
|
||||
'Dim ObjProveedores As New ClsCompProveedores
|
||||
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
||||
' DtRetorno = ObjProveedores.DtResultados
|
||||
'End If
|
||||
'ObjProveedores.Dispose()
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
|
||||
@@ -1181,6 +1192,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
|
||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||
|
||||
DtRetorno.Columns("CvePersonal").ColumnName = "id"
|
||||
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
|
||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||
@@ -1227,4 +1239,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Return retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Get Cuentas"
|
||||
Private Function GetCuentasContables(ByVal context As HttpContext) As String
|
||||
Dim retorno As String = ""
|
||||
Dim DtRetorno As DataTable = Nothing
|
||||
|
||||
Dim usuario As Usuario = UsuarioActual(context)
|
||||
Dim CveEmpresa As String
|
||||
If IsNothing(usuario) Then
|
||||
context.Response.Write("")
|
||||
Else
|
||||
CveEmpresa = usuario.CveEmpresa
|
||||
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
If ObjConta.GetCuentas(-1, "-1", 1, CveEmpresa, Nombre:=Name) Then
|
||||
DtRetorno = ObjConta.DtResultados
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||
Dim i As Integer = 0 'limpieza de columnas
|
||||
While i < DtRetorno.Columns.Count
|
||||
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveCuenta", "CtaCodigo") Then
|
||||
DtRetorno.Columns.RemoveAt(i)
|
||||
Else
|
||||
i = i + 1
|
||||
End If
|
||||
End While
|
||||
DtRetorno.Columns("CveCuenta").ColumnName = "id"
|
||||
DtRetorno.Columns("CtaCodigo").ColumnName = "text"
|
||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||
context.Response.Write(retorno)
|
||||
Else
|
||||
context.Response.Write("[]")
|
||||
End If
|
||||
|
||||
DtRetorno.Dispose()
|
||||
Return retorno
|
||||
End Function
|
||||
#End Region
|
||||
End Class
|
||||
Reference in New Issue
Block a user