84 lines
3.3 KiB
C#
84 lines
3.3 KiB
C#
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<BE_ResultadoTransaccion<ITC_SOLSALMER>> GetSolicitudSalida(int DocEntry)
|
|
{
|
|
_metodoName = regex.Match(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name).Groups[1].Value.ToString();
|
|
|
|
ResultadoTransaccion<ITC_SOLSALMER> resultadoTransaccion = new ResultadoTransaccion<ITC_SOLSALMER>(_metodoName, _aplicacionName);
|
|
try
|
|
{
|
|
|
|
string cadena = $"ITC_SOLSALMER({DocEntry})";
|
|
int maxpagesize = 0;
|
|
List<ITC_SOLSALMER> objectList = await _connectServiceLayer.GetAsync<ITC_SOLSALMER>(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<BE_ResultadoTransaccion<ITC_SOLINGMER>> GetSolicitudIngreso(int DocEntry)
|
|
{
|
|
_metodoName = regex.Match(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name).Groups[1].Value.ToString();
|
|
|
|
ResultadoTransaccion<ITC_SOLINGMER> resultadoTransaccion = new ResultadoTransaccion<ITC_SOLINGMER>(_metodoName, _aplicacionName);
|
|
try
|
|
{
|
|
|
|
string cadena = $"ITC_SOLINGMER({DocEntry})";
|
|
int maxpagesize = 0;
|
|
List<ITC_SOLINGMER> objectList = await _connectServiceLayer.GetAsync<ITC_SOLINGMER>(cadena, maxpagesize, true);
|
|
|
|
return resultadoTransaccion.GetInformacionResultado(0, 0, "Se Listo correctamento...!!!", objectList);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return resultadoTransaccion.GetInformacionResultado(-1, -1, ex.Message.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|