agregado procesos y bd clases
This commit is contained in:
71
bdAsegasa/Extensiones/documentospolizassg.cs
Normal file
71
bdAsegasa/Extensiones/documentospolizassg.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using bdAsegasa.dbcontext;
|
||||
|
||||
namespace bdAsegasa.db
|
||||
{
|
||||
public partial class documentospolizassg
|
||||
{
|
||||
public bool DocumentoComprobado
|
||||
{
|
||||
get => this.FechaComprobacion.HasValue;
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
this.FechaComprobacion = DateTime.Now;
|
||||
this.idUsuarioComprueba = Utilidades.dsc.idUsuario;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.FechaComprobacion = null;
|
||||
this.idUsuarioComprueba = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void GeneraDocumentosASolicitar(tscgestionasegasa bd, polizassg poliza, List<int> idDocsASolicitar = null)
|
||||
{
|
||||
List<documentosasolicitar> das;
|
||||
if (idDocsASolicitar != null)
|
||||
{
|
||||
das = bd.documentosasolicitar.Where(x => idDocsASolicitar.Contains(x.idDocumento)).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
das = bd.documentosasolicitar.Where(x => x.idRamo == poliza.idRamo).ToList();
|
||||
}
|
||||
|
||||
var enumDomiciliacion = bd.enumeraciones.FirstOrDefault(x => x.Codigo == "TIPP.BA");
|
||||
int idDomiciliacion = enumDomiciliacion?.idEnumeracion ?? -1;
|
||||
|
||||
foreach (var d in das)
|
||||
{
|
||||
var dp = new documentospolizassg();
|
||||
poliza.documentospolizassg.Add(dp);
|
||||
dp.Descripcion = d.idRamoNavigation?.Descripcion;
|
||||
dp.idDocumentoASolicitar = d.idDocumento;
|
||||
dp.Obligatorio = d.Obligatorio;
|
||||
dp.Fecha = DateTime.Now;
|
||||
|
||||
if (d.idRamoNavigation?.Codigo == "DOCRAM.MDTO" && poliza.idTipoPago != idDomiciliacion)
|
||||
{
|
||||
dp.Obligatorio = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string DescripcionTipo => ((TipoDocumentoEnum)(this.Tipo)).ToString().Replace("_", " ");
|
||||
|
||||
public enum TipoDocumentoEnum : int
|
||||
{
|
||||
DESCONOCIDO = 0,
|
||||
PÓLIZA = 1,
|
||||
CARTA_SUPLEMENTO = 2,
|
||||
CERTIFICADO_SEGURO = 3,
|
||||
RECIBO = 10,
|
||||
OTROS = 100
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user