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 _ListaSubagentes; public bool AMarcarComoBaja { get; set; } [NotMapped] public List PolizasConDocumentosPendientes { get { return this.polizassg.Where(x => x.documentospolizassg.Any(y => y.Obligatorio && y.FechaComprobacion == null && y.idFichero == null)).ToList(); } } [NotMapped] public List 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 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; } } } }