73 lines
1.9 KiB
C#
73 lines
1.9 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
using Microsoft.VisualBasic.CompilerServices;
|
|
|
|
namespace bdGrupoSanchoToro.db
|
|
{
|
|
public partial class almacenes:INotifyPropertyChanged
|
|
{
|
|
public string DescripcionTipo
|
|
{
|
|
get
|
|
{
|
|
return ((TipoAlmacenEnum)this.Tipo).ToString().Replace("_", " ");
|
|
}
|
|
}
|
|
public string Poblacion
|
|
{
|
|
get
|
|
{
|
|
return municipios.ObtienePoblacion(this.CodigoMunicipio);
|
|
}
|
|
}
|
|
|
|
public string Provincia
|
|
{
|
|
get
|
|
{
|
|
return municipios.ObtieneProvincia(this.CodigoMunicipio);
|
|
}
|
|
}
|
|
public string PoblacionProvincia
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
if ((Poblacion ?? "") == (Provincia ?? ""))
|
|
{
|
|
return Poblacion;
|
|
}
|
|
else
|
|
{
|
|
return Poblacion + " (" + Provincia + ")";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return "** DESCONOCIDO **";
|
|
}
|
|
}
|
|
}
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
public void RefrescaCamposSoloLectura()
|
|
{
|
|
this.OnPropertyChanged("Provincia");
|
|
this.OnPropertyChanged("Poblacion");
|
|
}
|
|
protected void OnPropertyChanged([CallerMemberName] string name = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
|
}
|
|
|
|
public enum TipoAlmacenEnum : int
|
|
{
|
|
ALMACEN = 0,
|
|
TALLER_REPARACIONES = 1,
|
|
UNIDADES_DESCARTADAS = 2
|
|
}
|
|
}
|
|
} |