Files
Jorge Luis caudillo esparza 83acc6b4f1 Version OScar
2026-04-24 07:54:31 -07:00

175 lines
4.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ADSUtileriasWF.Helpers;
using Microsoft.VisualBasic;
namespace ADSUtileriasWF.Data.Externa.PV
{
public class ClsMetodosPago : CLSExternoBase
{
public partial class ClsMetodosPagoModel : object, System.ComponentModel.INotifyPropertyChanged
{
private int CveMetodoPagoField;
private string MetodoPagoField;
private double ImporteField;
private double ImportePropinaField;
public ClsMetodosPagoModel(int CveMetodoPago_, string MetodoPago_, double Importe_)
{
CveMetodoPago = CveMetodoPago_;
MetodoPago = MetodoPago_;
Importe = Importe_;
}
public int CveMetodoPago
{
get
{
return this.CveMetodoPagoField;
}
set
{
if ((this.CveMetodoPagoField.Equals(value) != true))
{
this.CveMetodoPagoField = value;
this.RaisePropertyChanged("CveMetodoPago");
}
}
}
public string MetodoPago
{
get
{
return this.MetodoPagoField;
}
set
{
this.MetodoPagoField = value;
}
}
public double Importe
{
get
{
return this.ImporteField;
}
set
{
if ((this.ImporteField.Equals(value) != true))
{
this.ImporteField = value;
this.RaisePropertyChanged("Importe");
}
}
}
public double ImportePropina
{
get
{
return this.ImportePropinaField;
}
set
{
if ((this.ImportePropinaField.Equals(value) != true))
{
this.ImportePropinaField = value;
this.RaisePropertyChanged("ImportePropina");
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName)
{
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null))
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
public int CveMetodoPago { get; set; }
public string MetodoPago { get; set; }
public bool Estado { get; set; }
public string Estatus { get; set; }
public ClsMetodosPago() { }
public bool GetMetodosPago()
{
bool Retorno = false;
try
{
datos = proxy.GetMetodosPago();
if (datos.Tabla.Rows.Count > 0)
{
this.CveMetodoPago = datos.Tabla.Rows[0]["CveMetodoPago"].ToString().ToEntero();
this.MetodoPago = datos.Tabla.Rows[0]["MetodoPago"].ToString();
this.Estado = (datos.Tabla.Rows[0]["Estado"].ToString() == "1" || datos.Tabla.Rows[0]["Estado"].ToString().ToUpper() == "TRUE");
this.Estatus = datos.Tabla.Rows[0]["Estatus"].ToString();
}
Retorno = true;
}
catch (Exception ex)
{
OnError("Ocurrió un error al consultar El Metodo de Pago.", "Error", ex, MessageBoxIcon.Error);
}
return Retorno;
}
public bool AddMetodosPago(int CveMetodoPago, string MetodoPago, bool Estado)
{
bool Retorno = false;
try
{
datos = proxy.AddMetodosPago(CveMetodoPago, MetodoPago, Estado);
Retorno = true;
}
catch (Exception ex)
{
OnError("Ocurrió un error al Agregar El Metodo de Pago.", "Error", ex, MessageBoxIcon.Error);
}
return Retorno;
}
public bool RemoveMetodosPago(int CveMetodoPago)
{
bool Retorno = false;
try
{
datos = proxy.RemoveMetodosPago(CveMetodoPago);
Retorno = true;
}
catch (Exception ex)
{
OnError("Ocurrió un error al Eliminar el Metodo de Pago.", "Error", ex, MessageBoxIcon.Error);
}
return Retorno;
}
}
}