using ADSUtileriasWF.Helpers; using System; using System.Collections.Generic; using System.Text; namespace ADSUtileriasWF.Data.Externa.PV { public class CLSExternoBase : IDisposable { #region Propiedades protected WCF_PV.DTable datos; protected WCF_PV.PuntoVentaClient proxy; // Atributos de la clase private bool disposedValue = false; // Para detectar llamadas redundantes public WCF_PV.DTable DtResultados { get { return datos; } } #endregion public CLSExternoBase(string RutaWCF = "") { if (RutaWCF == "") { RutaWCF = ModVarsPV.RutaWCF; } proxy = new WCF_PV.PuntoVentaClient(ModVarsPV.EndPointName, string.Format("{0}Clase", RutaWCF)); } public void OnError(string Mensaje, string Caption, Exception Exeption, System.Windows.Forms.MessageBoxIcon Icon, string InfoAdicional = "") { ModExtensiones.OnError(Mensaje, Caption, Exeption, Icon, InfoAdicional); } #region dispose protected virtual void Dispose(bool disposing) { if (!this.disposedValue && disposing) { if (datos != null) datos = null; if (proxy != null) proxy = null; } this.disposedValue = true; } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } public bool IsDBNull(object o) { return o == DBNull.Value; } #endregion } }