Primer version lista para demo

develop
Al Garcia 2 years ago
parent debd07084a
commit 39429d2f6d
  1. 11
      Contracts/Operaciones/IOpViajesRepository.cs
  2. 42
      Controllers/Operaciones/OpViajesController.cs
  3. 26
      DTO/Operaciones/DTOOpViajes.cs
  4. 29
      Models/Operaciones/IOpViajes.cs
  5. 5
      Program.cs
  6. 57
      Repository/Operaciones/OpViajesRepository.cs
  7. BIN
      bin/Debug/net6.0/AOLBackend.dll
  8. BIN
      bin/Debug/net6.0/AOLBackend.pdb
  9. 4
      obj/Debug/net6.0/AOLBackend.GeneratedMSBuildEditorConfig.editorconfig
  10. BIN
      obj/Debug/net6.0/AOLBackend.assets.cache
  11. 2
      obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache
  12. BIN
      obj/Debug/net6.0/AOLBackend.dll
  13. BIN
      obj/Debug/net6.0/AOLBackend.pdb
  14. BIN
      obj/Debug/net6.0/ref/AOLBackend.dll
  15. BIN
      obj/Debug/net6.0/refint/AOLBackend.dll
  16. 11
      obj/staticwebassets.pack.sentinel

@ -0,0 +1,11 @@
using AOLBackend.DTO.Operaciones;
namespace AOLBackend.Contracts.Operaciones
{
public interface IOpViajesRepository
{
public Task<DTOOpViajes> Append(DTOOpViajes data);
public Task<IEnumerable<DTOOpViajes>> GetAll();
public Task<Boolean> Delete(int id);
}
}

