agregado procesos y bd clases
This commit is contained in:
56
bdAsegasa/Extensiones/subagentes.cs
Normal file
56
bdAsegasa/Extensiones/subagentes.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user