Files
Asegasa.NET/bdAsegasa/Extensiones/enumeraciones.cs

70 lines
1.9 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace bdAsegasa.db
{
public partial class enumeraciones
{
public string CodigoDescripcion
{
get
{
if (string.IsNullOrEmpty(this.Codigo) || !this.Codigo.Contains("."))
{
return "- " + this.Descripcion;
}
var parts = this.Codigo.Split('.');
if (parts.Length > 1)
{
return parts[1] + " - " + this.Descripcion;
}
return this.Codigo + " - " + this.Descripcion;
}
}
[NotMapped]
public int? ValorEntero1
{
get
{
if (this.ValorNumerico1.HasValue)
{
return (int)this.ValorNumerico1.Value;
}
else
{
return null;
}
}
set
{
if (value.HasValue)
{
this.ValorNumerico1 = (double)value.Value;
}
else
{
this.ValorNumerico1 = null;
}
}
}
private static List<enumeraciones> _LConfsi;
public static List<enumeraciones> LConfsi
{
get
{
if (_LConfsi == null)
{
var bd = tscgestionasegasa.NuevoContexto();
// Assuming NuevoContexto or similar context provider logic is used
_LConfsi = bd.enumeraciones.Where(x => x.Codigo != null && x.Codigo.StartsWith("VF.SI-")).OrderByDescending(x => x.Fecha1).ToList();
}
return _LConfsi;
}
}
}
}