@ -0,0 +1,42 @@
using AOLBackend.Contracts.Operaciones;
using AOLBackend.DTO.Operaciones;
using Microsoft.AspNetCore.Mvc;
namespace AOLBackend.Controllers.Operaciones
{
[ApiController]
[Route("api/Operaciones/[controller]")]
public class OpViajesController : ControllerBase
{
private readonly IOpViajesRepository _Repo;
public OpViajesController(IOpViajesRepository Repo)
{
_Repo = Repo;
}
[HttpPost]
[Route("Append")]
public async Task<DTOOpViajes> Append([FromBody] DTOOpViajes data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<DTOOpViajes>> 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,26 @@
namespace AOLBackend.DTO.Operaciones
{
public class DTOOpViajes
{
public int id { get; set; } = 0;
public string FAlta { get; set; } = null!;
public int Usuario { get; set; } = 0;
public string FCruce { get; set; } = null!;
public string RefAgenciaAduanal { get; set; } = null!;
public int Cliente { get; set; } = 0;
public string? sCliente { get; set; } = null!;
public int Proveedor { get; set; } = 0;
public string? sProveedor { get; set; } = null!;
public byte Hazmat { get; set; } = 0;
public int Servicio { get; set; } = 0;
public string? sServicio { get; set; } = null!;
public byte TipoUnidad { get; set; } = 0;
public string? sTipoUnidad { get; set; } = null!;
public string NoCaja { get; set; } = null!;
public string PickUpNumber { get; set; } = null!;
public int Origen { get; set; } = 0;
public string? sOrigen { get; set; } = null!;
public int Destino { get; set; } = 0;
public string? sDestino { get; set; } = null!;
}
}

@ -0,0 +1,29 @@
namespace AOLBackend.Models.Operaciones
{
public class IOpViajes
{
public int id { get; set; } = 0;
public string FAlta { get; set; } = null!;
public int Usuario { get; set; } = 0;
public string FCruce { get; set; } = null!;
public string RefAgenciaAduanal { get; set; } = null!;
public int Cliente { get; set; } = 0;
public int Proveedor { get; set; } = 0;
public byte Hazmat { get; set; } = 0;
public byte TipoUnidad { get; set; } = 0;
public string NoCaja { get; set; } = null!;
public string PickUpNumber { get; set; } = null!;
public int Origen { get; set; } = 0;
public int Destino { get; set; } = 0;
public string FacturaProveedor { get; set; } = null!;
public string FacturaAlphaOmega { get; set; } = null!;
public string FPagoFactura { get; set; } = null!;
public byte MetodoPago { get; set; } = 0;
public string FPagoProveedor { get; set; } = null!;
public int NoChequeAOL { get; set; } = 0;
public int FacturarA { get; set; } = 0;
public string FEntrega { get; set; } = null!;
public int Status { get; set; } = 0;
public int Activo { get; set; } = 0;
}
}

@ -1,8 +1,10 @@
using AOLBackend.Context; using AOLBackend.Context;
using AOLBackend.Contracts; using AOLBackend.Contracts;
using AOLBackend.Contracts.Catalogos; using AOLBackend.Contracts.Catalogos;
using AOLBackend.Contracts.Operaciones;
using AOLBackend.Repository; using AOLBackend.Repository;
using AOLBackend.Repository.Catalogos; using AOLBackend.Repository.Catalogos;
using AOLBackend.Repository.Operaciones;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using System.Text; using System.Text;
@ -20,6 +22,9 @@ builder.Services.AddScoped<ICatTipoUnidadRepository, CatTipoUnidadRepository>();
builder.Services.AddScoped<ICatServiciosRepository, CatServiciosRepository>(); builder.Services.AddScoped<ICatServiciosRepository, CatServiciosRepository>();
builder.Services.AddScoped<ICatRutasRepository, CatRutasRepository>(); builder.Services.AddScoped<ICatRutasRepository, CatRutasRepository>();
//Operaciones
builder.Services.AddScoped<IOpViajesRepository, OpViajesRepository>();
builder.Services.AddControllers(); builder.Services.AddControllers();
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options => builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options =>
{ {

@ -0,0 +1,57 @@
using AOLBackend.Context;
using AOLBackend.Contracts.Operaciones;
using AOLBackend.DTO.Operaciones;
using Dapper;
using System.Data;
namespace AOLBackend.Repository.Operaciones
{
public class OpViajesRepository : IOpViajesRepository
{
private readonly DapperContext _context;
private readonly IConfiguration _config;
public OpViajesRepository(DapperContext context, IConfiguration config)
{
_context = context;
_config = config;
}
public async Task<DTOOpViajes> Append(DTOOpViajes data)
{
var query = "[Operaciones.Viajes.Append]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<DTOOpViajes>(query, new
{
@id = data.id,
@Usuario = data.Usuario,
@FCruce = data.FCruce,
@RefAgenciaAduanal = data.RefAgenciaAduanal,
@Cliente = data.Cliente,
@Proveedor = data.Proveedor,
@HazMat = data.Hazmat,
@Servicio = data.Servicio,
@TipoUnidad = data.TipoUnidad,
@NoCaja = data.NoCaja,
@PickUpNumber = data.PickUpNumber,
@Origen = data.Origen,
@Destino = data.Destino
}, commandType: CommandType.StoredProcedure);
return entrada.First();
}
public async Task<IEnumerable<DTOOpViajes>> GetAll()
{
var query = "[Operaciones.Viajes.Get]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<DTOOpViajes>(query, new { }, commandType: CommandType.StoredProcedure);
return entrada;
}
public async Task<Boolean> Delete(int id)
{
var query = "[Operaciones.Viajes.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.

@ -8,9 +8,9 @@ build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = AOLBackend build_property.RootNamespace = AOLBackend
build_property.RootNamespace = AOLBackend build_property.RootNamespace = AOLBackend
build_property.ProjectDir = c:\projects\staging\AOLBackend\ build_property.ProjectDir = C:\projects\staging\AOLBackend\
build_property.RazorLangVersion = 6.0 build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames = build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes = build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = c:\projects\staging\AOLBackend build_property.MSBuildProjectDirectory = C:\projects\staging\AOLBackend
build_property._RazorSourceGeneratorDebug = build_property._RazorSourceGeneratorDebug =

@ -1 +1 @@
2042434c554652c90861df655d8b5f920355c627 ed603f94136a48ae0a4b114ef696f13d8ba5c20a

Binary file not shown.

Binary file not shown.

@ -77,3 +77,14 @@
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
2.0
2.0

Loading…
Cancel
Save