integración nueva tabla
This commit is contained in:
parent
5db07294f9
commit
657fd50ac9
22 changed files with 203 additions and 447 deletions
36
DAL/MedicionDGARepository.cs
Normal file
36
DAL/MedicionDGARepository.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Data;
|
||||
using Dapper;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Shared.DTO.Envios_DGA;
|
||||
using Shared.DTO.VariablesEntorno;
|
||||
|
||||
namespace DAL
|
||||
{
|
||||
public class MedicionDGARepository
|
||||
{
|
||||
public async Task<List<DatoDGA>> ObtenerMedicionesAsync()
|
||||
{
|
||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||
|
||||
var result = await connection.QueryAsync<DatoDGA>(
|
||||
"SP_OBTENER_DGA_DATOS",
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return result.ToList();
|
||||
}
|
||||
|
||||
public static async Task<bool> ActualizarMedicionesAsync(string medicionesJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||
await connection.ExecuteAsync("SP_ACTUALIZAR_MEDICION_SMARTSCADA_OPERACION", new { JsonMediciones = medicionesJson }, commandType: CommandType.StoredProcedure);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue