Compare commits

...

4 Commits

  1. 2
      Contracts/Catalogos/ITabuladorRepository.cs
  2. 6
      Controllers/Catalogos/TabuladorController.cs
  3. 3
      Models/Catalogos/Tabulador.cs
  4. 1
      Models/Catalogos/TabuladorDetalle.cs
  5. 1
      Models/Corresponsales/IPrecuenta.cs
  6. 1
      Repository/Catalogos/TabuladorDetalleRepository.cs
  7. 8
      Repository/Catalogos/TabuladorRepository.cs

@ -3,7 +3,7 @@ namespace CORRESPONSALBackend.Contracts.Catalogos
{
public interface ITabuladorRepository
{
public Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente);
public Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente, int? idCorresponsal);
public Task<Tabulador> Append(Tabulador data);
public Task Delete(int id);
}

@ -22,16 +22,16 @@ namespace CORRESPONSALBackend.Controllers.Catalogos
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente)
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente, int? idCorresponsal)
{
return await _Repo.GetAll(id, IdCliente);
return await _Repo.GetAll(id, IdCliente, idCorresponsal);
}
[HttpGet]
[Route("getByCustomer")]
public async Task<IEnumerable<Tabulador>> GetByCustomer(int IdCliente)
{
return await _Repo.GetAll(0, IdCliente);
return await _Repo.GetAll(0, IdCliente, 0);
}

@ -6,5 +6,8 @@
public string Nombre { set; get; } = null!;
public int IdCliente { set; get; } = 0;
public Boolean Activo { set; get; } = true;
public int? IdCorresponsal {get;set;} = null;
public int? Tipo {get; set;} = 0;
public int? Moneda {get; set;} = 0;
}
}

@ -8,5 +8,6 @@
public string? Concepto { set; get; } = null!;
public double Costo { set; get; } = 0;
public int Activo { set; get; } = 0;
public double CostoCorresponsal { set; get; } = 0;
}
}

@ -9,5 +9,6 @@
public string Concepto { get; set; } = null!;
public double Costo { get; set; } = 0;
public byte Activo { get; set; } = 0;
public double CostoCorresponsal {get; set;} = 0;
}
}

@ -21,6 +21,7 @@ namespace CORRESPONSALBackend.Repository.Catalogos
data.IdTabulador,
data.IdConcepto,
data.Costo,
data.CostoCorresponsal
},
commandType: CommandType.StoredProcedure);
return entrada;

@ -12,14 +12,15 @@ namespace CORRESPONSALBackend.Repository.Catalogos
private readonly DapperContext _context;
public TabuladorRepository(DapperContext context) { _context = context; }
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente)
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente, int? idCorresponsal)
{
var query = "[Catalogo.Tabulador.Get]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<Tabulador>(query, new
{
@id = id,
@IdCliente = IdCliente
@IdCliente = IdCliente,
@IdCorresponsal = idCorresponsal
},
commandType: CommandType.StoredProcedure);
return entrada;
@ -35,6 +36,9 @@ namespace CORRESPONSALBackend.Repository.Catalogos
data.id,
data.Nombre,
data.IdCliente,
data.IdCorresponsal,
data.Tipo,
data.Moneda
},
commandType: CommandType.StoredProcedure);
return entrada.First();

Loading…
Cancel
Save