Cambios BDH, ajuste y garantia
This commit is contained in:
@@ -21,22 +21,35 @@ Public Class WsTSoft
|
||||
<WebMethod()>
|
||||
Public Function AddRemision(FolioRemision As String, NoEconomico As String, CveEstatus As Integer, GeoInicial As String, GeoCarga As String, GeoEntrega As String, Fecha As String) As String
|
||||
Dim retorno As String = ""
|
||||
Dim Continuar As Boolean = False
|
||||
|
||||
Dim objTsoft As New ClsTSoft
|
||||
objTsoft.IniciaTransacSQL()
|
||||
Dim Continuar As Boolean = objTsoft.AddRemisiones(FolioRemision, NoEconomico, CveEstatus, GeoInicial, GeoCarga, GeoEntrega, Fecha)
|
||||
Dim objRem As New addRemisionObj
|
||||
If Continuar Then
|
||||
objTsoft.Commit()
|
||||
objRem.CveRemision = objTsoft.DtResultados.Rows(0)("CveRemision").ToString().ToEntero()
|
||||
objRem.CurrentError = ""
|
||||
Else
|
||||
objTsoft.RollBack()
|
||||
objRem.CveRemision = 0
|
||||
objRem.CurrentError = objTsoft.MyCurrentError
|
||||
End If
|
||||
objTsoft.IniciaTransacSQL()
|
||||
Try
|
||||
Continuar = objTsoft.AddRemisiones(FolioRemision, NoEconomico, CveEstatus, GeoInicial, GeoCarga, GeoEntrega, Fecha)
|
||||
|
||||
Dim objRem As New addRemisionObj
|
||||
If Continuar Then
|
||||
objRem.CveRemision = objTsoft.DtResultados.Rows(0)("CveRemision").ToString().ToEntero()
|
||||
objRem.CurrentError = ""
|
||||
Else
|
||||
objRem.CveRemision = 0
|
||||
objRem.CurrentError = objTsoft.MyCurrentError
|
||||
End If
|
||||
|
||||
retorno = JsonConvert.SerializeObject(objRem)
|
||||
objRem = Nothing
|
||||
Catch ex As Exception
|
||||
Continuar = False
|
||||
Finally
|
||||
If Continuar Then
|
||||
objTsoft.Commit()
|
||||
Else
|
||||
objTsoft.RollBack()
|
||||
End If
|
||||
End Try
|
||||
objTsoft.Dispose()
|
||||
retorno = JsonConvert.SerializeObject(objRem)
|
||||
objRem = Nothing
|
||||
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
@@ -69,22 +82,29 @@ Public Class WsTSoft
|
||||
DtPosicion = ObjGPS.DtResultados.Copy()
|
||||
Continuar = True
|
||||
End If
|
||||
End Using
|
||||
|
||||
Dim ObjPos As New LatLng
|
||||
|
||||
If Continuar AndAlso DtPosicion IsNot Nothing Then
|
||||
'CONSULTA DIRECCIONES
|
||||
Try
|
||||
End Using
|
||||
|
||||
Dim ObjPos As New LatLng
|
||||
|
||||
Try
|
||||
|
||||
If Continuar AndAlso DtPosicion IsNot Nothing Then
|
||||
'CONSULTA DIRECCIONES
|
||||
|
||||
If DtPosicion IsNot Nothing AndAlso DtPosicion.Rows.Count > 0 Then
|
||||
Try
|
||||
|
||||
Dim Direcciones As JArray = ConsultarDirecciones(DtPosicion, "Lat", "Lng")
|
||||
Dim Direcciones As JArray = ConsultarDirecciones(DtPosicion, "Lat", "Lng")
|
||||
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
DtPosicion.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
DtPosicion.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ObjPos.CurrentError = "No se pudo obtener la posición."
|
||||
OnError("Ocurrió un error al asignar las direcciones", ex)
|
||||
End Try
|
||||
|
||||
Dim RowPosicion As DataRow = DtPosicion.Rows("0")
|
||||
|
||||
@@ -96,20 +116,20 @@ Public Class WsTSoft
|
||||
ObjPos.CurrentError = "No se encontraron resultados."
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
Else
|
||||
ObjPos.CurrentError = "No se pudo obtener la posición."
|
||||
OnError("Ocurrió un error al asignar las direcciones", ex)
|
||||
End Try
|
||||
Else
|
||||
ObjPos.CurrentError = "No se pudo obtener la posición."
|
||||
End If
|
||||
End If
|
||||
|
||||
If DtPosicion IsNot Nothing Then
|
||||
DtPosicion.Dispose()
|
||||
DtPosicion = Nothing
|
||||
End If
|
||||
If DtPosicion IsNot Nothing Then
|
||||
DtPosicion.Dispose()
|
||||
DtPosicion = Nothing
|
||||
End If
|
||||
|
||||
retorno = JsonConvert.SerializeObject(ObjPos)
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los datos", ex)
|
||||
End Try
|
||||
|
||||
retorno = JsonConvert.SerializeObject(ObjPos)
|
||||
ObjPos = Nothing
|
||||
Return retorno
|
||||
End Function
|
||||
@@ -135,36 +155,43 @@ Public Class WsTSoft
|
||||
<WebMethod()>
|
||||
Public Function GetRemisionHistorial(FolioRemision As String, NoEconomico As String) As String
|
||||
Dim retorno As String = ""
|
||||
Dim objTsoft As New ClsTSoft
|
||||
Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico)
|
||||
Dim objRem As New GetRemisionHistorialesObj
|
||||
If Continuar Then
|
||||
Try
|
||||
Dim objTsoft As New ClsTSoft
|
||||
Try
|
||||
Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico)
|
||||
Dim objRem As New GetRemisionHistorialesObj
|
||||
If Continuar Then
|
||||
Dim Dt = objTsoft.DtResultados.Copy()
|
||||
Dt.Columns.Add("Direccion", GetType(String))
|
||||
Try
|
||||
Dt.Columns.Add("Direccion", GetType(String))
|
||||
|
||||
'CONSULTA DIRECCIONES
|
||||
Dim Direcciones As JArray = ConsultarDirecciones(Dt, "Lat", "Lon")
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
Dt.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
'CONSULTA DIRECCIONES
|
||||
Dim Direcciones As JArray = ConsultarDirecciones(Dt, "Lat", "Lon")
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
Dt.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
|
||||
objRem.CurrentError = ""
|
||||
Catch ex As Exception
|
||||
objRem.CurrentError = "Ocurrió un error al asignar las direcciones"
|
||||
OnError("Ocurrió un error al asignar las direcciones", ex)
|
||||
End Try
|
||||
|
||||
objRem.Historial = Dt.DataTableToObject(Of GetRemisionHistorialsObj)
|
||||
objRem.CurrentError = ""
|
||||
Catch ex As Exception
|
||||
objRem.CurrentError = "Ocurrió un error al asignar las direcciones"
|
||||
OnError("Ocurrió un error al asignar las direcciones", ex)
|
||||
End Try
|
||||
|
||||
Else
|
||||
objRem.Historial = New List(Of GetRemisionHistorialsObj)
|
||||
objRem.CurrentError = objTsoft.MyCurrentError
|
||||
End If
|
||||
Dt.Dispose()
|
||||
Dt = Nothing
|
||||
Else
|
||||
objRem.Historial = New List(Of GetRemisionHistorialsObj)
|
||||
objRem.CurrentError = objTsoft.MyCurrentError
|
||||
End If
|
||||
retorno = JsonConvert.SerializeObject(objRem)
|
||||
objRem = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los datos", ex)
|
||||
End Try
|
||||
objTsoft.Dispose()
|
||||
retorno = JsonConvert.SerializeObject(objRem)
|
||||
retorno = Nothing
|
||||
|
||||
Return retorno
|
||||
End Function
|
||||
<WebMethod()>
|
||||
@@ -172,27 +199,32 @@ Public Class WsTSoft
|
||||
Dim retorno As String = "[]"
|
||||
|
||||
Dim objTsoft As New ClsTSoft
|
||||
If objTsoft.GetInfoEventosPenske(FechaInicio.ToDateTime(), FechaFin.ToDateTime()) Then
|
||||
If objTsoft.DtResultados.Rows.Count > 0 Then
|
||||
Try
|
||||
'CONSULTA DIRECCIONES
|
||||
Dim Direcciones As JArray = ConsultarDirecciones(objTsoft.DtResultados)
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
objTsoft.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al asignar las direcciones", ex)
|
||||
End Try
|
||||
Try
|
||||
If objTsoft.GetInfoEventosPenske(FechaInicio.ToDateTime(), FechaFin.ToDateTime()) Then
|
||||
If objTsoft.DtResultados.Rows.Count > 0 Then
|
||||
Try
|
||||
'CONSULTA DIRECCIONES
|
||||
Dim Direcciones As JArray = ConsultarDirecciones(objTsoft.DtResultados)
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
objTsoft.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al asignar las direcciones", ex)
|
||||
End Try
|
||||
|
||||
retorno = objTsoft.DtResultados.DataTableToJSONIPP()
|
||||
retorno = objTsoft.DtResultados.DataTableToJSONIPP()
|
||||
Else
|
||||
retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "No se encontraron resultados"})
|
||||
End If
|
||||
Else
|
||||
retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "No se encontraron resultados"})
|
||||
retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "Ocurrío un error al consultar los datos"})
|
||||
End If
|
||||
Else
|
||||
retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "Ocurrío un error al consultar los datos"})
|
||||
End If
|
||||
Catch ex As Exception
|
||||
retorno = "[]"
|
||||
OnError("Ocurrió un error al obtener los datos", ex)
|
||||
End Try
|
||||
objTsoft.Dispose()
|
||||
|
||||
Return retorno
|
||||
@@ -202,17 +234,22 @@ Public Class WsTSoft
|
||||
Dim retorno As String = ""
|
||||
Dim Continuar As Boolean = False
|
||||
|
||||
Dim ObjTSoft As New ClsTSoft
|
||||
Continuar = ObjTSoft.TieneRemisionesActivas(NoEconomico)
|
||||
|
||||
Dim objRem As New MTieneRemisiones With
|
||||
{
|
||||
.TieneRemisiones = Continuar,
|
||||
.CurrentError = ObjTSoft.MyCurrentError
|
||||
}
|
||||
ObjTSoft.Dispose()
|
||||
retorno = JsonConvert.SerializeObject(objRem)
|
||||
objRem = Nothing
|
||||
Dim ObjTSoft As New ClsTSoft
|
||||
Try
|
||||
If ObjTSoft.TieneRemisionesActivas(NoEconomico) Then
|
||||
Dim objRem As New MTieneRemisiones With
|
||||
{
|
||||
.TieneRemisiones = Continuar,
|
||||
.CurrentError = ObjTSoft.MyCurrentError
|
||||
}
|
||||
retorno = JsonConvert.SerializeObject(objRem)
|
||||
objRem = Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los datos", ex)
|
||||
End Try
|
||||
ObjTSoft.Dispose()
|
||||
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user