cambios
This commit is contained in:
parent
b52be74bfa
commit
7bc8400980
4 changed files with 25 additions and 78 deletions
|
@ -9,43 +9,6 @@ namespace DAL
|
|||
{
|
||||
public class LogEnvioRepository
|
||||
{
|
||||
public async Task<bool> InsertarLogEnvioAsync(LogMedicionEnvio logMedicionScada)
|
||||
{
|
||||
try
|
||||
{
|
||||
await using (var connection = new SqlConnection(BdConexion.StringConnection))
|
||||
{
|
||||
// No es necesario hacer OpenAsync: Dapper lo abre si hace falta
|
||||
var sql = @"
|
||||
INSERT INTO dbo.DGA_LOGS_ENVIOS
|
||||
(
|
||||
[ESTADO_ENVIO],
|
||||
[JSON_ENVIO],
|
||||
[JSON_RESPUESTA],
|
||||
[COMPROBANTE],
|
||||
[FECHA_ENVIO],
|
||||
[ID_DGA_DATO]
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@ESTADO_ENVIO,
|
||||
@JSON_ENVIO,
|
||||
@JSON_RESPUESTA,
|
||||
@COMPROBANTE,
|
||||
@FECHA_ENVIO,
|
||||
@ID_DGA_DATO
|
||||
);";
|
||||
|
||||
await connection.ExecuteAsync(sql, logMedicionScada);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> InsertarLogProcesoAsync(LogProceso log)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -18,20 +18,5 @@ namespace DAL
|
|||
|
||||
return result.ToList();
|
||||
}
|
||||
|
||||
public static async Task<bool> ActualizarMedicionesAsync(string medicionesJson)
|
||||
{
|
||||
//TODO: ACTUALIZAR REGISTROS
|
||||
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