-- cambios para performance
This commit is contained in:
@@ -18,9 +18,10 @@ Public Class ClsGenerales
|
||||
Private Data As DataTable
|
||||
Private disposedValue As Boolean = False
|
||||
'REGISTRAR CONEXIONES ABIERTAS
|
||||
Private CveConexion As Integer = 0
|
||||
Private CveConexion As Integer = 0
|
||||
Private EsTransaccionCompartida As Boolean = False
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property Colectiva As String
|
||||
Public Property Codigo As String
|
||||
@@ -73,7 +74,8 @@ Public Class ClsGenerales
|
||||
End Try
|
||||
Else
|
||||
SqlConexion = TransaccionCompartida.Connection
|
||||
SqlTransacc = TransaccionCompartida
|
||||
SqlTransacc = TransaccionCompartida
|
||||
EsTransaccionCompartida = True
|
||||
End If
|
||||
|
||||
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||
@@ -91,7 +93,7 @@ Public Class ClsGenerales
|
||||
#Region "Conexiones"
|
||||
|
||||
Private Sub ConexionAdd()
|
||||
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
Try
|
||||
DataAdapter("PA_Sis_RegistrarConexion")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
@@ -1741,13 +1741,17 @@ Partial Class GPS_Rastreo
|
||||
Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString()))
|
||||
|
||||
Using wc As New HttpClient()
|
||||
Try
|
||||
Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php")
|
||||
Try
|
||||
Dim Url = New Uri(String.Format("{0}nominatim/reverseMultiple.php", ClsPaginas.UrlDirecciones))
|
||||
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
Dim result = response.Content.ReadAsStringAsync().Result
|
||||
retorno = JArray.Parse(result)
|
||||
retorno = JArray.Parse(result)
|
||||
response.Dispose()
|
||||
content = Nothing
|
||||
Url = Nothing
|
||||
FormStuff = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||
End Try
|
||||
@@ -2214,12 +2218,16 @@ Partial Class GPS_Rastreo
|
||||
|
||||
Using wc As New HttpClient()
|
||||
Try
|
||||
Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php")
|
||||
Dim Url = New Uri(String.Format("{0}nominatim/reverseMultiple.php", ClsPaginas.UrlDirecciones))
|
||||
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
Dim result = response.Content.ReadAsStringAsync().Result
|
||||
retorno = JArray.Parse(result)
|
||||
retorno = JArray.Parse(result)
|
||||
response.Dispose()
|
||||
content = Nothing
|
||||
Url = Nothing
|
||||
FormStuff = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||
End Try
|
||||
|
||||
@@ -186,12 +186,16 @@ Partial Class GPS_TrayectoDetalle
|
||||
|
||||
Using wc As New HttpClient()
|
||||
Try
|
||||
Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php")
|
||||
Dim Url = New Uri(String.Format("{0}nominatim/reverseMultiple.php", ClsPaginas.UrlDirecciones))
|
||||
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
Dim result = response.Content.ReadAsStringAsync().Result
|
||||
retorno = JArray.Parse(result)
|
||||
retorno = JArray.Parse(result)
|
||||
response.Dispose()
|
||||
content = Nothing
|
||||
Url = Nothing
|
||||
FormStuff = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||
End Try
|
||||
|
||||
@@ -5182,7 +5182,7 @@ Partial Class OC
|
||||
Protected Function ActualizarCotizacion(ByRef ObjVentas As ClsVentas) As Boolean
|
||||
Dim OcurrioError As Boolean = False
|
||||
Try
|
||||
Dim PorcentajeGanancia As Decimal = 0.1D
|
||||
Dim PorcentajeGanancia As Decimal = 0.3D
|
||||
For Each Row As DataRow In DtDetalle.Rows
|
||||
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
|
||||
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
@@ -74,12 +74,16 @@ Partial Class PortalGPS_Penske
|
||||
|
||||
Using wc As New HttpClient()
|
||||
Try
|
||||
Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php")
|
||||
Dim Url = New Uri(String.Format("{0}nominatim/reverseMultiple.php", ClsPaginas.UrlDirecciones))
|
||||
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
Dim result = response.Content.ReadAsStringAsync().Result
|
||||
retorno = JArray.Parse(result)
|
||||
response.Dispose()
|
||||
content = Nothing
|
||||
Url = Nothing
|
||||
FormStuff = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user