cambios
This commit is contained in:
parent
e5341cfcff
commit
d228cf71dd
3 changed files with 7 additions and 19 deletions
|
@ -38,10 +38,11 @@ namespace BLL.Recuperacion_DGA
|
||||||
var logsEnviados = new List<LogMedicionEnvio>();
|
var logsEnviados = new List<LogMedicionEnvio>();
|
||||||
|
|
||||||
var pageNumber = 1;
|
var pageNumber = 1;
|
||||||
|
var fechaInicio = DateTime.UtcNow;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var mediciones = await _dGAMedicionRepository.ObtenerMedicionesPorLoteAsync(pageNumber);
|
var mediciones = await _dGAMedicionRepository.ObtenerMedicionesPorLoteAsync(pageNumber, fechaInicio);
|
||||||
|
|
||||||
if (mediciones == null || mediciones.Count == 0)
|
if (mediciones == null || mediciones.Count == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,27 +8,16 @@ namespace DAL
|
||||||
{
|
{
|
||||||
public class MedicionDGARepository
|
public class MedicionDGARepository
|
||||||
{
|
{
|
||||||
public async Task<List<DatoDGA>> ObtenerMedicionesAsync()
|
public async Task<List<DatoDGATemporal>> ObtenerMedicionesPorLoteAsync(int pageNumber, DateTime fecha)
|
||||||
{
|
{
|
||||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
var parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@PageNumber", pageNumber);
|
||||||
var result = await connection.QueryAsync<DatoDGA>(
|
parameters.Add("@FechaInicio", fecha);
|
||||||
"SP_OBTENER_DGA_DATOS",
|
|
||||||
commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
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);
|
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||||
|
|
||||||
var resultado = await connection.QueryAsync<DatoDGATemporal>(
|
var resultado = await connection.QueryAsync<DatoDGATemporal>(
|
||||||
"SP_OBTENER_LOTE_DGA_DATOS",
|
"SP_OBTENER_LOTE_DGA_DATOS",
|
||||||
nroPagina,
|
parameters,
|
||||||
commandType: CommandType.StoredProcedure);
|
commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
return resultado.ToList();
|
return resultado.ToList();
|
||||||
|
|
|
@ -20,7 +20,5 @@
|
||||||
public string? HoraMedicion { get; set; }
|
public string? HoraMedicion { get; set; }
|
||||||
public string? NivelFreaticoDelPozo { get; set; }
|
public string? NivelFreaticoDelPozo { get; set; }
|
||||||
public string? Totalizador { get; set; }
|
public string? Totalizador { get; set; }
|
||||||
public string? TipoEmpresa { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue