parent
a14c5fd212
commit
616956b19b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,12 @@ |
|||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
|
||||||
|
namespace AOLBackend.Contracts.Catalogos |
||||||
|
{ |
||||||
|
public interface ICatProveedoresRepository |
||||||
|
{ |
||||||
|
public Task<ICatProveedores> Append(ICatProveedores data); |
||||||
|
public Task<IEnumerable<ICatProveedores>> GetAll(); |
||||||
|
public Task<Boolean> Delete(int id); |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
|
||||||
|
namespace AOLBackend.Contracts.Catalogos |
||||||
|
{ |
||||||
|
public interface ICatTipoUnidadRepository |
||||||
|
{ |
||||||
|
public Task<ICatTipoUnidad> Append(ICatTipoUnidad data); |
||||||
|
public Task<IEnumerable<ICatTipoUnidad>> GetAll(); |
||||||
|
public Task<Boolean> Delete(int id); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
|
||||||
|
namespace AOLBackend.Contracts.Catalogos |
||||||
|
{ |
||||||
|
public interface ICatUbicacionesRepository |
||||||
|
{ |
||||||
|
public Task<ICatUbicaciones> Append(ICatUbicaciones data); |
||||||
|
public Task<IEnumerable<ICatUbicaciones>> GetAll(); |
||||||
|
public Task<Boolean> Delete(int id); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
using AOLBackend.Contracts.Catalogos; |
||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
using Microsoft.AspNetCore.Mvc; |
||||||
|
|
||||||
|
namespace AOLBackend.Controllers.Catalogos |
||||||
|
{ |
||||||
|
[ApiController] |
||||||
|
[Route("api/Catalogos/[controller]")]
|
||||||
|
public class CatProveedoresController : ControllerBase |
||||||
|
{ |
||||||
|
private readonly ICatProveedoresRepository _Repo; |
||||||
|
|
||||||
|
public CatProveedoresController(ICatProveedoresRepository Repo) |
||||||
|
{ |
||||||
|
_Repo = Repo; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpPost] |
||||||
|
[Route("Append")] |
||||||
|
public async Task<ICatProveedores> Append([FromBody] ICatProveedores data) |
||||||
|
{ |
||||||
|
var entrada = await _Repo.Append(data); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpGet] |
||||||
|
[Route("Get")] |
||||||
|
public async Task<IEnumerable<ICatProveedores>> GetAll() |
||||||
|
{ |
||||||
|
var entrada = await _Repo.GetAll(); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpDelete("Delete/{id}")] |
||||||
|
public async Task<IActionResult> Delete(int id) |
||||||
|
{ |
||||||
|
await _Repo.Delete(id); |
||||||
|
return new OkObjectResult(new { respuesta = "Se elimino el registro" }); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
using AOLBackend.Contracts.Catalogos; |
||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
using Microsoft.AspNetCore.Mvc; |
||||||
|
|
||||||
|
namespace AOLBackend.Controllers.Catalogos |
||||||
|
{ |
||||||
|
[ApiController] |
||||||
|
[Route("api/Catalogos/[controller]")]
|
||||||
|
public class CatTipoUnidadController : ControllerBase |
||||||
|
{ |
||||||
|
private readonly ICatTipoUnidadRepository _Repo; |
||||||
|
public CatTipoUnidadController(ICatTipoUnidadRepository Repo) |
||||||
|
{ |
||||||
|
_Repo = Repo; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpPost] |
||||||
|
[Route("Append")] |
||||||
|
public async Task<ICatTipoUnidad> Append([FromBody] ICatTipoUnidad data) |
||||||
|
{ |
||||||
|
var entrada = await _Repo.Append(data); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpGet] |
||||||
|
[Route("Get")] |
||||||
|
public async Task<IEnumerable<ICatTipoUnidad>> GetAll() |
||||||
|
{ |
||||||
|
var entrada = await _Repo.GetAll(); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpDelete("Delete/{id}")] |
||||||
|
public async Task<IActionResult> Delete(int id) |
||||||
|
{ |
||||||
|
await _Repo.Delete(id); |
||||||
|
return new OkObjectResult(new { respuesta = "Se elimino el registro" }); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
using AOLBackend.Contracts.Catalogos; |
||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
using Microsoft.AspNetCore.Mvc; |
||||||
|
|
||||||
|
|
||||||
|
namespace AOLBackend.Controllers.Catalogos |
||||||
|
{ |
||||||
|
[ApiController] |
||||||
|
[Route("api/Catalogos/[controller]")]
|
||||||
|
public class CatUbicacionesController : ControllerBase |
||||||
|
{ |
||||||
|
private readonly ICatUbicacionesRepository _Repo; |
||||||
|
public CatUbicacionesController(ICatUbicacionesRepository Repo) |
||||||
|
{ |
||||||
|
_Repo = Repo; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpPost] |
||||||
|
[Route("Append")] |
||||||
|
public async Task<ICatUbicaciones> Append([FromBody] ICatUbicaciones data) |
||||||
|
{ |
||||||
|
var entrada = await _Repo.Append(data); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpGet] |
||||||
|
[Route("Get")] |
||||||
|
public async Task<IEnumerable<ICatUbicaciones>> GetAll() |
||||||
|
{ |
||||||
|
var entrada = await _Repo.GetAll(); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
[HttpDelete("Delete/{id}")] |
||||||
|
public async Task<IActionResult> Delete(int id) |
||||||
|
{ |
||||||
|
await _Repo.Delete(id); |
||||||
|
return new OkObjectResult(new { respuesta = "Se elimino el registro" }); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
namespace AOLBackend.Models.Catalogos |
||||||
|
{ |
||||||
|
public class ICatTipoUnidad |
||||||
|
{ |
||||||
|
public int id { get; set; } = 0!; |
||||||
|
public string TipoUnidad { get; set; } = null!; |
||||||
|
public Byte Activo { get; set; } = 0!; |
||||||
|
} |
||||||
|
} |
@ -1,8 +1,8 @@ |
|||||||
namespace AOLBackend.Models.Catalogos |
namespace AOLBackend.Models.Catalogos |
||||||
{ |
{ |
||||||
public class IOrigenDestino |
public class ICatUbicaciones |
||||||
{ |
{ |
||||||
public int Id { get; set; } |
public int id { get; set; } |
||||||
public string Ubicacion { get; set; } = null!; |
public string Ubicacion { get; set; } = null!; |
||||||
public Byte Activo { get; set; } = 0!; |
public Byte Activo { get; set; } = 0!; |
||||||
} |
} |
@ -0,0 +1,46 @@ |
|||||||
|
using AOLBackend.Context; |
||||||
|
using AOLBackend.Contracts.Catalogos; |
||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
using Dapper; |
||||||
|
using System.Data; |
||||||
|
|
||||||
|
namespace AOLBackend.Repository.Catalogos |
||||||
|
{ |
||||||
|
public class CatProveedoresRepository : ICatProveedoresRepository |
||||||
|
{ |
||||||
|
private readonly DapperContext _context; |
||||||
|
private readonly IConfiguration _config; |
||||||
|
public CatProveedoresRepository(DapperContext context, IConfiguration config) |
||||||
|
{ |
||||||
|
_context = context; |
||||||
|
_config = config; |
||||||
|
} |
||||||
|
|
||||||
|
public async Task<ICatProveedores> Append(ICatProveedores data) |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatProveedores.Append]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatProveedores>(query, new |
||||||
|
{ |
||||||
|
@id = data.id, |
||||||
|
@Proveedor = data.Proveedor, |
||||||
|
}, commandType: CommandType.StoredProcedure); |
||||||
|
return entrada.First(); |
||||||
|
} |
||||||
|
public async Task<IEnumerable<ICatProveedores>> GetAll() |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatProveedores.Get]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatProveedores>(query, new { }, commandType: CommandType.StoredProcedure); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
public async Task<Boolean> Delete(int id) |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatProveedores.Delete]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatProveedores>(query, new { @id }, commandType: CommandType.StoredProcedure); |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
using AOLBackend.Context; |
||||||
|
using AOLBackend.Contracts.Catalogos; |
||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
using Dapper; |
||||||
|
using System.Data; |
||||||
|
|
||||||
|
namespace AOLBackend.Repository.Catalogos |
||||||
|
{ |
||||||
|
public class CatTipoUnidadRepository : ICatTipoUnidadRepository |
||||||
|
{ |
||||||
|
private readonly DapperContext _context; |
||||||
|
private readonly IConfiguration _config; |
||||||
|
public CatTipoUnidadRepository(DapperContext context, IConfiguration config) |
||||||
|
{ |
||||||
|
_context = context; |
||||||
|
_config = config; |
||||||
|
} |
||||||
|
|
||||||
|
public async Task<ICatTipoUnidad> Append(ICatTipoUnidad data) |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatTipoUnidad.Append]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatTipoUnidad>(query, new |
||||||
|
{ |
||||||
|
@id = data.id, |
||||||
|
@TipoUnidad = data.TipoUnidad, |
||||||
|
}, commandType: CommandType.StoredProcedure); |
||||||
|
return entrada.First(); |
||||||
|
} |
||||||
|
public async Task<IEnumerable<ICatTipoUnidad>> GetAll() |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatTipoUnidad.Get]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatTipoUnidad>(query, new { }, commandType: CommandType.StoredProcedure); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
public async Task<Boolean> Delete(int id) |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatTipoUnidad.Delete]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatTipoUnidad>(query, new { @id }, commandType: CommandType.StoredProcedure); |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,47 @@ |
|||||||
|
using AOLBackend.Context; |
||||||
|
using AOLBackend.Contracts.Catalogos; |
||||||
|
using AOLBackend.Models.Catalogos; |
||||||
|
using Dapper; |
||||||
|
using System.Data; |
||||||
|
|
||||||
|
namespace AOLBackend.Repository.Catalogos |
||||||
|
{ |
||||||
|
public class CatUbicacionesRepository : ICatUbicacionesRepository |
||||||
|
{ |
||||||
|
private readonly DapperContext _context; |
||||||
|
private readonly IConfiguration _config; |
||||||
|
public CatUbicacionesRepository(DapperContext context, IConfiguration config) |
||||||
|
{ |
||||||
|
_context = context; |
||||||
|
_config = config; |
||||||
|
} |
||||||
|
|
||||||
|
public async Task<ICatUbicaciones> Append(ICatUbicaciones data) |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatUbicaciones.Append]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatUbicaciones>(query, new |
||||||
|
{ |
||||||
|
@id = data.id, |
||||||
|
@Ubicacion = data.Ubicacion, |
||||||
|
}, commandType: CommandType.StoredProcedure); |
||||||
|
return entrada.First(); |
||||||
|
} |
||||||
|
public async Task<IEnumerable<ICatUbicaciones>> GetAll() |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatUbicaciones.Get]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatUbicaciones>(query, new { }, commandType: CommandType.StoredProcedure); |
||||||
|
return entrada; |
||||||
|
} |
||||||
|
|
||||||
|
public async Task<Boolean> Delete(int id) |
||||||
|
{ |
||||||
|
var query = "[Catalogo.CatUbicaciones.Delete]"; |
||||||
|
using var connection = _context.CreateConnection(); |
||||||
|
var entrada = await connection.QueryAsync<ICatUbicaciones>(query, new { @id }, commandType: CommandType.StoredProcedure); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
Binary file not shown.
Binary file not shown.
@ -1 +1 @@ |
|||||||
5c4d83d23e299243135bbd3e0f354dc85d91df62 |
4d7d0b7fb49ca16452b034f5986c30e9a38fc20a |
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue