From 07c93ec42d45dcde40805be1d9e018f64ae6c60f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 27 Jan 2023 12:24:54 -0700 Subject: [PATCH] E141 Cambios de log de ejecucion de tarea programada --- Ashx/E141.ashx | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index 95c0d6c4f..e1a263008 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -383,7 +383,10 @@ Public Class E141 : Implements IHttpHandler 'TAREAS PROGRAMADAS Select Case Metodo Case "CrearActualizarProductos" + + GuardaLogAD("NP-Inicia actualizacion de productos", "LogE141") respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False)) + GuardaLogAD("NP-Finaliza actualizacion de productos", "LogE141") If respuesta Then retorno = "True" Else @@ -392,7 +395,9 @@ Public Class E141 : Implements IHttpHandler Case "CrearActualizarProductosJson" retorno = CrearActualizarProductosJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarPrecios" + GuardaLogAD("AP-Inicia actualizacion de precios", "LogE141") respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False)) + GuardaLogAD("AP-Finaliza actualizacion de precios", "LogE141") If respuesta Then retorno = "True" Else @@ -401,7 +406,9 @@ Public Class E141 : Implements IHttpHandler Case "ActualizarPreciosJson" retorno = ActualizarPreciosJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarExistencias" + GuardaLogAD("AE-Inicia actualizacion de existencias", "LogE141") respuesta = ActualizarExistencias() + GuardaLogAD("AE-Finaliza actualizacion de existencias", "LogE141") If respuesta Then retorno = "True" Else @@ -410,7 +417,9 @@ Public Class E141 : Implements IHttpHandler Case "ActualizarExistenciasJson" retorno = ActualizarExistenciasJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarVendedores" + GuardaLogAD("AV-Inicia actualizacion de vendedores", "LogE141") respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False)) + GuardaLogAD("AV-Finaliza actualizacion de vendedores", "LogE141") If respuesta Then retorno = "True" Else @@ -1923,7 +1932,12 @@ Public Class E141 : Implements IHttpHandler Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then CountPeticionesExitosas += 1 + GuardaLogAD("NP-Creacion/actualizacion de productos exitosa", "LogE141") + Else + GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${resp}", "LogE141") End If Else @@ -1958,7 +1972,12 @@ Public Class E141 : Implements IHttpHandler Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then CountPeticionesExitosas += 1 + GuardaLogAD("NP-Creacion/actualizacion de productos exitosa", "LogE141") + Else + GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${resp}", "LogE141") End If Threading.Thread.Sleep(1000) @@ -2071,8 +2090,13 @@ Public Class E141 : Implements IHttpHandler If IsValidJson(resp) Then Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then + GuardaLogAD("AP-Actualizacion de precios exitosa", "LogE141") CountPeticionesExitosas += 1 + Else + GuardaLogAD($"AP-No se pudo actualizar precios ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"AP-No se pudo actualizar precios ${resp}", "LogE141") End If Else @@ -2103,7 +2127,12 @@ Public Class E141 : Implements IHttpHandler Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then CountPeticionesExitosas += 1 + GuardaLogAD("AP-Actualizacion de precios exitosa", "LogE141") + Else + GuardaLogAD($"AP-No se pudo actualizar precios ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"AP-No se pudo actualizar precios ${resp}", "LogE141") End If Threading.Thread.Sleep(1000) @@ -2186,7 +2215,12 @@ Public Class E141 : Implements IHttpHandler Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then CountPeticionesExitosas += 1 + GuardaLogAD("AE-Actualizacion de existencias exitosa", "LogE141") + Else + GuardaLogAD($"AE-No se pudo actualizar existencias ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"AE-No se pudo actualizar existencias ${resp}", "LogE141") End If Else @@ -2217,7 +2251,12 @@ Public Class E141 : Implements IHttpHandler Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then CountPeticionesExitosas += 1 + GuardaLogAD("AE-Actualizacion de existencias exitosa", "LogE141") + Else + GuardaLogAD($"AE-No se pudo actualizar existencias ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"AE-No se pudo actualizar existencias ${resp}", "LogE141") End If Threading.Thread.Sleep(1000) End While @@ -2338,7 +2377,12 @@ Public Class E141 : Implements IHttpHandler Dim respuesta = JObject.Parse(resp) If respuesta("status").ToString() = "success" Then CountPeticionesExitosas += 1 + GuardaLogAD("AV-Actualizacion de vendedores exitosa", "LogE141") + Else + GuardaLogAD($"AV-No se pudo actualizar vendedores ${respuesta.ToString()}", "LogE141") End If + Else + GuardaLogAD($"AV-No se pudo actualizar vendedores ${resp}", "LogE141") End If End If