Files
Asegasa.NET/bdAsegasa/Extensiones/subagentes.cs
2026-04-28 11:52:16 +02:00

57 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using bdAsegasa.dbcontext;
namespace bdAsegasa.db
{
public partial class subagentes
{
private static List<subagentes> _ListaSubagentes;
public bool AMarcarComoBaja { get; set; }
[NotMapped]
public List<polizassg> PolizasConDocumentosPendientes
{
get
{
return this.polizassg.Where(x => x.documentospolizassg.Any(y => y.Obligatorio && y.FechaComprobacion == null && y.idFichero == null)).ToList();
}
}
[NotMapped]
public List<polizassg> PolizasConDocumentosPendientes7Dias
{
get
{
DateTime FechaInicio = DateTime.Today.AddDays(-7);
return this.polizassg.Where(x => x.FechaAlta >= FechaInicio).ToList().Where(x => x.documentospolizassg.Any(y => y.Obligatorio && y.FechaComprobacion == null && y.idFichero == null)).ToList();
}
}
public static List<subagentes> ListaSubAgentes()
{
if (_ListaSubagentes == null)
{
using (var bd = tscgestionasegasa.NuevoContexto())
{
_ListaSubagentes = bd.subagentes.OrderBy(x => x.Nombre).ToList();
}
}
return _ListaSubagentes;
}
public string CodigoYNombre
{
get
{
return Codigo + " - " + Nombre;
}
}
}
}