Master Detail del monitor de viajes quedo de lujo

develop
Al Garcia 2 years ago
parent b9be1d974a
commit 6f548d6fa1
  1. 3
      Contracts/Operaciones/IOpViajesRepository.cs
  2. 23
      Controllers/Operaciones/OpViajesController.cs
  3. 2
      DTO/Operaciones/DTOOpViajesServicios.cs
  4. 20
      Repository/Operaciones/OpViajesRepository.cs
  5. BIN
      bin/Debug/net6.0/AOLBackend.dll
  6. BIN
      bin/Debug/net6.0/AOLBackend.pdb
  7. 2
      obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache
  8. BIN
      obj/Debug/net6.0/AOLBackend.dll
  9. BIN
      obj/Debug/net6.0/AOLBackend.pdb
  10. BIN
      obj/Debug/net6.0/ref/AOLBackend.dll
  11. BIN
      obj/Debug/net6.0/refint/AOLBackend.dll
  12. 8
      obj/staticwebassets.pack.sentinel

@ -5,7 +5,10 @@ namespace AOLBackend.Contracts.Operaciones
public interface IOpViajesRepository
{
public Task<DTOOpViajes> Append(DTOOpViajes data);
public Task<IEnumerable<DTOOpViajesServicios>> AppendServicio(DTOOpViajesServicios data);
public Task<IEnumerable<DTOOpViajes>> GetAll();
public Task<IEnumerable<DTOOpViajesServicios>> GetAllServices();
public Task<Boolean> Delete(int id);
public Task<Boolean> DeleteService(int id);
}
}

@ -23,6 +23,14 @@ namespace AOLBackend.Controllers.Operaciones
return entrada;
}
[HttpPost]
[Route("AppendService")]
public async Task<IEnumerable<DTOOpViajesServicios>> Append([FromBody] DTOOpViajesServicios data)
{
var entrada = await _Repo.AppendServicio(data);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<DTOOpViajes>> GetAll()
@ -31,6 +39,14 @@ namespace AOLBackend.Controllers.Operaciones
return entrada;
}
[HttpGet]
[Route("GetAllServices")]
public async Task<IEnumerable<DTOOpViajesServicios>> GetAllServices()
{
var entrada = await _Repo.GetAllServices();
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> 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<IActionResult> DeleteService(int id)
{
await _Repo.DeleteService(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -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;
}
}

@ -39,6 +39,19 @@ namespace AOLBackend.Repository.Operaciones
}, commandType: CommandType.StoredProcedure);
return entrada.First();
}
public async Task<IEnumerable<DTOOpViajesServicios>> AppendServicio(DTOOpViajesServicios data)
{
var query = "[Operaciones.Viajes.Servicios.Append]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<DTOOpViajesServicios>(query, new
{
@id = data.id,
@IdViaje = data.IdViaje,
@IdServicio = data.IdServicio
}, commandType: CommandType.StoredProcedure);
return entrada.ToList();
}
public async Task<IEnumerable<DTOOpViajes>> GetAll()
{
var query = "[Operaciones.Viajes.Get]";
@ -60,5 +73,12 @@ namespace AOLBackend.Repository.Operaciones
var entrada = await connection.QueryAsync<DTOOpViajes>(query, new { @id }, commandType: CommandType.StoredProcedure);
return true;
}
public async Task<Boolean> DeleteService(int id)
{
var query = "[Operaciones.Viajes.Servicios.Delete]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<DTOOpViajes>(query, new { @id }, commandType: CommandType.StoredProcedure);
return true;
}
}
}

Binary file not shown.

Binary file not shown.

@ -1 +1 @@
ed603f94136a48ae0a4b114ef696f13d8ba5c20a
e348d4166e48aebdcd2c8d25447e64abd2cc26a9

Binary file not shown.

Binary file not shown.

@ -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

Loading…
Cancel
Save