using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Net.Business.Entities; using Net.Business.Entities.ServicesLayer; using Net.Business.Entities.ServicesLayer.CreditNotes; using Net.Business.Entities.ServicesLayer.HR; using Net.Business.Entities.ServicesLayer.Invoices; using Net.Connection; using Net.Connection.ServiceLayer; using Net.CrossCotting; using Net.Data.HelperData.HojaRuta; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Net.Data.ServicesLayer.GlobalData { public class GlobalDataRepository : IGlobalDataRepository { #region Variables Globales private string _aplicacionName; private string _metodoName; private readonly Regex regex = new Regex(@"<(\w+)>.*"); //Services Layer private readonly ConnectionServiceLayer _connectServiceLayer; private readonly IConnectionSQL _context; #endregion public GlobalDataRepository(IHttpClientFactory clientFactory, IConfiguration configuration, IConnectionSQL context) { _aplicacionName = this.GetType().Name; _connectServiceLayer = new ConnectionServiceLayer(configuration, clientFactory); _context = context; } public async Task> GetSolicitudSalida(int DocEntry) { _metodoName = regex.Match(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name).Groups[1].Value.ToString(); ResultadoTransaccion resultadoTransaccion = new ResultadoTransaccion(_metodoName, _aplicacionName); try { string cadena = $"ITC_SOLSALMER({DocEntry})"; int maxpagesize = 0; List objectList = await _connectServiceLayer.GetAsync(cadena, maxpagesize, true); return resultadoTransaccion.GetInformacionResultado(0, 0, "Se Listo correctamento...!!!", objectList); } catch (Exception ex) { return resultadoTransaccion.GetInformacionResultado(-1, -1, ex.Message.ToString()); } } public async Task> GetSolicitudIngreso(int DocEntry) { _metodoName = regex.Match(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name).Groups[1].Value.ToString(); ResultadoTransaccion resultadoTransaccion = new ResultadoTransaccion(_metodoName, _aplicacionName); try { string cadena = $"ITC_SOLINGMER({DocEntry})"; int maxpagesize = 0; List objectList = await _connectServiceLayer.GetAsync(cadena, maxpagesize, true); return resultadoTransaccion.GetInformacionResultado(0, 0, "Se Listo correctamento...!!!", objectList); } catch (Exception ex) { return resultadoTransaccion.GetInformacionResultado(-1, -1, ex.Message.ToString()); } } } }