diff --git a/Contracts/Operaciones/IOpViajesRepository.cs b/Contracts/Operaciones/IOpViajesRepository.cs index d82061b..ad085eb 100644 --- a/Contracts/Operaciones/IOpViajesRepository.cs +++ b/Contracts/Operaciones/IOpViajesRepository.cs @@ -5,7 +5,10 @@ namespace AOLBackend.Contracts.Operaciones public interface IOpViajesRepository { public Task Append(DTOOpViajes data); + public Task> AppendServicio(DTOOpViajesServicios data); public Task> GetAll(); + public Task> GetAllServices(); public Task Delete(int id); + public Task DeleteService(int id); } } \ No newline at end of file diff --git a/Controllers/Operaciones/OpViajesController.cs b/Controllers/Operaciones/OpViajesController.cs index d792c5f..60f75c1 100644 --- a/Controllers/Operaciones/OpViajesController.cs +++ b/Controllers/Operaciones/OpViajesController.cs @@ -23,6 +23,14 @@ namespace AOLBackend.Controllers.Operaciones return entrada; } + [HttpPost] + [Route("AppendService")] + public async Task> Append([FromBody] DTOOpViajesServicios data) + { + var entrada = await _Repo.AppendServicio(data); + return entrada; + } + [HttpGet] [Route("Get")] public async Task> GetAll() @@ -31,6 +39,14 @@ namespace AOLBackend.Controllers.Operaciones return entrada; } + [HttpGet] + [Route("GetAllServices")] + public async Task> GetAllServices() + { + var entrada = await _Repo.GetAllServices(); + return entrada; + } + [HttpDelete("Delete/{id}")] public async Task Delete(int id) { @@ -38,5 +54,12 @@ namespace AOLBackend.Controllers.Operaciones return new OkObjectResult(new { respuesta = "Se elimino el registro" }); } + [HttpDelete("DeleteService/{id}")] + public async Task DeleteService(int id) + { + await _Repo.DeleteService(id); + return new OkObjectResult(new { respuesta = "Se elimino el registro" }); + } + } } \ No newline at end of file diff --git a/DTO/Operaciones/DTOOpViajesServicios.cs b/DTO/Operaciones/DTOOpViajesServicios.cs index e589e2d..17c44c6 100644 --- a/DTO/Operaciones/DTOOpViajesServicios.cs +++ b/DTO/Operaciones/DTOOpViajesServicios.cs @@ -5,7 +5,7 @@ namespace AOLBackend.DTO.Operaciones public int id { get; set; } = 0; public int IdViaje { get; set; } = 0; public int IdServicio { get; set; } = 0; - public string Servicio { get; set; } = null!; + public string? sServicio { get; set; } = null!; public byte Activo { get; set; } = 1; } } \ No newline at end of file diff --git a/Repository/Operaciones/OpViajesRepository.cs b/Repository/Operaciones/OpViajesRepository.cs index 67bc9c2..b81e5f9 100644 --- a/Repository/Operaciones/OpViajesRepository.cs +++ b/Repository/Operaciones/OpViajesRepository.cs @@ -39,6 +39,19 @@ namespace AOLBackend.Repository.Operaciones }, commandType: CommandType.StoredProcedure); return entrada.First(); } + + public async Task> AppendServicio(DTOOpViajesServicios data) + { + var query = "[Operaciones.Viajes.Servicios.Append]"; + using var connection = _context.CreateConnection(); + var entrada = await connection.QueryAsync(query, new + { + @id = data.id, + @IdViaje = data.IdViaje, + @IdServicio = data.IdServicio + }, commandType: CommandType.StoredProcedure); + return entrada.ToList(); + } public async Task> GetAll() { var query = "[Operaciones.Viajes.Get]"; @@ -60,5 +73,12 @@ namespace AOLBackend.Repository.Operaciones var entrada = await connection.QueryAsync(query, new { @id }, commandType: CommandType.StoredProcedure); return true; } + public async Task DeleteService(int id) + { + var query = "[Operaciones.Viajes.Servicios.Delete]"; + using var connection = _context.CreateConnection(); + var entrada = await connection.QueryAsync(query, new { @id }, commandType: CommandType.StoredProcedure); + return true; + } } } \ No newline at end of file diff --git a/bin/Debug/net6.0/AOLBackend.dll b/bin/Debug/net6.0/AOLBackend.dll index e67d91c..274dd30 100644 Binary files a/bin/Debug/net6.0/AOLBackend.dll and b/bin/Debug/net6.0/AOLBackend.dll differ diff --git a/bin/Debug/net6.0/AOLBackend.pdb b/bin/Debug/net6.0/AOLBackend.pdb index efcfa81..82f1fee 100644 Binary files a/bin/Debug/net6.0/AOLBackend.pdb and b/bin/Debug/net6.0/AOLBackend.pdb differ diff --git a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache index 636d313..18857be 100644 --- a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -ed603f94136a48ae0a4b114ef696f13d8ba5c20a +e348d4166e48aebdcd2c8d25447e64abd2cc26a9 diff --git a/obj/Debug/net6.0/AOLBackend.dll b/obj/Debug/net6.0/AOLBackend.dll index e67d91c..274dd30 100644 Binary files a/obj/Debug/net6.0/AOLBackend.dll and b/obj/Debug/net6.0/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/AOLBackend.pdb b/obj/Debug/net6.0/AOLBackend.pdb index efcfa81..82f1fee 100644 Binary files a/obj/Debug/net6.0/AOLBackend.pdb and b/obj/Debug/net6.0/AOLBackend.pdb differ diff --git a/obj/Debug/net6.0/ref/AOLBackend.dll b/obj/Debug/net6.0/ref/AOLBackend.dll index 72846f9..b9077da 100644 Binary files a/obj/Debug/net6.0/ref/AOLBackend.dll and b/obj/Debug/net6.0/ref/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/refint/AOLBackend.dll b/obj/Debug/net6.0/refint/AOLBackend.dll index 72846f9..b9077da 100644 Binary files a/obj/Debug/net6.0/refint/AOLBackend.dll and b/obj/Debug/net6.0/refint/AOLBackend.dll differ diff --git a/obj/staticwebassets.pack.sentinel b/obj/staticwebassets.pack.sentinel index 6fbca2a..3c442d4 100644 --- a/obj/staticwebassets.pack.sentinel +++ b/obj/staticwebassets.pack.sentinel @@ -94,3 +94,11 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0