diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index b47b3d317..d34542eab 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -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 diff --git a/GPS/Rastreo.aspx.vb b/GPS/Rastreo.aspx.vb index ebed128cf..af2d7eff3 100644 --- a/GPS/Rastreo.aspx.vb +++ b/GPS/Rastreo.aspx.vb @@ -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 diff --git a/GPS/TrayectoDetalle.aspx.vb b/GPS/TrayectoDetalle.aspx.vb index 1498d5bb4..3df27cc25 100644 --- a/GPS/TrayectoDetalle.aspx.vb +++ b/GPS/TrayectoDetalle.aspx.vb @@ -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 diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index f070cb6d2..7e6042a87 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -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("") diff --git a/PortalGPS/Penske.aspx.vb b/PortalGPS/Penske.aspx.vb index 5df25f0cd..38e4d8041 100644 --- a/PortalGPS/Penske.aspx.vb +++ b/PortalGPS/Penske.aspx.vb @@ -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