Agregar archivos de proyecto.
This commit is contained in:
73
bdGrupoSanchoToro/extensiones/almacenes.cs
Normal file
73
bdGrupoSanchoToro/extensiones/almacenes.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user