From 2b5e7c9b61106cfd49f5d1ec083db71173b9d131 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 18 Jun 2022 14:28:45 -0700 Subject: [PATCH] GPS. metodo para obtener rutas en webs service --- asmx/WSGPSApp.asmx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 807de05e8..53f281618 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -1150,6 +1150,44 @@ Public Class WSGPSApp End Function + + + Public Function GetGeoRutas(CveCliente As Integer, CveDispositivo As Integer) As String + Dim CveGeoReferencia As Integer = -1 + Dim DtRutas As DataTable = Nothing + Using ObjGPS As New ClsGPS + If ObjGPS.GetReferenciaDetalle(-1, -1, CveDispositivo, CveCliente) Then + CveGeoReferencia = ObjGPS.DtResultados.FiltroPrimeroValor("CveGeoReferencia", "Tipo = 'Ruta'").ToEntero() + End If + If CveGeoReferencia > 0 Then + If ObjGPS.GeoReferenciaGet(CveGeoReferencia, -1, "Ruta", CveCliente) Then + DtRutas = ObjGPS.DtResultados.Copy() + End If + End If + End Using + + Dim Rutas As New List(Of Object) + If CveGeoReferencia > 0 Then + + For Each Row As DataRow In DtRutas.Rows + Dim Coordenadas As List(Of MWSGeolocation2) = SQLToGmapsPolyline(Row("Coordenadas").ToString()) + + Rutas.Add(New With { + .CveRuta = CveGeoReferencia, + .Ruta = Row("GeoReferencia").ToString(), + .Folio = "", + .Fecha = Row("FechaInicio").ToString(), + .CveDispositivo = CveDispositivo, + .CveUsuarioIngreso = -1, + .Coordenadas = Coordenadas + }) + Next + + End If + + Return JsonConvert.SerializeObject(Rutas) + + End Function Public Function GetRutas(CveCliente As Integer, CveRuta As Integer, MostrarPuntos As Boolean) As String Dim DtRutas As DataTable = Nothing