feat: se agregan logs, y se hacen cambios en el modulo registrar mediciones
This commit is contained in:
parent
5bd9c2a1a6
commit
4b6204d9e7
32 changed files with 648 additions and 625 deletions
|
@ -1,20 +1,13 @@
|
|||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.Win32;
|
||||
using Shared.DTO.Integracion_DGA;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Data;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Shared.DTO.Integracion_DGA;
|
||||
using Shared.DTO.VariablesEntorno;
|
||||
|
||||
namespace DAL
|
||||
{
|
||||
public class JobsDgaRepository
|
||||
{
|
||||
public class JobsDgaRepository
|
||||
{
|
||||
public async Task<bool> InsertarDgaMacroResultado(List<DgaMacroResultado> dgaMacroResultados)
|
||||
{
|
||||
try
|
||||
|
@ -66,29 +59,30 @@ namespace DAL
|
|||
|
||||
public async Task<bool> InsertarDgaMacroResultadoSupFlujSuma(List<DgaMacroResultadoSupFlujSuma> dgaMacroResultadoSupFlujSuma)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Configurar la conexión a la base de datos
|
||||
using (SqlConnection connection = new SqlConnection(BdConexion.StringConnection))
|
||||
try
|
||||
{
|
||||
await connection.OpenAsync();
|
||||
// Truncar la tabla antes de insertar
|
||||
await connection.ExecuteAsync("TRUNCATE TABLE DGA_MACRO_RESULTADO_SUP_FLUJ_SUMA");
|
||||
// Configurar la conexión a la base de datos
|
||||
using (SqlConnection connection = new SqlConnection(BdConexion.StringConnection))
|
||||
{
|
||||
await connection.OpenAsync();
|
||||
// Truncar la tabla antes de insertar
|
||||
await connection.ExecuteAsync("TRUNCATE TABLE DGA_MACRO_RESULTADO_SUP_FLUJ_SUMA");
|
||||
|
||||
// Crear un adaptador de datos
|
||||
SqlDataAdapter adapter = new SqlDataAdapter();
|
||||
// Crear un adaptador de datos
|
||||
SqlDataAdapter adapter = new SqlDataAdapter();
|
||||
|
||||
// Configurar el comando de inserción
|
||||
string sql = "INSERT INTO DGA_MACRO_RESULTADO_SUP_FLUJ_SUMA (TagName, TimeStamp, Value, Quality) VALUES (@TagName, @TimeStamp, @Value, @Quality)";
|
||||
await connection.ExecuteAsync(sql, dgaMacroResultadoSupFlujSuma);
|
||||
// Configurar el comando de inserción
|
||||
string sql = "INSERT INTO DGA_MACRO_RESULTADO_SUP_FLUJ_SUMA (TagName, TimeStamp, Value, Quality) VALUES (@TagName, @TimeStamp, @Value, @Quality)";
|
||||
await connection.ExecuteAsync(sql, dgaMacroResultadoSupFlujSuma);
|
||||
|
||||
return true; // Éxito
|
||||
return true; // Éxito
|
||||
}
|
||||
}
|
||||
}catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> SpCalculoDga()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue