diff --git a/Contracts/Operaciones/IOpViajesRepository.cs b/Contracts/Operaciones/IOpViajesRepository.cs index 81d6151..fd6ed57 100644 --- a/Contracts/Operaciones/IOpViajesRepository.cs +++ b/Contracts/Operaciones/IOpViajesRepository.cs @@ -10,6 +10,7 @@ namespace AOLBackend.Contracts.Operaciones public Task> GetAllServices(); public Task GetLastTrailerBox(int idViaje); public Task> GetStatusSecuence(); + public Task ChangeTripStatus(DTOChangeTripStatus data); public Task Delete(int id); public Task DeleteService(int id); } diff --git a/Controllers/Operaciones/OpViajesController.cs b/Controllers/Operaciones/OpViajesController.cs index 876c550..2ee823e 100644 --- a/Controllers/Operaciones/OpViajesController.cs +++ b/Controllers/Operaciones/OpViajesController.cs @@ -63,6 +63,12 @@ namespace AOLBackend.Controllers.Operaciones return entrada; } + [HttpPut("ChangeTripStatus/{id}")] + public async Task Update2(int id, [FromBody] DTOChangeTripStatus data) + { + var entrada = await _Repo.ChangeTripStatus(data); + return entrada; + } [HttpDelete("Delete/{id}")] public async Task Delete(int id) diff --git a/DTO/Operaciones/DTOChangeTripStatus.cs b/DTO/Operaciones/DTOChangeTripStatus.cs new file mode 100644 index 0000000..c422c58 --- /dev/null +++ b/DTO/Operaciones/DTOChangeTripStatus.cs @@ -0,0 +1,8 @@ +namespace AOLBackend.DTO.Operaciones +{ + public class DTOChangeTripStatus + { + public int IdViaje { get; set; } = 0; + public int IdEstatus { get; set; } = 0; + } +} \ No newline at end of file diff --git a/DTO/Operaciones/DTOResultTripStatus.cs b/DTO/Operaciones/DTOResultTripStatus.cs new file mode 100644 index 0000000..877ec50 --- /dev/null +++ b/DTO/Operaciones/DTOResultTripStatus.cs @@ -0,0 +1,8 @@ +namespace AOLBackend.DTO.Operaciones +{ + public class DTOResultTripStatus + { + public int IdViaje { get; set; } = 0; + public int Secuencia { get; set; } = 0; + } +} \ No newline at end of file diff --git a/Repository/Operaciones/OpViajesRepository.cs b/Repository/Operaciones/OpViajesRepository.cs index e8a1e6c..6940153 100644 --- a/Repository/Operaciones/OpViajesRepository.cs +++ b/Repository/Operaciones/OpViajesRepository.cs @@ -82,6 +82,17 @@ namespace AOLBackend.Repository.Operaciones var entrada = await connection.QueryAsync(query, new { }, commandType: CommandType.StoredProcedure); return entrada; } + public async Task ChangeTripStatus(DTOChangeTripStatus data) + { + var query = "[Operaciones.Viajes.ChangeStatus]"; + using var connection = _context.CreateConnection(); + var entrada = await connection.QueryAsync(query, new + { + @IdViaje = data.IdViaje, + @Secuencia = data.IdEstatus + }, commandType: CommandType.StoredProcedure); + return entrada.First(); + } public async Task Delete(int id) { var query = "[Operaciones.Viajes.Delete]"; diff --git a/bin/Debug/net6.0/AOLBackend.dll b/bin/Debug/net6.0/AOLBackend.dll index 379d0a0..2fc9be0 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 eb1c434..467e473 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 103c71e..5d32c31 100644 --- a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -426ec8bbce8e97d6039a98b067cc59727cdd5187 +eefe8f67b06397f0ffbb2eddb23dd69eb10fac57 diff --git a/obj/Debug/net6.0/AOLBackend.dll b/obj/Debug/net6.0/AOLBackend.dll index 379d0a0..2fc9be0 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 eb1c434..467e473 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 0a7e121..a32324f 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 0a7e121..a32324f 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 4350bdc..dc5bd2e 100644 --- a/obj/staticwebassets.pack.sentinel +++ b/obj/staticwebassets.pack.sentinel @@ -130,3 +130,15 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0