-- cambios para performance
This commit is contained in:
@@ -19,6 +19,7 @@ Public Class ClsGenerales
|
|||||||
Private disposedValue As Boolean = False
|
Private disposedValue As Boolean = False
|
||||||
'REGISTRAR CONEXIONES ABIERTAS
|
'REGISTRAR CONEXIONES ABIERTAS
|
||||||
Private CveConexion As Integer = 0
|
Private CveConexion As Integer = 0
|
||||||
|
Private EsTransaccionCompartida As Boolean = False
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
@@ -74,6 +75,7 @@ Public Class ClsGenerales
|
|||||||
Else
|
Else
|
||||||
SqlConexion = TransaccionCompartida.Connection
|
SqlConexion = TransaccionCompartida.Connection
|
||||||
SqlTransacc = TransaccionCompartida
|
SqlTransacc = TransaccionCompartida
|
||||||
|
EsTransaccionCompartida = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||||
@@ -91,7 +93,7 @@ Public Class ClsGenerales
|
|||||||
#Region "Conexiones"
|
#Region "Conexiones"
|
||||||
|
|
||||||
Private Sub ConexionAdd()
|
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
|
Try
|
||||||
DataAdapter("PA_Sis_RegistrarConexion")
|
DataAdapter("PA_Sis_RegistrarConexion")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|||||||
@@ -1742,12 +1742,16 @@ Partial Class GPS_Rastreo
|
|||||||
|
|
||||||
Using wc As New HttpClient()
|
Using wc As New HttpClient()
|
||||||
Try
|
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 FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||||
Dim response = wc.PostAsync(Url, content).Result
|
Dim response = wc.PostAsync(Url, content).Result
|
||||||
Dim result = response.Content.ReadAsStringAsync().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
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||||
End Try
|
End Try
|
||||||
@@ -2214,12 +2218,16 @@ Partial Class GPS_Rastreo
|
|||||||
|
|
||||||
Using wc As New HttpClient()
|
Using wc As New HttpClient()
|
||||||
Try
|
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 FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||||
Dim response = wc.PostAsync(Url, content).Result
|
Dim response = wc.PostAsync(Url, content).Result
|
||||||
Dim result = response.Content.ReadAsStringAsync().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
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@@ -186,12 +186,16 @@ Partial Class GPS_TrayectoDetalle
|
|||||||
|
|
||||||
Using wc As New HttpClient()
|
Using wc As New HttpClient()
|
||||||
Try
|
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 FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||||
Dim response = wc.PostAsync(Url, content).Result
|
Dim response = wc.PostAsync(Url, content).Result
|
||||||
Dim result = response.Content.ReadAsStringAsync().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
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@@ -5182,7 +5182,7 @@ Partial Class OC
|
|||||||
Protected Function ActualizarCotizacion(ByRef ObjVentas As ClsVentas) As Boolean
|
Protected Function ActualizarCotizacion(ByRef ObjVentas As ClsVentas) As Boolean
|
||||||
Dim OcurrioError As Boolean = False
|
Dim OcurrioError As Boolean = False
|
||||||
Try
|
Try
|
||||||
Dim PorcentajeGanancia As Decimal = 0.1D
|
Dim PorcentajeGanancia As Decimal = 0.3D
|
||||||
For Each Row As DataRow In DtDetalle.Rows
|
For Each Row As DataRow In DtDetalle.Rows
|
||||||
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
|
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
|
||||||
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
|
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
|
||||||
|
|||||||
@@ -74,12 +74,16 @@ Partial Class PortalGPS_Penske
|
|||||||
|
|
||||||
Using wc As New HttpClient()
|
Using wc As New HttpClient()
|
||||||
Try
|
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 FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||||
Dim response = wc.PostAsync(Url, content).Result
|
Dim response = wc.PostAsync(Url, content).Result
|
||||||
Dim result = response.Content.ReadAsStringAsync().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
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
Reference in New Issue
Block a user