Limpieza: quitar codigo sin uso (metodos sin llamadores, throw inalcanzable, variables y propiedades del RepositoryWrapper sin uso)
- ConnectionServiceLayer: ValidarCertificado, Logout, CancelAsyncSBA, DeleteAsyncSBA y throw inalcanzable en PatchAsyncSBA - HelperDB (SET ejecutaba SQL arbitrario, sin llamadores) - RepositoryWrapper/IRepositoryWrapper: 11 propiedades que ningun controller usa - PickingRepository: TotalDetalle_Parcial y _Invoice sin uso; ReciboRepository: SerieOrigen sin uso Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d82f7380c
commit
57b4578f1f
6 files changed
-506
No files matched your search
@@ -48,11 +48,6 @@ namespace Net.Connection.ServiceLayer
|
||||
_responseLoginServiceLayer = new ResponseLoginServiceLayer();
|
||||
}
|
||||
|
||||
private bool ValidarCertificado(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors ssl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<ResponseLoginServiceLayer> Login()
|
||||
{
|
||||
try
|
||||
@@ -228,93 +223,6 @@ namespace Net.Connection.ServiceLayer
|
||||
return _responseLoginServiceLayer;
|
||||
}
|
||||
}
|
||||
public async Task<ResponseLoginServiceLayer> Logout()
|
||||
{
|
||||
try
|
||||
{
|
||||
// CONSTRUIMOS LA URL DE LA ACCIÓN
|
||||
var urlBuilder_ = new StringBuilder();
|
||||
urlBuilder_.Append(_url != null ? _url.TrimEnd('/') : "")
|
||||
.Append("/Logout");
|
||||
var url_ = urlBuilder_.ToString();
|
||||
|
||||
// RECUPERAMOS EL HttpClient
|
||||
|
||||
var client_ = _httpClient.CreateClient("bypass-ssl-validation");
|
||||
|
||||
|
||||
using (var request_ = new HttpRequestMessage())
|
||||
{
|
||||
///////////////////////////////////////
|
||||
// CONSTRUIMOS LA PETICIÓN (REQUEST) //
|
||||
///////////////////////////////////////
|
||||
// DEFINIMOS EL Content CON EL OBJETO A ENVIAR SERIALIZADO.
|
||||
//request_.Content = new StringContent("{\"CompanyDB\":\"" + _company + "\",\"Password\":\"" + _password + "\",\"UserName\":\"" + _user + "\"}");
|
||||
|
||||
//// DEFINIMOS EL ContentType, EN ESTE CASO ES "application/json"
|
||||
//request_.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
|
||||
request_.Headers.Add("cache-control", "no-cache");
|
||||
|
||||
// DEFINIMOS EL MÉTODO HTTP
|
||||
request_.Method = new HttpMethod("POST");
|
||||
|
||||
// DEFINIMOS LA URI
|
||||
request_.RequestUri = new Uri(url_, System.UriKind.RelativeOrAbsolute);
|
||||
|
||||
// DEFINIMOS EL Accept, EN ESTE CASO ES "application/json"
|
||||
request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
|
||||
|
||||
/////////////////////////////////////////
|
||||
// CONSTRUIMOS LA RESPUESTA (RESPONSE) //
|
||||
/////////////////////////////////////////
|
||||
// Utilizamos ConfigureAwait(false) para evitar el DeadLock.
|
||||
var response_ = await client_.SendAsync(request_).ConfigureAwait(false);
|
||||
|
||||
// OBTENEMOS EL Content DEL RESPONSE como un String
|
||||
// Utilizamos ConfigureAwait(false) para evitar el DeadLock.
|
||||
var responseText_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
|
||||
// SI ES LA RESPUESTA ESPERADA !! ...
|
||||
if (response_.StatusCode == System.Net.HttpStatusCode.NoContent) // 204
|
||||
{
|
||||
// DESERIALIZAMOS Content DEL RESPONSE
|
||||
_responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
_responseLoginServiceLayer.ServicioActivo = true;
|
||||
_responseLoginServiceLayer.MensajeLogin = "Cierre de Sesión Correcta";
|
||||
return _responseLoginServiceLayer;
|
||||
}
|
||||
//else
|
||||
//// SI NO SE ESTÁ AUTORIZADO ...
|
||||
//if (response_.StatusCode == System.Net.HttpStatusCode.Unauthorized) // 401
|
||||
//{
|
||||
// _responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
// _responseLoginServiceLayer.ServicioActivo = false;
|
||||
// _responseLoginServiceLayer.MensajeLogin = "401 Unauthorized. Las credenciales de acceso del usuario son incorrectas.";
|
||||
// return _responseLoginServiceLayer;
|
||||
//}
|
||||
//else
|
||||
//// CUALQUIER OTRA RESPUESTA ...
|
||||
//if (response_.StatusCode != System.Net.HttpStatusCode.OK && // 200
|
||||
// response_.StatusCode != System.Net.HttpStatusCode.NoContent) // 204
|
||||
//{
|
||||
// _responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
// _responseLoginServiceLayer.ServicioActivo = false;
|
||||
// _responseLoginServiceLayer.MensajeLogin = "401 Unauthorized. Las credenciales de acceso del usuario son incorrectas.";
|
||||
// return _responseLoginServiceLayer;
|
||||
//}
|
||||
|
||||
// RETORNAMOS EL OBJETO POR DEFECTO ESPERADO
|
||||
return _responseLoginServiceLayer;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_responseLoginServiceLayer.ServicioActivo = false;
|
||||
_responseLoginServiceLayer.MensajeLogin = ex.Message.ToString();
|
||||
return _responseLoginServiceLayer;
|
||||
}
|
||||
}
|
||||
public async Task<List<T>> GetAsync<T>(string Query, int maxpagesize,bool dinamico = false)
|
||||
{
|
||||
try
|
||||
@@ -786,230 +694,6 @@ namespace Net.Connection.ServiceLayer
|
||||
// PASAMOS LA EXCEPCIÓN A LA APP.
|
||||
}
|
||||
}
|
||||
public async Task<T> CancelAsyncSBA<T>(string Query)
|
||||
{
|
||||
try
|
||||
{
|
||||
// CONSTRUIMOS LA URL DE LA ACCIÓN
|
||||
var urlBuilder_ = new StringBuilder();
|
||||
urlBuilder_.Append(_url != null ? _url.TrimEnd('/') : "")
|
||||
.Append("/" + Query);
|
||||
var url_ = urlBuilder_.ToString();
|
||||
|
||||
// RECUPERAMOS EL HttpClient
|
||||
var client_ = _httpClient.CreateClient("bypass-ssl-validation");
|
||||
|
||||
int NumError = 0;
|
||||
|
||||
band:
|
||||
|
||||
using (var request_ = new HttpRequestMessage())
|
||||
{
|
||||
///////////////////////////////////////
|
||||
// CONSTRUIMOS LA PETICIÓN (REQUEST) //
|
||||
///////////////////////////////////////
|
||||
// DEFINIMOS EL MÉTODO HTTP GET
|
||||
request_.Method = new HttpMethod("POST");
|
||||
|
||||
// DEFINIMOS LA URI
|
||||
request_.RequestUri = new Uri(url_, System.UriKind.RelativeOrAbsolute);
|
||||
|
||||
// DEFINIMOS EL Accept, EN ESTE CASO ES "application/json"
|
||||
//request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
|
||||
//request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("odata=minimalmetadata"));
|
||||
//request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("charset=utf-8"));
|
||||
//request_.Content = new StringContent(JsonConvert.SerializeObject(obj), System.Text.Encoding.UTF8, "application/json");
|
||||
|
||||
// ASIGNAMOS A LA CABECERA DE LA PETICIÓN EL TOKEN JWT.
|
||||
if (_responseLoginServiceLayer.ServicioActivo)
|
||||
request_.Headers.Add("Cookie", "B1SESSION=" + _responseLoginServiceLayer.SessionId);
|
||||
|
||||
/////////////////////////////////////////
|
||||
// CONSTRUIMOS LA RESPUESTA (RESPONSE) //
|
||||
/////////////////////////////////////////
|
||||
// Utilizamos ConfigureAwait(false) para evitar el DeadLock.
|
||||
var response_ = await client_.SendAsync(request_, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
|
||||
|
||||
// OBTENEMOS EL Content DEL RESPONSE como un String
|
||||
// Utilizamos ConfigureAwait(false) para evitar el DeadLock.
|
||||
var responseText_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
|
||||
// SI ES LA RESPUESTA ESPERADA !! ...
|
||||
if (response_.StatusCode == System.Net.HttpStatusCode.OK || response_.StatusCode == System.Net.HttpStatusCode.Created) // 200 or Created
|
||||
{
|
||||
// DESERIALIZAMOS Content DEL RESPONSE
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
var estado = (int)response_.StatusCode;
|
||||
//responseBody.CodigoHttp = estado.ToString();
|
||||
responseBody.Mensaje = "SE ENVIO CORRECTAMENTE A SAP BO ";
|
||||
return responseBody;
|
||||
}
|
||||
else
|
||||
// SI NO SE ESTÁ AUTORIZADO ...
|
||||
if (response_.StatusCode == System.Net.HttpStatusCode.Unauthorized) // 401
|
||||
{
|
||||
|
||||
NumError += 1;
|
||||
|
||||
_responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
_responseLoginServiceLayer.ServicioActivo = false;
|
||||
|
||||
if (NumError == 2)
|
||||
{
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
var estado = (int)response_.StatusCode;
|
||||
//responseBody.CodigoHttp = estado.ToString();
|
||||
responseBody.Mensaje = "Services Unauthorized : " + _responseLoginServiceLayer.error.message.ToString();
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
|
||||
if (_responseLoginServiceLayer.error.code.ToString() == "301")
|
||||
{
|
||||
await LoginPost();
|
||||
goto band;
|
||||
}
|
||||
}
|
||||
else
|
||||
// CUALQUIER OTRA RESPUESTA ...
|
||||
if (response_.StatusCode != System.Net.HttpStatusCode.OK && // 200
|
||||
response_.StatusCode != System.Net.HttpStatusCode.NoContent) // 204
|
||||
{
|
||||
|
||||
//NumError += 1;
|
||||
|
||||
_responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
_responseLoginServiceLayer.ServicioActivo = false;
|
||||
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
var estado = (int)response_.StatusCode;
|
||||
//responseBody.CodigoHttp = estado.ToString();
|
||||
responseBody.Mensaje = "Error Services : " + _responseLoginServiceLayer.error.message.ToString();
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
// RETORNAMOS EL OBJETO POR DEFECTO ESPERADO
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return default(T);
|
||||
throw new Exception(ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
public async Task<T> DeleteAsyncSBA<T>(string Query)
|
||||
{
|
||||
try
|
||||
{
|
||||
// CONSTRUIMOS LA URL DE LA ACCIÓN
|
||||
var urlBuilder_ = new StringBuilder();
|
||||
urlBuilder_.Append(_url != null ? _url.TrimEnd('/') : "")
|
||||
.Append("/" + Query);
|
||||
var url_ = urlBuilder_.ToString();
|
||||
|
||||
// RECUPERAMOS EL HttpClient
|
||||
var client_ = _httpClient.CreateClient("bypass-ssl-validation");
|
||||
|
||||
int NumError = 0;
|
||||
|
||||
band:
|
||||
|
||||
using (var request_ = new HttpRequestMessage())
|
||||
{
|
||||
///////////////////////////////////////
|
||||
// CONSTRUIMOS LA PETICIÓN (REQUEST) //
|
||||
///////////////////////////////////////
|
||||
// DEFINIMOS EL MÉTODO HTTP GET
|
||||
request_.Method = new HttpMethod("DELETE");
|
||||
|
||||
// DEFINIMOS LA URI
|
||||
request_.RequestUri = new Uri(url_, System.UriKind.RelativeOrAbsolute);
|
||||
|
||||
// DEFINIMOS EL Accept, EN ESTE CASO ES "application/json"
|
||||
//request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
|
||||
//request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("odata=minimalmetadata"));
|
||||
//request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("charset=utf-8"));
|
||||
//request_.Content = new StringContent(JsonConvert.SerializeObject(obj), System.Text.Encoding.UTF8, "application/json");
|
||||
|
||||
// ASIGNAMOS A LA CABECERA DE LA PETICIÓN EL TOKEN JWT.
|
||||
if (_responseLoginServiceLayer.ServicioActivo)
|
||||
request_.Headers.Add("Cookie", "B1SESSION=" + _responseLoginServiceLayer.SessionId);
|
||||
|
||||
/////////////////////////////////////////
|
||||
// CONSTRUIMOS LA RESPUESTA (RESPONSE) //
|
||||
/////////////////////////////////////////
|
||||
// Utilizamos ConfigureAwait(false) para evitar el DeadLock.
|
||||
var response_ = await client_.SendAsync(request_, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
|
||||
|
||||
// OBTENEMOS EL Content DEL RESPONSE como un String
|
||||
// Utilizamos ConfigureAwait(false) para evitar el DeadLock.
|
||||
var responseText_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
|
||||
// SI ES LA RESPUESTA ESPERADA !! ...
|
||||
if (response_.StatusCode == System.Net.HttpStatusCode.OK || response_.StatusCode == System.Net.HttpStatusCode.Created) // 200 or Created
|
||||
{
|
||||
// DESERIALIZAMOS Content DEL RESPONSE
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
var estado = (int)response_.StatusCode;
|
||||
//responseBody.CodigoHttp = estado.ToString();
|
||||
responseBody.Mensaje = "SE ENVIO CORRECTAMENTE A SAP BO ";
|
||||
return responseBody;
|
||||
}
|
||||
else
|
||||
// SI NO SE ESTÁ AUTORIZADO ...
|
||||
if (response_.StatusCode == System.Net.HttpStatusCode.Unauthorized) // 401
|
||||
{
|
||||
|
||||
NumError += 1;
|
||||
|
||||
_responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
_responseLoginServiceLayer.ServicioActivo = false;
|
||||
|
||||
if (NumError == 2)
|
||||
{
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
var estado = (int)response_.StatusCode;
|
||||
//responseBody.CodigoHttp = estado.ToString();
|
||||
responseBody.Mensaje = "Services Unauthorized : " + _responseLoginServiceLayer.error.message.ToString();
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
|
||||
if (_responseLoginServiceLayer.error.code.ToString() == "301")
|
||||
{
|
||||
await LoginPost();
|
||||
goto band;
|
||||
}
|
||||
}
|
||||
else
|
||||
// CUALQUIER OTRA RESPUESTA ...
|
||||
if (response_.StatusCode != System.Net.HttpStatusCode.OK && // 200
|
||||
response_.StatusCode != System.Net.HttpStatusCode.NoContent) // 204
|
||||
{
|
||||
|
||||
//NumError += 1;
|
||||
|
||||
_responseLoginServiceLayer = JsonConvert.DeserializeObject<ResponseLoginServiceLayer>(responseText_);
|
||||
_responseLoginServiceLayer.ServicioActivo = false;
|
||||
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
var estado = (int)response_.StatusCode;
|
||||
//responseBody.CodigoHttp = estado.ToString();
|
||||
responseBody.Mensaje = "Error Services : " + _responseLoginServiceLayer.error.message.ToString();
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
// RETORNAMOS EL OBJETO POR DEFECTO ESPERADO
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return default(T);
|
||||
throw new Exception(ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
public async Task<T> PatchAsyncSBA<T>(string Query, object obj)
|
||||
{
|
||||
try
|
||||
@@ -1127,7 +811,6 @@ namespace Net.Connection.ServiceLayer
|
||||
catch (Exception ex)
|
||||
{
|
||||
return default(T);
|
||||
throw new Exception(ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,20 +28,9 @@ namespace Net.Data
|
||||
#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
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace Net.Data
|
||||
|
||||
private IReciboRepository _Recibo;
|
||||
private ITransferenciaRepository _Transferencia;
|
||||
private IStockTransferRepository _StockTransfer;
|
||||
private IPickingRepository _Picking;
|
||||
private IInventarioRepository _Inventario;
|
||||
private ISolicitudTransferenciaRepository _SolicitudTransferencia;
|
||||
@@ -51,19 +50,9 @@ namespace Net.Data
|
||||
|
||||
#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
|
||||
|
||||
@@ -162,79 +151,6 @@ namespace Net.Data
|
||||
#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
|
||||
@@ -247,54 +163,6 @@ namespace Net.Data
|
||||
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
|
||||
{
|
||||
@@ -309,18 +177,6 @@ namespace Net.Data
|
||||
}
|
||||
}
|
||||
|
||||
public IGlobalDataRepository GlobalData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_GlobalData == null)
|
||||
{
|
||||
_repoContext._cnx = _conSQL;
|
||||
_GlobalData = new GlobalDataRepository(_clientFactory, _configuration, _repoContext);
|
||||
}
|
||||
return _GlobalData;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using Sap.Data.Hana;
|
||||
using System.Data;
|
||||
|
||||
namespace Net.Data.HelperData
|
||||
{
|
||||
public class HelperDB
|
||||
{
|
||||
public static void SET(string query)
|
||||
{
|
||||
using (HanaConnection con = new HanaConnection(LocalData.ConnectionString))
|
||||
{
|
||||
con.Open();
|
||||
HanaCommand cmd = new HanaCommand
|
||||
{
|
||||
CommandText = query,
|
||||
Connection = con,
|
||||
CommandType = CommandType.Text
|
||||
};
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
con.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -88,13 +88,11 @@ namespace Net.Data.WMS.Picking
|
||||
|
||||
var TotalDetalle = 0;
|
||||
var TotalDetalle_Anulado = 0;
|
||||
var TotalDetalle_Parcial = 0;
|
||||
var TotalDetalle_Completo = 0;
|
||||
if (Existe > 1)
|
||||
{
|
||||
TotalDetalle = entidad.Detalle.Count();
|
||||
TotalDetalle_Anulado = entidad.Detalle.Where(x=> x.Estado == "A").Count();
|
||||
TotalDetalle_Parcial = entidad.Detalle.Where(x => x.Estado == "P").Count();
|
||||
TotalDetalle_Completo = entidad.Detalle.Where(x => x.Estado == "C").Count();
|
||||
if(TotalDetalle == TotalDetalle_Anulado)
|
||||
{
|
||||
@@ -113,7 +111,6 @@ namespace Net.Data.WMS.Picking
|
||||
{
|
||||
TotalDetalle = entidad.Detalle.Count();
|
||||
TotalDetalle_Anulado = entidad.Detalle.Where(x => x.Estado == "A").Count();
|
||||
TotalDetalle_Parcial = entidad.Detalle.Where(x => x.Estado == "P").Count();
|
||||
TotalDetalle_Completo = entidad.Detalle.Where(x => x.Estado == "C").Count();
|
||||
}
|
||||
|
||||
@@ -571,7 +568,6 @@ namespace Net.Data.WMS.Picking
|
||||
}
|
||||
});
|
||||
|
||||
var _Invoice = response_invoicesRepository.ListData.FirstOrDefault();
|
||||
creditNotesNotes.DocumentLines.ForEach(line =>
|
||||
{
|
||||
|
||||
|
||||
@@ -379,7 +379,6 @@ namespace Net.Data.WMS.Recibo
|
||||
_Invoice = _Invoice_Result.ListData.FirstOrDefault();
|
||||
}
|
||||
});
|
||||
string SerieOrigen = "";
|
||||
string U_SYP_MDTO = "";
|
||||
string U_SYP_MDCO = "";
|
||||
string U_SYP_MDSO = "";
|
||||
@@ -387,7 +386,6 @@ namespace Net.Data.WMS.Recibo
|
||||
|
||||
if (_Invoice == null)
|
||||
{
|
||||
SerieOrigen = returnRequest.U_SYP_MDSO;
|
||||
U_SYP_MDTO = returnRequest.U_SYP_MDTO;
|
||||
U_SYP_MDCO = returnRequest.U_SYP_MDCO;
|
||||
U_SYP_MDSO = returnRequest.U_SYP_MDSO;
|
||||
@@ -395,7 +393,6 @@ namespace Net.Data.WMS.Recibo
|
||||
}
|
||||
else
|
||||
{
|
||||
SerieOrigen = _Invoice.U_SYP_MDSD;
|
||||
U_SYP_MDTO = _Invoice.U_SYP_MDTD;
|
||||
U_SYP_MDCO = _Invoice.U_SYP_MDCD;
|
||||
U_SYP_MDSO = _Invoice.U_SYP_MDSD;
|
||||
|
||||
Reference in new issue
Block a user