Commit inicial: ITCA_API_SAP_WMS (.NET Core 3.1)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
2b82744eb8
168 files changed
+11066
No files matched your search
@@ -0,0 +1,49 @@
|
||||
using Net.Data.ServicesLayer;
|
||||
using Net.Data.ServicesLayer.CreditNotes;
|
||||
using Net.Data.Authenticate;
|
||||
using Net.Data.ServicesLayer.ReturnRequest;
|
||||
using Net.Data.ServicesLayer.StockTransfer;
|
||||
using Net.Data.ServicesLayer.InventoryGenEntries;
|
||||
using Net.Data.WMS.Items;
|
||||
using Net.Data.WMS.Recibo;
|
||||
using Net.Data.WMS.Picking;
|
||||
using Net.Data.WMS.SolicitudTransferencia;
|
||||
using Net.Data.WMS.Transferencia;
|
||||
using Net.Data.WMS.Inventario;
|
||||
using Net.Data.ServicesLayer.InventoryGenExits;
|
||||
using Net.Data.ServicesLayer.HR;
|
||||
using Net.Data.ServicesLayer.GlobalData;
|
||||
|
||||
namespace Net.Data
|
||||
{
|
||||
public interface IRepositoryWrapper
|
||||
{
|
||||
#region WMS
|
||||
IReciboRepository Recibo { get; }
|
||||
IInventarioRepository Inventario { get; }
|
||||
ITransferenciaRepository Transferencia { get; }
|
||||
IPickingRepository Picking { get; }
|
||||
ISolicitudTransferenciaRepository SolicitudTransferencia { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region SAP (SERVICES LAYER)
|
||||
IBusinessPartnersRepository BusinessPartners { get; }
|
||||
ICreditNotesRepository CreditNotes { get; }
|
||||
IPurchaseInvoicesRepository PurchaseInvoices { get; }
|
||||
IInvoiceRepository InvoiceRepository { get; }
|
||||
IPurchaseDeliveryNotesRepository PurchaseDeliveryNotes { get; }
|
||||
IPurchaseOrdersRepository PurchaseOrders { get; }
|
||||
IAuthenticateRepository Authenticate { get; }
|
||||
IItemsRepository Items { get; }
|
||||
IReturnRequestRepository ReturnRequest { get; }
|
||||
IStockTransferRepository StockTransfer { get; }
|
||||
IInventoryGenEntriesRepository InventoryGenEntries { get; }
|
||||
IInventoryGenExitsRepository InventoryGenExits { get; }
|
||||
IHRRepository HR { get; }
|
||||
IGlobalDataRepository GlobalData { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Net.Connection;
|
||||
using Net.CrossCotting;
|
||||
using Net.Data.Authenticate;
|
||||
using Net.Data.ServicesLayer;
|
||||
using Net.Data.ServicesLayer.CreditNotes;
|
||||
using Net.Data.ServicesLayer.GlobalData;
|
||||
using Net.Data.ServicesLayer.HR;
|
||||
using Net.Data.ServicesLayer.InventoryGenEntries;
|
||||
using Net.Data.ServicesLayer.InventoryGenExits;
|
||||
using Net.Data.ServicesLayer.ReturnRequest;
|
||||
using Net.Data.ServicesLayer.StockTransfer;
|
||||
using Net.Data.WMS.Inventario;
|
||||
using Net.Data.WMS.Items;
|
||||
using Net.Data.WMS.Picking;
|
||||
using Net.Data.WMS.Recibo;
|
||||
using Net.Data.WMS.SolicitudTransferencia;
|
||||
using Net.Data.WMS.Transferencia;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace Net.Data
|
||||
{
|
||||
public class RepositoryWrapper : IRepositoryWrapper
|
||||
{
|
||||
#region Variables de conexion
|
||||
private string _conSQL;
|
||||
//private string _conSAPSQL;
|
||||
|
||||
private readonly string _entorno;
|
||||
private readonly string _Source;
|
||||
private readonly string _Catalog;
|
||||
private readonly string _User;
|
||||
private readonly string _Password;
|
||||
#endregion
|
||||
|
||||
private IConnectionSQL _repoContext;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
|
||||
#region WMS
|
||||
|
||||
private IReciboRepository _Recibo;
|
||||
private ITransferenciaRepository _Transferencia;
|
||||
private IStockTransferRepository _StockTransfer;
|
||||
private IPickingRepository _Picking;
|
||||
private IInventarioRepository _Inventario;
|
||||
private ISolicitudTransferenciaRepository _SolicitudTransferencia;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SAP (SERVICES LAYER)
|
||||
|
||||
private IBusinessPartnersRepository _BusinessPartners;
|
||||
private IPurchaseInvoicesRepository _PurchaseInvoices;
|
||||
private IInvoiceRepository _Invoice;
|
||||
private ICreditNotesRepository _CreditNotes;
|
||||
private IAuthenticateRepository _AuthenticateRepository;
|
||||
private IPurchaseDeliveryNotesRepository _PurchaseDeliveryNotes;
|
||||
private IPurchaseOrdersRepository _PurchaseOrders;
|
||||
private IItemsRepository _Items;
|
||||
private IReturnRequestRepository _ReturnRequest;
|
||||
private IInventoryGenEntriesRepository _InventoryGenEntries;
|
||||
private IInventoryGenExitsRepository _InventoryGenExits;
|
||||
private IHRRepository _HR;
|
||||
private IGlobalDataRepository _GlobalData;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public RepositoryWrapper(IConnectionSQL repoContext, IConfiguration configuration, IHttpClientFactory clientFactory, IServiceProvider serviceProvider)
|
||||
{
|
||||
_repoContext = repoContext;
|
||||
_configuration = configuration;
|
||||
_clientFactory = clientFactory;
|
||||
|
||||
#region Conexion CORS
|
||||
_conSQL = configuration.GetConnectionString("cnnSql");
|
||||
|
||||
/*Obtenemos que ambiente realizaremos la conexión*/
|
||||
_entorno = configuration["EntornoConection:Entorno"];
|
||||
_Source = EncriptaHelper.DecryptStringAES(configuration[string.Format("{0}:Source", _entorno)]);
|
||||
_Catalog = EncriptaHelper.DecryptStringAES(configuration[string.Format("{0}:Catalog", _entorno)]);
|
||||
_User = EncriptaHelper.DecryptStringAES(configuration[string.Format("{0}:User", _entorno)]);
|
||||
_Password = EncriptaHelper.DecryptStringAES(configuration[string.Format("{0}:Password", _entorno)]);
|
||||
_conSQL = _conSQL.Replace("{Source}", _Source).Replace("{Catalog}", _Catalog).Replace("{User}", _User).Replace("{Password}", _Password);
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region WMS
|
||||
public IReciboRepository Recibo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Recibo == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_Recibo = new ReciboRepository(_repoContext, _clientFactory, _configuration);
|
||||
}
|
||||
return _Recibo;
|
||||
}
|
||||
}
|
||||
public ITransferenciaRepository Transferencia
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Transferencia == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_Transferencia = new TransferenciaRepository(_repoContext, _clientFactory, _configuration);
|
||||
}
|
||||
return _Transferencia;
|
||||
}
|
||||
}
|
||||
public IItemsRepository Items
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Items == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_Items = new ItemsRepository(_repoContext, _clientFactory, _configuration);
|
||||
}
|
||||
return _Items;
|
||||
}
|
||||
}
|
||||
public IPickingRepository Picking
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Picking == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_Picking = new PickingRepository(_repoContext, _clientFactory, _configuration);
|
||||
}
|
||||
return _Picking;
|
||||
}
|
||||
}
|
||||
public IInventarioRepository Inventario
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Inventario == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_Inventario = new InventarioRepository(_repoContext, _clientFactory, _configuration);
|
||||
}
|
||||
return _Inventario;
|
||||
}
|
||||
}
|
||||
public ISolicitudTransferenciaRepository SolicitudTransferencia
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SolicitudTransferencia == null)
|
||||
{
|
||||
_SolicitudTransferencia = new SolicitudTransferenciaRepository(_clientFactory, _configuration);
|
||||
}
|
||||
return _SolicitudTransferencia;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SAP (SERVICES LAYER)
|
||||
public IBusinessPartnersRepository BusinessPartners
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_BusinessPartners == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_BusinessPartners = new BusinessPartnersRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _BusinessPartners;
|
||||
}
|
||||
}
|
||||
public ICreditNotesRepository CreditNotes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_CreditNotes == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_CreditNotes = new CreditNotesRepository(_clientFactory, _configuration, _repoContext);
|
||||
|
||||
}
|
||||
return _CreditNotes;
|
||||
}
|
||||
}
|
||||
public IInvoiceRepository InvoiceRepository
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Invoice == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_Invoice = new InvoiceRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _Invoice;
|
||||
}
|
||||
}
|
||||
public IPurchaseInvoicesRepository PurchaseInvoices
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_PurchaseInvoices == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_PurchaseInvoices = new PurchaseInvoicesRepository(_clientFactory, _configuration);
|
||||
}
|
||||
return _PurchaseInvoices;
|
||||
}
|
||||
}
|
||||
public IPurchaseDeliveryNotesRepository PurchaseDeliveryNotes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_PurchaseDeliveryNotes == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_PurchaseDeliveryNotes = new PurchaseDeliveryNotesRepository(_clientFactory, _configuration);
|
||||
}
|
||||
return _PurchaseDeliveryNotes;
|
||||
}
|
||||
}
|
||||
public IPurchaseOrdersRepository PurchaseOrders
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_PurchaseOrders == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_PurchaseOrders = new PurchaseOrdersRepository(_clientFactory, _configuration);
|
||||
}
|
||||
return _PurchaseOrders;
|
||||
}
|
||||
}
|
||||
public IAuthenticateRepository Authenticate
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_AuthenticateRepository == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_AuthenticateRepository = new AuthenticateRepository(_repoContext, _clientFactory, _configuration);
|
||||
}
|
||||
return _AuthenticateRepository;
|
||||
}
|
||||
}
|
||||
public IReturnRequestRepository ReturnRequest
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_ReturnRequest == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_ReturnRequest = new ReturnRequestRepository(_clientFactory, _configuration);
|
||||
}
|
||||
return _ReturnRequest;
|
||||
}
|
||||
}
|
||||
public IStockTransferRepository StockTransfer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_StockTransfer == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_StockTransfer = new StockTransferRepository(_clientFactory, _configuration);
|
||||
}
|
||||
return _StockTransfer;
|
||||
}
|
||||
}
|
||||
public IInventoryGenEntriesRepository InventoryGenEntries
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_InventoryGenEntries == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_InventoryGenEntries = new InventoryGenEntriesRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _InventoryGenEntries;
|
||||
}
|
||||
}
|
||||
public IInventoryGenExitsRepository InventoryGenExits
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_InventoryGenExits == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_InventoryGenExits = new InventoryGenExitsRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _InventoryGenExits;
|
||||
}
|
||||
}
|
||||
|
||||
public IHRRepository HR
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_HR == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_HR = new HRRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _HR;
|
||||
}
|
||||
}
|
||||
|
||||
public IGlobalDataRepository GlobalData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_GlobalData == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_GlobalData = new GlobalDataRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _GlobalData;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user