diff --git a/BLL/Integracion_DGA/BusinessLogic.cs b/BLL/Integracion_DGA/BusinessLogic.cs index 012bfd6..d380231 100644 --- a/BLL/Integracion_DGA/BusinessLogic.cs +++ b/BLL/Integracion_DGA/BusinessLogic.cs @@ -92,6 +92,7 @@ namespace BLL.Integracion_DGA ).ToList(); await _jobs.InsertarDgaCaudal(caudalData); + await _jobs.InsertarMedicionOperacionCaudal(); } else if (item.name == "API - DGA - NIVELES") { @@ -109,6 +110,7 @@ namespace BLL.Integracion_DGA ).ToList(); await _jobs.InsertarDgaNivel(nivelData); + await _jobs.InsertarMedicionOperacionNivel(); } else if (item.name == "API - DGA") { diff --git a/DAL/JobsDgaRepository.cs b/DAL/JobsDgaRepository.cs index 0c8af80..20e39db 100644 --- a/DAL/JobsDgaRepository.cs +++ b/DAL/JobsDgaRepository.cs @@ -1,6 +1,7 @@ using System.Data; using Dapper; using Microsoft.Data.SqlClient; +using Microsoft.Identity.Client; using Shared.DTO.Integracion_DGA; using Shared.DTO.VariablesEntorno; @@ -185,5 +186,45 @@ namespace DAL throw new Exception($"Error: {ex.Message}"); } } + + public async Task InsertarMedicionOperacionNivel() + { + try + { + using (SqlConnection connection = new SqlConnection(BdConexion.StringConnection)) + { + await connection.OpenAsync(); + await connection.ExecuteAsync( + "SP_CALCULO_NIVEL_MEDICION_SMARTSCADA_OPERACION", + commandType: CommandType.StoredProcedure + ); + return true; + } + } + catch (Exception ex) + { + throw new Exception($"Error: {ex.Message}"); + } + } + + public async Task InsertarMedicionOperacionCaudal() + { + try + { + using (SqlConnection connection = new SqlConnection(BdConexion.StringConnection)) + { + await connection.OpenAsync(); + await connection.ExecuteAsync( + "SP_CALCULO_CAUDAL_MEDICION_SMARTSCADA_OPERACION", + commandType: CommandType.StoredProcedure + ); + return true; + } + } + catch (Exception ex) + { + throw new Exception($"Error: {ex.Message}"); + } + } } }