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,78 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Net.Business.Entities;
|
||||
using Net.Business.Entities.ServicesLayer;
|
||||
using Net.Business.Entities.ServicesLayer.PurchaseDeliveryNotes;
|
||||
using Net.Connection.ServiceLayer;
|
||||
using Net.CrossCotting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Net.Data.ServicesLayer
|
||||
{
|
||||
public class PurchaseDeliveryNotesRepository : IPurchaseDeliveryNotesRepository
|
||||
{
|
||||
#region Variables Globales
|
||||
private string _aplicacionName;
|
||||
private string _metodoName;
|
||||
private readonly Regex regex = new Regex(@"<(\w+)>.*");
|
||||
|
||||
//Services Layer
|
||||
private readonly ConnectionServiceLayer _connectServiceLayer;
|
||||
#endregion
|
||||
|
||||
public PurchaseDeliveryNotesRepository(IHttpClientFactory clientFactory, IConfiguration configuration)
|
||||
{
|
||||
_aplicacionName = this.GetType().Name;
|
||||
_connectServiceLayer = new ConnectionServiceLayer(configuration, clientFactory);
|
||||
}
|
||||
|
||||
public async Task<BE_ResultadoTransaccion<BE_BaseResponseSap>> SetCreatePurchaseDeliveryNotes(BE_PurchaseDeliveryNotes entidad)
|
||||
{
|
||||
_metodoName = regex.Match(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name).Groups[1].Value.ToString();
|
||||
|
||||
ResultadoTransaccion<BE_BaseResponseSap> resultadoTransaccion = new ResultadoTransaccion<BE_BaseResponseSap>(_metodoName, _aplicacionName);
|
||||
|
||||
try
|
||||
{
|
||||
var cadena = "PurchaseDeliveryNotes";
|
||||
var data = await _connectServiceLayer.PostAsync<BE_BaseResponseSap>(cadena, entidad);
|
||||
|
||||
if (!data.Exito)
|
||||
{
|
||||
return resultadoTransaccion.GetInformacionResultado(-1, -1, data.Mensaje);
|
||||
}
|
||||
|
||||
return resultadoTransaccion.GetInformacionResultado(0, "", "Se Listo correctamento...!!!", data);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return resultadoTransaccion.GetInformacionResultado(-1, -1, ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GET INVOICES
|
||||
public async Task<BE_ResultadoTransaccion<BE_PurchaseDeliveryNotes>> GetPurchaseDeliveryNotes(int docEntry)
|
||||
{
|
||||
_metodoName = regex.Match(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name).Groups[1].Value.ToString();
|
||||
|
||||
ResultadoTransaccion<BE_PurchaseDeliveryNotes> resultadoTransaccion = new ResultadoTransaccion<BE_PurchaseDeliveryNotes>(_metodoName, _aplicacionName);
|
||||
try
|
||||
{
|
||||
|
||||
string cadena = $"PurchaseDeliveryNotes({docEntry})";
|
||||
int maxpagesize = 0;
|
||||
List<BE_PurchaseDeliveryNotes> objectList = await _connectServiceLayer.GetAsync<BE_PurchaseDeliveryNotes>(cadena, maxpagesize, true);
|
||||
|
||||
return resultadoTransaccion.GetInformacionResultado(0, 0, "Se Listo correctamento...!!!", objectList);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return resultadoTransaccion.GetInformacionResultado(-1, -1, ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user