Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -5985,12 +5985,13 @@ Public Class ClsInventarios
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetJAM_APIs(Optional Opcion As Integer = 1) As Boolean
|
Public Function GetJAM_APIs(Optional Opcion As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
Dataset = New DataSet()
|
Dataset = New DataSet()
|
||||||
DataAdapter("PA_JAM_APIs")
|
DataAdapter("PA_JAM_APIs")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||||
|
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -114,6 +114,18 @@ Public Class E119 : Implements IHttpHandler
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Metodo = "ConsultarClasificaciones" Then
|
||||||
|
context.Response.ContentType = "application/json"
|
||||||
|
Dim Auth = ValidarSolicitud(context)
|
||||||
|
|
||||||
|
If Auth.IsSucces Then
|
||||||
|
retorno = ConsultaClasificaciones(context)
|
||||||
|
Else
|
||||||
|
context.Response.StatusCode = Auth.StatusCode
|
||||||
|
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
context.Response.Write(retorno)
|
context.Response.Write(retorno)
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -226,10 +238,16 @@ Public Class E119 : Implements IHttpHandler
|
|||||||
Dim RespuestaError As New ResponseMsgError
|
Dim RespuestaError As New ResponseMsgError
|
||||||
Dim TieneError As Boolean = False
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
Dim CveClasificacion = If(context.Request("CveClasificacion") = Nothing, "", context.Request("CveClasificacion").ToString())
|
||||||
|
|
||||||
|
If String.IsNullOrEmpty(CveClasificacion) Then
|
||||||
|
CveClasificacion = "-1"
|
||||||
|
End If
|
||||||
|
|
||||||
Dim Productos As JArray = Nothing
|
Dim Productos As JArray = Nothing
|
||||||
|
|
||||||
Using ObjInventario As New ClsInventarios
|
Using ObjInventario As New ClsInventarios
|
||||||
If ObjInventario.GetJAM_APIs(1) AndAlso ObjInventario.DtResultados IsNot Nothing Then
|
If ObjInventario.GetJAM_APIs(1, CveClasificacion:=CveClasificacion.ToEntero()) AndAlso ObjInventario.DtResultados IsNot Nothing Then
|
||||||
Productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP())
|
Productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP())
|
||||||
Else
|
Else
|
||||||
RespuestaError.message = "no se pudo obtener los datos"
|
RespuestaError.message = "no se pudo obtener los datos"
|
||||||
@@ -256,6 +274,39 @@ Public Class E119 : Implements IHttpHandler
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function ConsultaClasificaciones(ByVal context As HttpContext) As String
|
||||||
|
Dim Respuesta As New ResponseMsg
|
||||||
|
Dim RespuestaError As New ResponseMsgError
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
Dim Clasificaciones As JArray = Nothing
|
||||||
|
|
||||||
|
Try
|
||||||
|
Clasificaciones = JArray.Parse(ClsPaginas.GlobalDTClasificaciones(CveEmpresa).FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).DataTableToJSONIPP())
|
||||||
|
Catch ex As Exception
|
||||||
|
RespuestaError.message = "no se pudo obtener los datos"
|
||||||
|
TieneError = True
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Dim Msg As String = "Información día " & Now.ToShortDateString & If(RespuestaError.message <> "", " Error: " & RespuestaError.message, "")
|
||||||
|
Msg.GuardaLogAD("LogE119")
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
context.Response.StatusCode = 200
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
Else
|
||||||
|
context.Response.StatusCode = 200
|
||||||
|
Try
|
||||||
|
Respuesta.data = New JObject(New JProperty("Clasificaciones", Clasificaciones))
|
||||||
|
Respuesta.message = "Los datos se obtuvieron correctamente"
|
||||||
|
Return JsonConvert.SerializeObject(Respuesta)
|
||||||
|
Catch ex As Exception
|
||||||
|
RespuestaError.message = "Ocurrió un error al generar la petición"
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Class ResponseMsg
|
Private Class ResponseMsg
|
||||||
Sub New()
|
Sub New()
|
||||||
status = "success"
|
status = "success"
|
||||||
|
|||||||
Reference in New Issue
Block a user