feat: ajustes para las mediciones
This commit is contained in:
parent
7bc8400980
commit
747391eade
5 changed files with 133 additions and 36 deletions
|
@ -18,5 +18,37 @@ namespace DAL
|
|||
|
||||
return result.ToList();
|
||||
}
|
||||
|
||||
public async Task<List<DatoDGATemporal>> ObtenerMedicionesPorLoteAsync(int pageNumber)
|
||||
{
|
||||
var nroPagina = new DynamicParameters();
|
||||
nroPagina.Add("@PageNumber", pageNumber);
|
||||
|
||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||
|
||||
var resultado = await connection.QueryAsync<DatoDGATemporal>(
|
||||
"SP_OBTENER_LOTE_DGA_DATOS",
|
||||
nroPagina,
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return resultado.ToList();
|
||||
}
|
||||
|
||||
public async Task<bool> GuardarMedicionesEnviadasAsync(List<int> medicionesGuardadas)
|
||||
{
|
||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||
try
|
||||
{
|
||||
var query = @"UPDATE DGA_DATOS SET ENVIADO = 1 WHERE ID IN @Ids";
|
||||
|
||||
await connection.ExecuteAsync(query, new { Ids = medicionesGuardadas });
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex) {
|
||||
|
||||
throw new Exception($"Error {ex.Message}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue