Imports System.IO Imports DevExpress.XtraRichEdit Imports DevExpress.Xpf.Core Imports System.Data.Objects Imports bdGestionAsegasa Imports tsl5.Extensiones Imports System.Text.RegularExpressions Namespace CombinacionCorrespondencia Public Class CombinacionCorrespondenciaRCSociosCaser Property Nombre As String Property Situacion As String Property TMunicipal As String Property FProvincia As String Property Descripcion As String Property Equino As String Property VacunoManso As String Property Porcino As String Property OvinoCaprino As String Property Aviar As String Property Cunicula As String Property TotalGanado As String Property VacunoBravo As String Property MenorSinJabalies As String Property MenorConJabalies As String Property MayorSinMalla As String Property MayorConMalla As String Property HasLabor As String Property HasDehesa As String Property TotalSuperficie As String Property OpcionElegida As String Property Total As String Property IBAN As String Property DañosMateriales1 As String Property DañosMateriales2 As String Property DañosMateriales3 As String Property DañosMateriales4 As String Property DañosMateriales5 As String Property DañosMateriales6 As String Property Sublimite1 As String Property Sublimite2 As String Property Sublimite3 As String Property Sublimite4 As String Property Sublimite5 As String Property Sublimite6 As String Property Patronal1 As String Property Patronal2 As String Property Patronal3 As String Property Patronal4 As String Property Patronal5 As String Property Patronal6 As String Property PNetaLabor1 As String Property PNetaLabor2 As String Property PNetaLabor3 As String Property PNetaLabor4 As String Property PNetaLabor5 As String Property PNetaLabor6 As String Property PNetaGanado1 As String Property PNetaGanado2 As String Property PNetaGanado3 As String Property PNetaGanado4 As String Property PNetaGanado5 As String Property PNetaGanado6 As String Property PNetaGanaderia1 As String Property PNetaGanaderia2 As String Property PNetaGanaderia3 As String Property PNetaGanaderia4 As String Property PNetaGanaderia5 As String Property PNetaGanaderia6 As String Property PSubtotal1 As String Property PSubtotal2 As String Property PSubtotal3 As String Property PSubtotal4 As String Property PSubtotal5 As String Property PSubtotal6 As String Property MenorSinJabalies1 As String Property MenorSinJabalies2 As String Property MenorSinJabalies3 As String Property MenorSinJabalies4 As String Property MenorSinJabalies5 As String Property MenorSinJabalies6 As String Property MenorConJabalies1 As String Property MenorConJabalies2 As String Property MenorConJabalies3 As String Property MenorConJabalies4 As String Property MenorConJabalies5 As String Property MenorConJabalies6 As String Property MayorSinMalla1 As String Property MayorSinMalla2 As String Property MayorSinMalla3 As String Property MayorSinMalla4 As String Property MayorSinMalla5 As String Property MayorSinMalla6 As String Property MayorConMalla1 As String Property MayorConMalla2 As String Property MayorConMalla3 As String Property MayorConMalla4 As String Property MayorConMalla5 As String Property MayorConMalla6 As String Property CotosSubtotal1 As String Property CotosSubtotal2 As String Property CotosSubtotal3 As String Property CotosSubtotal4 As String Property CotosSubtotal5 As String Property CotosSubtotal6 As String Property PNeta1 As String Property PNeta2 As String Property PNeta3 As String Property PNeta4 As String Property PNeta5 As String Property PNeta6 As String Property Impuestos1 As String Property Impuestos2 As String Property Impuestos3 As String Property Impuestos4 As String Property Impuestos5 As String Property Impuestos6 As String Property PTotal1 As String Property PTotal2 As String Property PTotal3 As String Property PTotal4 As String Property PTotal5 As String Property PTotal6 As String Property AseguradoCIF As String Property AseguradoNombre As String Property AseguradoApellidos As String Property AseguradoDireccion As String Property AseguradoCodigoPostal As String Property AseguradoTelefono1 As String Property AseguradoTelefono2 As String Property AseguradoCorreo As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaRCMaquinariaAgricola Property AseguradoCIF As String Property AseguradoNombre As String Property AseguradoApellidos As String Property AseguradoDireccion As String Property AseguradoCodigoPostal As String Property AseguradoTelefono1 As String Property AseguradoTelefono2 As String Property AseguradoCorreo As String Property aseguradoPoblacion As String Property FechaEfecto As String Property FechaVencimiento As String Property Matricula As String Property IBAN As String Property Cobertura As String Property Elegida As String Property PrimaTotal As String End Class Public Class CombinacionCorrespondenciaCertificadoTractores Property fechaCabecera As String Property NumeroPoliza As String Property Mediador As String Property vehiculoAsegurado As String Property plazasAseguradas As String Property matricula As String Property tomadorDeLaPoliza As String Property propietarioDelVehiculo As String Property conductor As String Property diayHora As String Property lugaryFecha As String End Class Public Class CombinacionCorrespondenciaPresupuestoTractores Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property ConductorCIF As String Property ConductorNombre As String Property ConductorApellidos As String Property ConductorFechaPermisoConducir As String Property Matricula As String Property Marca As String Property Modelo As String Property FechaMatriculacion As String Property Peso As String Property Precio As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaRCCotosCazaCaser Property NumeroHectareas As String Property OpcionA As String Property OpcionB As String Property OpcionC As String Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property PropietarioTelefono As String Property PropietarioDomicilio As String Property PropietarioCodigoPostal As String Property PropietarioPoblacion As String Property RiesgoSituacion As String Property RiesgoCodigoPostal As String Property RiesgoPoblacion As String Property RiesgoActividad As String Property RiesgoEpigrafe As String Property RiesgoDescripcion As String Property AclaracionesDeLaActividad As String Property Observaciones As String Property FechaEfecto As String Property IBAN As String Property CodigoMediador As String Property RamoModalidad As String Property OpcionElegida As String Property TotalOpcionElegida As String Property LimitePorSiniestro As String Property TomadorProvincia As String Property PropietarioProvincia As String Property RiesgoProvincia As String Property FechaVencimiento As String Property Entidad As String Property Oficina As String Property DC As String Property NumCuenta As String Property NombreEntidad As String End Class Public Class CombinacionCorrespondenciaTarificadorMaquinaria Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property PropietarioTelefono As String Property PropietarioEmail As String Property PropietarioDomicilio As String Property PropietarioCodigoPostal As String Property PropietarioPoblacion As String Property PropietarioProvincia As String Property PropietarioCodigoMunicipio As String Property Matricula As String Property UsoAlQueSeDestina As String Property AntiguedadMaquinaria As String Property NumeroMaquinasAseguradas As String Property Cosechadoras As String Property CosechadorasRotura As String Property TractoresAgricolas As String Property Empacadoras As String Property Vendimiadoras As String Property NoAutoPropulsados As String Property VibradoresOlivos As String Property CosechadorasCalculado As String Property CosechadorasRoturaCalculado As String Property TractoresAgricolasCalculado As String Property EmpacadorasCalculado As String Property VendimiadorasCalculado As String Property NoAutoPropulsadosCalculado As String Property VibradoresOlivosCalculado As String Property PrimaNetaMinima As String Property PrimaNeta As String Property Impuestos As String Property PrimaTotal As String Property Condicionantes As String Property Observaciones As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String Property DaniosLuna As String End Class Public Class CombinacionCorrespondenciaRCPerros Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property PropietarioTelefono As String Property PropietarioEmail As String Property PropietarioDomicilio As String Property PropietarioCodigoPostal As String Property PropietarioPoblacion As String Property PropietarioProvincia As String Property PropietarioCodigoMunicipio As String Property CoberturaElegida As String Property PrecioCobertura As String Property NumeroPerrosPeligrosos As String Property NumeroPerrosNoPeligrosos As String Property PrimaPerroPeligrosos As String Property PrimaPerrosNoPeligrosos As String Property PrecioPerrosPeligrosos As String Property PrecioPerrosNoPeligrosos As String Property PrimeroRaza As String Property PrimeroMicrochip As String Property PrimeroNombre As String Property PrimeroFechaNacimiento As String 'Property SegundoRaza As String 'Property SegundoMicrochip As String 'Property SegundoNombre As String 'Property SegundoFechaNacimiento As String 'Property TerceroRaza As String 'Property TerceroMicrochip As String 'Property TerceroNombre As String 'Property TerceroFechaNacimiento As String Property Observaciones As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String Property TipoPerro As String Private _Op1P As String Public Property Op1P() As String Get Return _Op1P End Get Set(ByVal value As String) _Op1P = value End Set End Property Private _Op2P As String Public Property Op2P() As String Get Return _Op2P End Get Set(ByVal value As String) _Op2P = value End Set End Property Private _Op3P As String Public Property Op3P() As String Get Return _Op3P End Get Set(ByVal value As String) _Op3P = value End Set End Property Private _Op1NP As String Public Property Op1NP() As String Get Return _Op1NP End Get Set(ByVal value As String) _Op1NP = value End Set End Property Private _Op2NP As String Public Property Op2NP() As String Get Return _Op2NP End Get Set(ByVal value As String) _Op2NP = value End Set End Property Private _Op3NP As String Public Property Op3NP() As String Get Return _Op3NP End Get Set(ByVal value As String) _Op3NP = value End Set End Property End Class Public Class CombinacionCorrespondenciaRCCaballos Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property DocumentacionEquina As String Property Observaciones As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaTransportesAXA Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property MatriculaRemolque As String Property CalidadTomador As String Property MedioTransporte As String Property CapitalElegido As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaAccidentesIndividualesAXA Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property PropietarioTelefono As String Property PropietarioEmail As String Property PropietarioDomicilio As String Property PropietarioCodigoPostal As String Property PropietarioPoblacion As String Property PropietarioProvincia As String Property PropietarioCodigoMunicipio As String Property CapitalElegido As String Property Observaciones As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaPatinetes Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorCorreo As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property PropietarioTelefono As String Property propietarioCorreo As String Property PropietarioDomicilio As String Property PropietarioCodigoPostal As String Property PropietarioPoblacion As String Property PropietarioProvincia As String Property PropietarioCodigoMunicipio As String Property Producto As String Property Identificador As String Property FechaCompra As String Property PrimaAnualizada As String Property Observaciones As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaCasetasRiegoAXA Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property casetaUbicacion As String Property casetaLocalidad As String Property casetaCodigoPostal As String Property casetaProvincia As String Property EdificiosDescripcion As String Property EdificiosCapital As String Property mobiliarioDescripcion As String Property mobiliarioCapital As String Property existenciasDescripcion As String Property existenciasCapital As String Property capitalElegido As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaSaludMapfre Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property TomadorFechaNacimiento As String Property TomadorSexo As String Property TomadorEstadoCivil As String Property Asegurado1CIF As String Property Asegurado1Nombre As String Property Asegurado1Apellidos As String Property Asegurado1Domicilio As String Property Asegurado1CodigoPostal As String Property Asegurado1Poblacion As String Property Asegurado1Provincia As String Property Asegurado1CodigoMunicipio As String Property Asegurado1Telefono As String Property Asegurado1Email As String Property Asegurado1FechaNacimiento As String Property Asegurado1Sexo As String Property Asegurado1Peso As String Property Asegurado1Estatura As String Property Asegurado1Profesion As String Property Asegurado1Parentesco As String Property Asegurado2CIF As String Property Asegurado2Nombre As String Property Asegurado2Apellidos As String Property Asegurado2Domicilio As String Property Asegurado2CodigoPostal As String Property Asegurado2Poblacion As String Property Asegurado2Provincia As String Property Asegurado2CodigoMunicipio As String Property Asegurado2Telefono As String Property Asegurado2Email As String Property Asegurado2FechaNacimiento As String Property Asegurado2Sexo As String Property Asegurado2Peso As String Property Asegurado2Estatura As String Property Asegurado2Profesion As String Property Asegurado2Parentesco As String Property Asegurado3CIF As String Property Asegurado3Nombre As String Property Asegurado3Apellidos As String Property Asegurado3Domicilio As String Property Asegurado3CodigoPostal As String Property Asegurado3Poblacion As String Property Asegurado3Provincia As String Property Asegurado3CodigoMunicipio As String Property Asegurado3Telefono As String Property Asegurado3Email As String Property Asegurado3FechaNacimiento As String Property Asegurado3Sexo As String Property Asegurado3Peso As String Property Asegurado3Estatura As String Property Asegurado3Profesion As String Property Asegurado3Parentesco As String Property Asegurado4CIF As String Property Asegurado4Nombre As String Property Asegurado4Apellidos As String Property Asegurado4Domicilio As String Property Asegurado4CodigoPostal As String Property Asegurado4Poblacion As String Property Asegurado4Provincia As String Property Asegurado4CodigoMunicipio As String Property Asegurado4Telefono As String Property Asegurado4Email As String Property Asegurado4FechaNacimiento As String Property Asegurado4Sexo As String Property Asegurado4Peso As String Property Asegurado4Estatura As String Property Asegurado4Profesion As String Property Asegurado4Parentesco As String Property pregunta1Asegurado1 As String Property pregunta2Asegurado1 As String Property pregunta3Asegurado1 As String Property pregunta4Asegurado1 As String Property pregunta5Asegurado1 As String Property pregunta1Asegurado2 As String Property pregunta2Asegurado2 As String Property pregunta3Asegurado2 As String Property pregunta4Asegurado2 As String Property pregunta5Asegurado2 As String Property pregunta1Asegurado3 As String Property pregunta2Asegurado3 As String Property pregunta3Asegurado3 As String Property pregunta4Asegurado3 As String Property pregunta5Asegurado3 As String Property pregunta1Asegurado4 As String Property pregunta2Asegurado4 As String Property pregunta3Asegurado4 As String Property pregunta4Asegurado4 As String Property pregunta5Asegurado4 As String Property Observaciones As String Property AsistenciaSanitaria As String Property GarantíaBucodental As String Property ReembolsoGastosCompletos As String Property ReembolsoGastosHospitalarios As String Property ReembolsoGranCobertura As String Property FormaPago As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaFacturaAG Property RazonSocial As String Property CIF As String Property Domicilio As String Property CodigoPostal As String Property PoblacionYProvincia As String Property NumeroFactura As String Property FechaFactura As String Property BaseImponible As String Property PorcentajeIVA As String Property IVA As String Property PorcentajeIRPF As String Property IRPF As String Property Total As String Property EnlaceQR As String Property QRVisible As Boolean End Class Public Class CombinacionCorrespondenciaPolizasG Property NumeroPresupuesto As String Property Compañia As String Property ReferenciaSEPACia As String Property DomicilioCompañia As String Property CodigoPostalCompañia As String Property PoblacionCompañia As String Property ProvinciaCompañia As String Property TelefonoCompañia As String Property FaxCompañia As String Property RazonSocialTomador As String Property DomicilioTomador As String Property CodigoPostalTomador As String Property PoblacionTomador As String Property ProvinciaTomador As String Property TratamientoTomador As String 'Property RazonSocialPagador As String 'Property DomicilioPagador As String 'Property CodigoPostalPagador As String 'Property PoblacionPagador As String 'Property ProvinciaPagador As String 'Property TratamientoPagador As String Property IBAN As String Property TipoPagoSEPA As String Property FechaHoy As String Property BienesAsegurados As String Property MarcaModelo As String Property Agente As String Property DomicilioAgente As String Property CodigoPostalAgente As String Property PoblacionAgente As String Property ProvinciaAgente As String Property Ramo As String Property NumeroPoliza As String End Class Public Class CombinacionCorrespondenciaRecibos Property NumeroPresupuesto As String Property Compañia As String Property ReferenciaSEPACia As String Property DomicilioCompañia As String Property CodigoPostalCompañia As String Property PoblacionCompañia As String Property ProvinciaCompañia As String Property TelefonoCompañia As String Property FaxCompañia As String Property RazonSocialTomador As String Property DomicilioTomador As String Property CodigoPostalTomador As String Property PoblacionTomador As String Property ProvinciaTomador As String Property TratamientoTomador As String Property IBAN As String Property IBAN_Parcial As String Property EntidadBancaria As String Property TipoPagoSEPA As String Property FechaHoy As String Property BienesAsegurados As String Property BienesAseguradosYMatricula As String Property Matricula As String Property Agente As String Property DomicilioAgente As String Property CodigoPostalAgente As String Property PoblacionAgente As String Property ProvinciaAgente As String Property Ramo As String Property NumeroPoliza As String Property NumeroRecibo As String Property ImporteRecibo As String Property FechaEfecto As String Property FechaVencimiento As String Property EntidadBancariaCartaRemesa As String Property SucursalBancariaCartaRemesa As String Property IBANcartaRemesa As String Property FechaBaja As String Property CausaBaja As String 'davrod 2 Property FechaExpedicion As String Property Gestor As String Property Cobrador As String Property TipoPago As String Property NIFCIF As String Property Modalidad As String Property Prima As String Property Consorcio As String Property Impuestos As String Property IPS As String Property Bonificacion As String Property RecargoExterno As String Property PrimaNetaMenosBonificacion As String Property CuotaIPS As String Property LeyendaFamiliaAuto0017 As String Public Property LeyendaCarteraProduccion0017 As String Property FechaEnvioCompania As String Property Suplemento As String Property ReciboAsociado As String Property FechaNacimientoTomador As String Property FechaCarnetTomador As String Property Coberturas As String 'aqui Property Familia As String Property Duracion As String ' no se Property Tipo As String ' no se q va aqui Property FechaPropuesta As String ' no existe Property Remesa As String Property FechaRemesa As String Property FechaPago As String Property FechaDevolucionBanco As String Property CausaDevolucion As String Property FechaDevolucionCompañia As String ' no tengo Property FechaFactura As String Property NumeroLiquidacionCompania As String Property FechaLiquidacionCompania As String Property NumeroLiquidacionAgente As String Property FechaLquidacionAgente As String Property DescripcionRecibo As String Property ImportePrimaNeta As String Property ImporteBonus As String Property ImporteCons As String Property ImporteImp As String Property ImporteRecEx As String Property PorcentajeComisionTotal As String Property TotalCRec As String Property ImporteComisionToRe As String Property porcentajeComisionAgente As String Property ComisionAgente As String Property PorcentajeComisionAgenteS As String Property ComisionAgenteS As String Property ComisionAsegPN As String Property ComisionAsegRe As String Property ComisionAseCo As String Property ComisionAsegTo As String Property FechaContBanco As String Property FechaContCIA As String Property observacion As String Property situacion As String 'fin davrod End Class Public Class CombinacionCorrespondenciaRCSociosZurich Property TipoRC As String Property TomadorCIF As String Property TomadorNombre As String Property TomadorApellidos As String Property TomadorTelefono As String Property TomadorEmail As String Property TomadorDomicilio As String Property TomadorCodigoPostal As String Property tomadorPoblacion As String Property TomadorProvincia As String Property TomadorCodigoMunicipio As String Property PropietarioCIF As String Property PropietarioNombre As String Property PropietarioApellidos As String Property PropietarioTelefono As String Property propietarioCorreo As String Property PropietarioDomicilio As String Property PropietarioCodigoPostal As String Property PropietarioPoblacion As String Property PropietarioProvincia As String Property PropietarioCodigoMunicipio As String Property Dehesa As String Property SuperficieCosechable As String Property CotoDeCaza As String Property VidaPrivada As String Property CabezasVacuno As String Property CabezasOvino As String Property CabezasPorcino As String Property CabezasEquino As String Property CabezasGanadoBravo As String Property NumeroRega As String Property CodigoGanadero As String Property SumaContratar As String Property Observaciones As String Property FormaPago As String Property OpcionA As String Property OpcionB As String Property OpcionC As String Property PrimaNetaA As String Property PrimaNetaB As String Property PrimaNetaC As String Property ImpuestosA As String Property ImpuestosB As String Property ImpuestosC As String Property PrimaTotalA As String Property PrimaTotalB As String Property PrimaTotalC As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaTractoresEuropAssistance Property Matricula As String Property Marca As String Property Modelo As String Property Version As String Property FechaMatriculacion As String Property CIF As String Property RazonSocial As String 'Property Nombre As String 'Property Apellido1 As String 'Property Apellido2 As String Property FechaNacimiento As String Property EstadoCivil As String Property Sexo As String Property Telefono1 As String Property Telefono2 As String Property Email As String Property Direccion As String 'Property TipoVia As String 'Property NombreVia As String 'Property RestoVia As String Property CodigoPostal As String Property CodigoPoblacion As String Property Poblacion As String Property CodigoProvincia As String Property Provincia As String Property IBAN As String Property FechaEfecto As String Property FechaVencimiento As String End Class Public Class CombinacionCorrespondenciaSiniestros Property DomicilioAsegasa As String Property CodigoPostalAsegasa As String Property PoblacionAsegasa As String Property ProvinciaAsegasa As String Property RazonSocialTomador As String Property ApellidosTomador As String Property NombreTomador As String Property DomicilioTomador As String Property CodigoPostalTomador As String Property PoblacionTomador As String Property ProvinciaTomador As String Property TratamientoTomador As String Property FechaHoy As String Property NumeroSiniestro As String Property FechaAccidente As String Property Matrícula As String Property ReferenciaCompañía As String Property Agente As String Property DomicilioAgente As String Property CodigoPostalAgente As String Property PoblacionAgente As String Property ProvinciaAgente As String Property Ramo As String Property NumeroPoliza As String Property compania As String Property Domiciliocompania As String Property CodigoPostalcompania As String Property Poblacioncompania As String Property Provinciacompania As String Property Telefonocompania As String Property Faxcompania As String Property Taller As String Property DomicilioTaller As String Property PoblacionTaller As String Property CodigoPostalTaller As String Property ProvinciaTaller As String Property TelefonoTaller As String Property RazonSocialContrario As String Property NombreContrario As String Property ApellidosContrario As String Property DomicilioContrario As String Property PoblacionContrario As String Property CodigoPostalContrario As String Property ProvinciaContrario As String Property TratamientoContrario As String Property MatriculaContrario As String Property OficinaAgente As String End Class Public Class Utilidades Public Shared Function ObtieneCCSiniestros(ListaSiniestros As List(Of siniestros)) As List(Of CombinacionCorrespondenciaSiniestros) Try DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCS As New List(Of CombinacionCorrespondenciaSiniestros) Dim ccs As CombinacionCorrespondenciaSiniestros Dim i As Integer = 0 Dim n As Integer = ListaSiniestros.Count 'Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each s In ListaSiniestros i += 1 DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccs = New CombinacionCorrespondenciaSiniestros With ccs .DomicilioAsegasa = bd.enumeraciones.First(Function(X) X.Codigo = "DATEMP.DOMICILIO").ValorAlfabeticoLargo .CodigoPostalAsegasa = bd.enumeraciones.First(Function(X) X.Codigo = "DATEMP.CPO").ValorAlfabeticoLargo .PoblacionAsegasa = bd.enumeraciones.First(Function(X) X.Codigo = "DATEMP.POBLACION").ValorAlfabeticoLargo .ProvinciaAsegasa = bd.enumeraciones.First(Function(X) X.Codigo = "DATEMP.PROVINCIA").ValorAlfabeticoLargo .RazonSocialTomador = s.polizassg.Tomador.RazonSocial .ApellidosTomador = s.polizassg.Tomador.Apellidos .NombreTomador = s.polizassg.Tomador.Nombre If s.polizassg.Tomador.direcciones.Count > 0 Then If s.polizassg.Tomador.direcciones.Count = 1 Or s.polizassg.Tomador.direcciones.ToList.Where(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO").Count = 0 Then .DomicilioTomador = s.polizassg.Tomador.direcciones.First.Direccion .CodigoPostalTomador = s.polizassg.Tomador.direcciones.First.CodigoPostal .PoblacionTomador = s.polizassg.Tomador.direcciones.First.municipios.Nombre .ProvinciaTomador = s.polizassg.Tomador.direcciones.First.municipios.provincias.Nombre .TratamientoTomador = "" Else Dim dir = s.polizassg.Tomador.direcciones.First(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO") .DomicilioTomador = dir.Direccion .CodigoPostalTomador = dir.CodigoPostal .PoblacionTomador = dir.municipios.Nombre .ProvinciaTomador = dir.municipios.provincias.Nombre .TratamientoTomador = "" End If End If .TratamientoTomador = "Distinguido Sr." .FechaHoy = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) .NumeroSiniestro = s.idSiniestro.ToString .FechaAccidente = tsl5.Utilidades.FechaEnCastellano(s.FechaAccidente, tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) .Matrícula = s.polizassg.Matricula .ReferenciaCompañía = s.ReferenciaCompania .Agente = s.polizassg.agentes.Nombre .OficinaAgente = s.polizassg.agentes.OficinaAgente If s.polizassg.agentes.idDireccion.HasValue Then .DomicilioAgente = s.polizassg.agentes.direcciones.Direccion .CodigoPostalAgente = s.polizassg.agentes.direcciones.CodigoPostal .PoblacionAgente = s.polizassg.agentes.direcciones.municipios.Nombre .ProvinciaAgente = s.polizassg.agentes.direcciones.municipios.provincias.Nombre End If .Ramo = s.polizassg.ramos.Descripcion .NumeroPoliza = s.polizassg.NumeroPoliza .compania = s.polizassg.companias.Nombre If s.polizassg.companias.idDireccion.HasValue Then .Domiciliocompania = s.polizassg.companias.direcciones.Direccion .CodigoPostalcompania = s.polizassg.companias.direcciones.CodigoPostal .Poblacioncompania = s.polizassg.companias.direcciones.municipios.Nombre .Provinciacompania = s.polizassg.companias.direcciones.municipios.provincias.Nombre End If .Telefonocompania = s.polizassg.companias.Telefono1 .Faxcompania = s.polizassg.companias.Fax If s.idEntidadTaller.HasValue Then .Taller = s.entidades1.RazonSocial If s.entidades1.direcciones.Count > 0 Then If s.entidades1.direcciones.Count = 1 Then Dim dirt = s.entidades1.direcciones.First .DomicilioTaller = dirt.Direccion .CodigoPostalTaller = dirt.CodigoPostal .PoblacionTaller = If(dirt.municipios Is Nothing, "", dirt.municipios.Nombre) .ProvinciaTaller = If(dirt.municipios Is Nothing, "", dirt.municipios.provincias.Nombre) Else Dim dir As direcciones If s.entidades1.direcciones.Any(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO") Then dir = s.entidades1.direcciones.First(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO") Else dir = s.entidades1.direcciones.First End If .DomicilioTaller = dir.Direccion .CodigoPostalTaller = dir.CodigoPostal .PoblacionTaller = dir.municipios.Nombre .ProvinciaTaller = dir.municipios.provincias.Nombre End If End If End If If s.idEntidadContrario.HasValue Then If s.entidades.direcciones.Count > 0 Then If s.entidades.direcciones.Count = 1 OrElse s.entidades.direcciones.Where(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO").Count = 0 Then .DomicilioContrario = s.entidades.direcciones.First.Direccion .CodigoPostalContrario = s.entidades.direcciones.First.CodigoPostal If s.entidades.direcciones.First.municipios IsNot Nothing Then .PoblacionContrario = s.entidades.direcciones.First.municipios.Nombre .ProvinciaContrario = s.entidades.direcciones.First.municipios.provincias.Nombre End If Else Dim dir = s.entidades.direcciones.First(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO") .DomicilioContrario = dir.Direccion .CodigoPostalContrario = dir.CodigoPostal .PoblacionContrario = dir.municipios.Nombre .ProvinciaContrario = dir.municipios.provincias.Nombre End If End If End If .MatriculaContrario = s.MatriculaContrario End With ListaCCS.Add(ccs) Next Return ListaCCS Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Public Shared Function ObtieneCCFacturaAG(Liquidacion As liquidacionesagentes, Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaFacturaAG) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCC As New List(Of CombinacionCorrespondenciaFacturaAG) Dim cc As New CombinacionCorrespondenciaFacturaAG Dim confsi = enumeraciones.LConfsi.Where(Function(x) x.Fecha1.HasValue AndAlso x.Fecha1 <= Liquidacion.FechaFactura.Value).OrderBy(Function(x) x.Fecha1).FirstOrDefault With cc .NumeroFactura = Liquidacion.NumeroFactura .FechaFactura = Liquidacion.FechaFactura.Value.ToString("dd/MM/yyyy") .CIF = Liquidacion.CIF .RazonSocial = Liquidacion.RazonSocial .PoblacionYProvincia = If(Liquidacion.agentes.direcciones IsNot Nothing AndAlso Liquidacion.agentes.direcciones.municipios IsNot Nothing, Liquidacion.agentes.direcciones.municipios.PoblacionYProvincia, "* Desconocida *") .CodigoPostal = If(Liquidacion.agentes.direcciones IsNot Nothing, Liquidacion.agentes.direcciones.CodigoPostal, "* Desconocido * ") .Domicilio = If(Liquidacion.agentes.direcciones IsNot Nothing, Liquidacion.agentes.direcciones.Direccion, "* Desconocido *") .BaseImponible = Math.Round(Liquidacion.BaseImponible, 2, MidpointRounding.AwayFromZero).ToString("N2") .PorcentajeIRPF = If(Liquidacion.PorcentajeIRPF.HasValue, Math.Round(Liquidacion.PorcentajeIRPF.Value, 2, MidpointRounding.AwayFromZero).ToString("N2"), "0") .IRPF = Math.Round(Liquidacion.IRPF, 2, MidpointRounding.AwayFromZero).ToString("N2") .PorcentajeIVA = If(Liquidacion.PorcentajeIVA.HasValue, Math.Round(Liquidacion.PorcentajeIVA.Value, 2, MidpointRounding.AwayFromZero).ToString("N2"), "0") .IVA = Math.Round(Liquidacion.IVA, 2, MidpointRounding.AwayFromZero).ToString("N2") .Total = Math.Round(Liquidacion.Importe, 2, MidpointRounding.AwayFromZero).ToString("c2") .EnlaceQR = Liquidacion.EnlaceQR .QRVisible = Liquidacion.QRVisible End With ListaCC.Add(cc) Return ListaCC Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCPolizasG(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaPolizasG) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaPolizasG) Dim ccp As CombinacionCorrespondenciaPolizasG Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaPolizasG Dim domTomador = p.entidadespolizas.First(Function(x) x.EsTomador = True) With ccp .TipoPagoSEPA = "Pago recurrente" .IBAN = p.IBAN .RazonSocialTomador = If(p.Tomador.RazonSocial.NothingAVacio = "", p.Tomador.Apellidos & ", " & p.Tomador.Nombre, p.Tomador.RazonSocial) .DomicilioTomador = domTomador.direcciones.Direccion .CodigoPostalTomador = domTomador.direcciones.CodigoPostal .PoblacionTomador = domTomador.direcciones.municipios.Nombre .ProvinciaTomador = domTomador.direcciones.municipios.provincias.Nombre .TratamientoTomador = "" 'If p.entidades.direcciones.Count > 0 Then ' If p.entidades.direcciones.Count = 1 Or p.entidades.direcciones.ToList.Where(Function(x) x.idTipo.HasValue AndAlso x.enumeraciones.Codigo = "TIPDIR.CORREO").Count = 0 Then ' .DomicilioTomador = p.entidades.direcciones.First.Direccion ' .CodigoPostalTomador = p.entidades.direcciones.First.CodigoPostal ' .PoblacionTomador = p.entidades.direcciones.First.municipios.Nombre ' .ProvinciaTomador = p.entidades.direcciones.First.municipios.provincias.Nombre ' .TratamientoTomador = "" ' Else ' Dim dir = p.entidades.direcciones.First(Function(x) x.enumeraciones.Codigo = "TIPDIR.CORREO") ' .DomicilioTomador = dir.Direccion ' .CodigoPostalTomador = dir.CodigoPostal ' .PoblacionTomador = dir.municipios.Nombre ' .ProvinciaTomador = dir.municipios.provincias.Nombre ' .TratamientoTomador = "" ' End If 'Else ' If p.entidades.direcciones1 IsNot Nothing Then ' .DomicilioTomador = p.entidades.direcciones1.Direccion ' .CodigoPostalTomador = p.entidades.direcciones1.CodigoPostal ' .PoblacionTomador = p.entidades.direcciones1.municipios.Nombre ' .ProvinciaTomador = p.entidades.direcciones1.municipios.provincias.Nombre ' .TratamientoTomador = "" ' End If 'End If .TratamientoTomador = "Distinguido Sr." .FechaHoy = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) .Agente = p.agentes.Nombre If p.agentes.idDireccion.HasValue Then .DomicilioAgente = p.agentes.direcciones.Direccion .CodigoPostalAgente = p.agentes.direcciones.CodigoPostal .PoblacionAgente = p.agentes.direcciones.municipios.Nombre .ProvinciaAgente = p.agentes.direcciones.municipios.provincias.Nombre End If .Ramo = p.ramos.Descripcion .NumeroPoliza = p.NumeroPoliza .NumeroPresupuesto = p.idPoliza .Compañia = p.companias.Nombre If p.companias.idDireccion.HasValue Then .DomicilioCompañia = p.companias.direcciones.Direccion .CodigoPostalCompañia = p.companias.direcciones.CodigoPostal .PoblacionCompañia = p.companias.direcciones.municipios.Nombre .ProvinciaCompañia = p.companias.direcciones.municipios.provincias.Nombre End If .TelefonoCompañia = p.companias.Telefono1 .FaxCompañia = p.companias.Fax .ReferenciaSEPACia = p.idPoliza.ToString .FechaHoy = Now.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Public Shared Function ObtieneCCPagosTelematicos(ListaPagos As List(Of pagostelematicos), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaPagosTelematicos) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCR As New List(Of CombinacionCorrespondenciaPagosTelematicos) Dim ccp As CombinacionCorrespondenciaPagosTelematicos Dim i As Integer = 0 Dim n As Integer = ListaPagos.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPagos i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaPagosTelematicos With ccp End With ListaCCR.Add(ccp) Next Return ListaCCR Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Public Shared Function ObtieneCCRecibos(ListaRecibos As List(Of recibos), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRecibos) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCR As New List(Of CombinacionCorrespondenciaRecibos) Dim ccr As CombinacionCorrespondenciaRecibos Dim i As Integer = 0 Dim n As Integer = ListaRecibos.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim sIBAN_se = Regex.Replace(bd.enumeraciones.First(Function(x) x.Codigo = "DATEMP.IBAN-CR-SE").ValorAlfabetico1, ".{4}", "$0 ").Trim Dim sentb_se = bd.enumeraciones.First(Function(x) x.Codigo = "DATEMP.ENTB-CR-SE").ValorAlfabetico1 Dim ssucb_se = bd.enumeraciones.First(Function(x) x.Codigo = "DATEMP.SUCB-CR-SE").ValorAlfabetico1 Dim sIBAN_an = Regex.Replace(bd.enumeraciones.First(Function(x) x.Codigo = "DATEMP.IBAN-CR-AN").ValorAlfabetico1, ".{4}", "$0 ").Trim Dim sentb_an = bd.enumeraciones.First(Function(x) x.Codigo = "DATEMP.ENTB-CR-AN").ValorAlfabetico1 Dim ssucb_an = bd.enumeraciones.First(Function(x) x.Codigo = "DATEMP.SUCB-CR-AN").ValorAlfabetico1 Dim idFamiliaAuto = bd.enumeraciones.First(Function(x) x.Codigo = "FAMRAM.AU").idEnumeracion Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each r In ListaRecibos Dim p = r.polizassg i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccr = New CombinacionCorrespondenciaRecibos Dim domTomador = p.entidadespolizas.First(Function(x) x.EsTomador = True) With ccr .TipoPagoSEPA = "Pago recurrente" .IBAN = r.IBAN .IBAN_Parcial = r.IBAN_Parcial .EntidadBancaria = r.Banco .RazonSocialTomador = If(p.Tomador.RazonSocial.NothingAVacio = "", p.Tomador.Apellidos & ", " & p.Tomador.Nombre, p.Tomador.RazonSocial) 'davrod If p.Tomador.FechaNacimiento.HasValue Then .FechaNacimientoTomador = p.Tomador.FechaNacimiento End If .FechaCarnetTomador = If(p.Tomador.FechaExpedicionCarnet.HasValue, p.Tomador.FechaExpedicionCarnet.Value.ToString("dd/MM/yyyy"), "") .Coberturas = p.Coberturas .FechaPropuesta = If(p.FechaAlta.HasValue, p.FechaAlta.Value.ToString("dd/MM/yyyy"), "") .Remesa = If(r.idRemesa.HasValue, r.idRemesa, "") .FechaRemesa = If(r.idRemesa.HasValue AndAlso r.remesas.Fecha.HasValue, r.remesas.Fecha.Value.ToString("dd/MM/yyyy"), "") .FechaPago = If(r.FechaPago.HasValue, r.FechaPago.Value.ToString("dd/MM/yyyy"), "") If r.FechaDevolucionBanco.HasValue Then .FechaDevolucionBanco = r.FechaDevolucionBanco End If .CausaDevolucion = r.CausaDevolucion .FechaFactura = If(r.FechaFacturacion.HasValue, r.FechaFacturacion.Value.ToString("dd/MM/yyyy"), "") .ImporteBonus = r.BonificacionORecargo.Value.ToString("c2") .ImporteCons = r.Consorcio.Value.ToString("c2") .ImporteImp = r.Impuesto.Value.ToString("c2") .ImporteRecEx = r.RecargoExterno.Value.ToString("c2") .PorcentajeComisionTotal = r.PorcentajeReciboPrimaNeta.Value.ToString("c2") .TotalCRec = r.ComisionReciboPrimaNeta.Value.ToString("c2") .ImporteComisionToRe = r.TotalComision.Value.ToString("c2") .porcentajeComisionAgente = r.PorcentajeComisionAgente.Value.ToString("c2") .ComisionAgente = r.ComisionAgente.Value.ToString("c2") .ComisionAsegPN = r.ComisionAsegasaPrimaNeta.Value.ToString("c2") .ComisionAsegRe = r.AsegasaRecargoExterno.Value.ToString("c2") .ComisionAseCo = r.AsegasaComisionConsorcio.Value.ToString("c2") .ComisionAsegTo = r.AsegasaComisionTotal.Value.ToString("c2") .observacion = r.Observaciones 'fin davrod Try .DomicilioTomador = domTomador.direcciones.Direccion .CodigoPostalTomador = domTomador.direcciones.CodigoPostal .PoblacionTomador = If(domTomador.direcciones IsNot Nothing AndAlso domTomador.direcciones.municipios IsNot Nothing, domTomador.direcciones.municipios.Nombre, "") .ProvinciaTomador = If(domTomador.direcciones IsNot Nothing AndAlso domTomador.direcciones.municipios IsNot Nothing AndAlso domTomador.direcciones.municipios.provincias IsNot Nothing, domTomador.direcciones.municipios.provincias.Nombre, "") Catch ex As Exception End Try .TratamientoTomador = "Muy Sr. nuestro" If p.Tomador.Sexo = "MUJER" Then .TratamientoTomador = "Muy Sra. Nuestra" .FechaHoy = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) .Agente = r.agentes.Nombre If r.agentes.idDireccion.HasValue Then .DomicilioAgente = r.agentes.direcciones.Direccion .CodigoPostalAgente = r.agentes.direcciones.CodigoPostal .PoblacionAgente = If(r.agentes.idDireccion.HasValue AndAlso r.agentes.direcciones.municipios IsNot Nothing, r.agentes.direcciones.municipios.Nombre, "") .ProvinciaAgente = If(r.agentes.idDireccion.HasValue AndAlso r.agentes.direcciones.municipios IsNot Nothing, r.agentes.direcciones.municipios.provincias.Nombre, "") End If .Ramo = p.ramos.Descripcion .NumeroPoliza = p.NumeroPoliza .NumeroPresupuesto = p.idPoliza .Compañia = p.companias.Nombre .ReferenciaSEPACia = p.idPoliza.ToString .FechaHoy = Now.ToShortDateString 'davrod2 .FechaEnvioCompania = r.FechaRecepcionCia .Suplemento = r.DescripcionSuplemento ' .ReciboAsociado = r.recibos2.NumeroRecibo ' bd.recibos.First(Function(x) x.idRecibo = r.idReciboAsociado).NumeroRecibo If p.ramos.idFamiliaRamo.HasValue Then .Familia = bd.enumeraciones.First(Function(x) x.idEnumeracion = p.ramos.idFamiliaRamo).Descripcion End If '.Duracion = bd.recibos.First(Function(x) x.idRecibo = r.idRecibo).du 'fin davrod2 If p.companias.idDireccion.HasValue Then .DomicilioCompañia = p.companias.direcciones.Direccion .CodigoPostalCompañia = p.companias.direcciones.CodigoPostal If p.companias.direcciones.municipios IsNot Nothing Then .PoblacionCompañia = p.companias.direcciones.municipios.Nombre .ProvinciaCompañia = p.companias.direcciones.municipios.provincias.Nombre End If End If .TelefonoCompañia = p.companias.Telefono1 .FaxCompañia = p.companias.Fax .ImporteRecibo = r.TotalRecibo.Value.ToString("c2") .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString 'Davrod .LeyendaFamiliaAuto0017 = If(p.ramos.idFamiliaRamo = idFamiliaAuto, "CERTIFICADO INTERNACIONAL VÁLIDO POR EL PERIODO DE COBERTURA DEL RECIBO", "") .LeyendaCarteraProduccion0017 = If(r.enumeraciones1.ValorNumerico1 = 1, "Recibo de renovación", "Recibo de producción") .FechaExpedicion = r.FechaExpedicion .IBAN = r.IBAN .Consorcio = r.Consorcio .Impuestos = r.Impuesto .Prima = r.PrimaNeta 'Hacer case por compañia .Modalidad = p.ramos.Descripcion .BienesAsegurados = p.BienesAsegurados .BienesAseguradosYMatricula = If(p.BienesAsegurados.NothingAVacio.Contains(p.Matricula.NothingAVacio), p.BienesAsegurados.NothingAVacio, p.BienesAsegurados.NothingAVacio & " " & p.Matricula.NothingAVacio) .NIFCIF = r.polizassg.Tomador.CIF .Bonificacion = r.BonificacionORecargo .RecargoExterno = r.RecargoExterno .TipoPago = p.TipoCobro .RecargoExterno = r.RecargoExterno .PrimaNetaMenosBonificacion = r.PrimaNeta - r.BonificacionORecargo .CuotaIPS = .PrimaNetaMenosBonificacion * 0.06 Dim Compania As String Compania = p.companias.Codigo Select Case Compania Case "0002" 'Plus ultra .Gestor = "X41235" 'Plus ultra .Cobrador = "X41235" ' Plus ultra Case "0017" .Gestor = "4100017" 'Caser .Cobrador = "4100" 'Caser End Select 'Fin davrod .EntidadBancariaCartaRemesa = If(r.OficinaAgente.ToLower = "sevilla", sentb_se, sentb_an) .SucursalBancariaCartaRemesa = If(r.OficinaAgente.ToLower = "sevilla", ssucb_se, ssucb_an) .IBANcartaRemesa = If(r.OficinaAgente.ToLower = "sevilla", sIBAN_se, sIBAN_an) .BienesAsegurados = p.BienesAsegurados .Matricula = p.Matricula .NumeroRecibo = r.NumeroRecibo If r.FechaBaja.HasValue Then .FechaBaja = r.FechaBaja.Value.ToShortDateString .CausaBaja = r.CausaBaja End With ListaCCR.Add(ccr) Next Return ListaCCR Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCRCSociosCaser(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRCSociosCaser) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaRCSociosCaser) Dim ccp As CombinacionCorrespondenciaRCSociosCaser Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaRCSociosCaser With ccp Dim r = p.RcSociosCaser .Nombre = r.Nombre .Situacion = r.Situacion .TMunicipal = r.TMunicipal .FProvincia = r.FProvincia .Equino = r.Equino .VacunoManso = r.VacunoManso .Porcino = r.Porcino .OvinoCaprino = r.OvinoCaprino .Aviar = r.Aviar .Cunicula = r.Cunicula .TotalGanado = r.TotalGanado .VacunoBravo = r.VacunoBravo .MenorSinJabalies = r.MenorSinJabalies.ToString("n2") .MenorConJabalies = r.MenorConJabalies.ToString("n2") .MayorSinMalla = r.MayorSinMalla.ToString("n2") .MayorConMalla = r.MayorConMalla.ToString("n2") .HasLabor = r.HasLabor.ToString("n2") .HasDehesa = r.HasDehesa.ToString("n2") .TotalSuperficie = r.TotalSuperficie.ToString("n2") .OpcionElegida = r.OpcionElegida .Total = r.Total .IBAN = r.IBAN .DañosMateriales1 = r.DañosMateriales1.ToString("n2") .DañosMateriales2 = r.DañosMateriales2.ToString("n2") .DañosMateriales3 = r.DañosMateriales3.ToString("n2") .DañosMateriales4 = r.DañosMateriales4.ToString("n2") .DañosMateriales5 = r.DañosMateriales5.ToString("n2") .DañosMateriales6 = r.DañosMateriales6.ToString("n2") .Sublimite1 = r.Sublimite1.ToString("n2") .Sublimite2 = r.Sublimite2.ToString("n2") .Sublimite3 = r.Sublimite3.ToString("n2") .Sublimite4 = r.Sublimite4.ToString("n2") .Sublimite5 = r.Sublimite5.ToString("n2") .Sublimite6 = r.Sublimite6.ToString("n2") .Patronal1 = r.Patronal1.ToString("n2") .Patronal2 = r.Patronal2.ToString("n2") .Patronal3 = r.Patronal3.ToString("n2") .Patronal4 = r.Patronal4.ToString("n2") .Patronal5 = r.Patronal5.ToString("n2") .Patronal6 = r.Patronal6.ToString("n2") .PNetaLabor1 = r.PNetaLabor1.ToString("n2") .PNetaLabor2 = r.PNetaLabor2.ToString("n2") .PNetaLabor3 = r.PNetaLabor3.ToString("n2") .PNetaLabor4 = r.PNetaLabor4.ToString("n2") .PNetaLabor5 = r.PNetaLabor5.ToString("n2") .PNetaLabor6 = r.PNetaLabor6.ToString("n2") .PNetaGanado1 = r.PNetaGanado1.ToString("n2") .PNetaGanado2 = r.PNetaGanado2.ToString("n2") .PNetaGanado3 = r.PNetaGanado3.ToString("n2") .PNetaGanado4 = r.PNetaGanado4.ToString("n2") .PNetaGanado5 = r.PNetaGanado5.ToString("n2") .PNetaGanado6 = r.PNetaGanado6.ToString("n2") .PNetaGanaderia1 = r.PNetaGanaderia1.ToString("n2") .PNetaGanaderia2 = r.PNetaGanaderia2.ToString("n2") .PNetaGanaderia3 = r.PNetaGanaderia3.ToString("n2") .PNetaGanaderia4 = r.PNetaGanaderia4.ToString("n2") .PNetaGanaderia5 = r.PNetaGanaderia5.ToString("n2") .PNetaGanaderia6 = r.PNetaGanaderia6.ToString("n2") .PSubtotal1 = r.PSubtotal1.ToString("n2") .PSubtotal2 = r.PSubtotal2.ToString("n2") .PSubtotal3 = r.PSubtotal3.ToString("n2") .PSubtotal4 = r.PSubtotal4.ToString("n2") .PSubtotal5 = r.PSubtotal5.ToString("n2") .PSubtotal6 = r.PSubtotal6.ToString("n2") .MenorSinJabalies1 = r.MenorSinJabalies1.ToString("n2") .MenorSinJabalies2 = r.MenorSinJabalies2.ToString("n2") .MenorSinJabalies3 = r.MenorSinJabalies3.ToString("n2") .MenorSinJabalies4 = r.MenorSinJabalies4.ToString("n2") .MenorSinJabalies5 = r.MenorSinJabalies5.ToString("n2") .MenorSinJabalies6 = r.MenorSinJabalies6.ToString("n2") .MenorConJabalies1 = r.MenorConJabalies1.ToString("n2") .MenorConJabalies2 = r.MenorConJabalies2.ToString("n2") .MenorConJabalies3 = r.MenorConJabalies3.ToString("n2") .MenorConJabalies4 = r.MenorConJabalies4.ToString("n2") .MenorConJabalies5 = r.MenorConJabalies5.ToString("n2") .MenorConJabalies6 = r.MenorConJabalies6.ToString("n2") .MayorSinMalla1 = r.MayorSinMalla1.ToString("n2") .MayorSinMalla2 = r.MayorSinMalla2.ToString("n2") .MayorSinMalla3 = r.MayorSinMalla3.ToString("n2") .MayorSinMalla4 = r.MayorSinMalla4.ToString("n2") .MayorSinMalla5 = r.MayorSinMalla5.ToString("n2") .MayorSinMalla6 = r.MayorSinMalla6.ToString("n2") .MayorConMalla1 = r.MayorConMalla1.ToString("n2") .MayorConMalla2 = r.MayorConMalla2.ToString("n2") .MayorConMalla3 = r.MayorConMalla3.ToString("n2") .MayorConMalla4 = r.MayorConMalla4.ToString("n2") .MayorConMalla5 = r.MayorConMalla5.ToString("n2") .MayorConMalla6 = r.MayorConMalla6.ToString("n2") .CotosSubtotal1 = r.CotosSubtotal1.ToString("n2") .CotosSubtotal2 = r.CotosSubtotal2.ToString("n2") .CotosSubtotal3 = r.CotosSubtotal3.ToString("n2") .CotosSubtotal4 = r.CotosSubtotal4.ToString("n2") .CotosSubtotal5 = r.CotosSubtotal5.ToString("n2") .CotosSubtotal6 = r.CotosSubtotal6.ToString("n2") .PNeta1 = r.PNeta1.ToString("n2") .PNeta2 = r.PNeta2.ToString("n2") .PNeta3 = r.PNeta3.ToString("n2") .PNeta4 = r.PNeta4.ToString("n2") .PNeta5 = r.PNeta5.ToString("n2") .PNeta6 = r.PNeta6.ToString("n2") .Impuestos1 = r.Impuestos1.ToString("n2") .Impuestos2 = r.Impuestos2.ToString("n2") .Impuestos3 = r.Impuestos3.ToString("n2") .Impuestos4 = r.Impuestos4.ToString("n2") .Impuestos5 = r.Impuestos5.ToString("n2") .Impuestos6 = r.Impuestos6.ToString("n2") .PTotal1 = r.PTotal1.ToString("n2") .PTotal2 = r.PTotal2.ToString("n2") .PTotal3 = r.PTotal3.ToString("n2") .PTotal4 = r.PTotal4.ToString("n2") .PTotal5 = r.PTotal5.ToString("n2") .PTotal6 = r.PTotal6.ToString("n2") .AseguradoCIF = r.AseguradoCIF .AseguradoNombre = r.AseguradoNombre .AseguradoApellidos = r.AseguradoApellidos .AseguradoDireccion = r.AseguradoDireccion .AseguradoCodigoPostal = r.AseguradoCodigoPostal .AseguradoTelefono1 = r.AseguradoTelefono1 .AseguradoTelefono2 = r.AseguradoTelefono2 .AseguradoCorreo = r.AseguradoCorreo .Descripcion = r.Descripcion .FechaEfecto = p.FechaEfecto.ToShortDateString() .FechaVencimiento = p.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCRCMaquinariaAgricola(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRCMaquinariaAgricola) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaRCMaquinariaAgricola) Dim ccp As CombinacionCorrespondenciaRCMaquinariaAgricola Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaRCMaquinariaAgricola With ccp Dim r = p.RCMaquinariaAgricola .AseguradoCIF = r.AseguradoCIF .AseguradoNombre = r.AseguradoNombre .AseguradoApellidos = r.AseguradoApellidos .AseguradoDireccion = r.AseguradoDireccion .AseguradoCodigoPostal = r.AseguradoCodigoPostal .AseguradoTelefono1 = r.AseguradoTelefono1 .AseguradoTelefono2 = r.AseguradoTelefono2 .AseguradoCorreo = r.AseguradoCorreo .aseguradoPoblacion = r.AseguradoPoblacion .FechaEfecto = p.FechaEfecto.ToShortDateString() .FechaVencimiento = p.FechaVencimiento.ToShortDateString .IBAN = r.IBAN .Cobertura = r.Cobertura .Elegida = r.Elegida .PrimaTotal = r.PrimaTotal .Matricula = r.Matricula End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCCertificadoTractores(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaCertificadoTractores) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaCertificadoTractores) Dim ccp As CombinacionCorrespondenciaCertificadoTractores Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaCertificadoTractores Dim fechaHoraEfecto As String = "" If p.FechaEfecto = Today.Date Then Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() Else Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.Tractores .fechaCabecera = fechaCabecera .NumeroPoliza = p.NumeroPoliza .Mediador = p.agentes.Nombre .vehiculoAsegurado = String.Format("{0} {1} {2}", p.Tractores.Marca, p.Tractores.Modelo, p.Tractores.Version).Trim() .plazasAseguradas = 2 .matricula = p.Matricula .tomadorDeLaPoliza = p.Tomador.RazonSocial .propietarioDelVehiculo = p.Propietario.RazonSocial .conductor = p.Conductor.RazonSocial .diayHora = fechaHoraEfecto .lugaryFecha = String.Format("Sevilla, {0} {1}", Today.ToLongDateString, Now.ToLongTimeString).Trim() End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCCertificadoRemolques(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaCertificadoTractores) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaCertificadoTractores) Dim ccp As CombinacionCorrespondenciaCertificadoTractores Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaCertificadoTractores Dim fechaHoraEfecto As String = "" If p.FechaEfecto = Today.Date Then Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() Else Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.Tractores .fechaCabecera = fechaCabecera .NumeroPoliza = p.NumeroPoliza .Mediador = p.agentes.Nombre .vehiculoAsegurado = String.Format("{0} {1} {2}", p.Tractores.Marca, p.Tractores.Modelo, p.Tractores.Version).Trim() .plazasAseguradas = 0 .matricula = p.Matricula .tomadorDeLaPoliza = p.Tomador.RazonSocial .propietarioDelVehiculo = p.Propietario.RazonSocial .conductor = p.Conductor.RazonSocial .diayHora = fechaHoraEfecto .lugaryFecha = String.Format("Sevilla, {0} {1}", Today.ToLongDateString, Now.ToLongTimeString).Trim() End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCPresupuestoTractores(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaPresupuestoTractores) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaPresupuestoTractores) Dim ccp As CombinacionCorrespondenciaPresupuestoTractores Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaPresupuestoTractores Dim fechaHoraEfecto As String = "" If p.FechaEfecto = Today.Date Then Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() Else Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.Tractores .TomadorCIF = r.TomadorDocumento .TomadorNombre = r.TomadorNombre .TomadorApellidos = (r.TomadorApellido1 + " " + r.TomadorApellido2).Trim .TomadorTelefono = r.Telefono2 .TomadorDomicilio = (r.TomadorVia + " " + r.TomadorNombreVia + " " + r.TomadorNumeroVia + " " + r.TomadorRestoVia).Trim .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .PropietarioCIF = r.PropietarioDocumento .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = (r.PropietarioApellido1 + r.PropietarioApellido2).Trim .ConductorCIF = r.ConductorDocumento .ConductorNombre = r.ConductorNombre .ConductorApellidos = (r.ConductorApellido1 + r.ConductorApellido2).Trim .ConductorFechaPermisoConducir = r.FechaPermisoConduccion .Matricula = p.Matricula .Marca = r.Marca .Modelo = r.Modelo + " " + r.Version .FechaMatriculacion = r.FechaPrimeraMatriculacion .IBAN = r.IBAN .Peso = r.Peso .FechaEfecto = r.FechaEfecto End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCRCCotosCazaCaser(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRCCotosCazaCaser) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaRCCotosCazaCaser) Dim ccp As CombinacionCorrespondenciaRCCotosCazaCaser Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaRCCotosCazaCaser 'Dim fechaHoraEfecto As String = "" 'If p.FechaEfecto = Today.Date Then ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() 'Else ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() 'End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.RCCotosCazaCaser .NumeroHectareas = r.NumeroHectareas .OpcionA = r.OpcionA .OpcionB = r.OpcionB .OpcionC = r.OpcionC .LimitePorSiniestro = r.LimitePorSiniestro .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .PropietarioCIF = r.PropietarioCIF .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = r.PropietarioApellidos .PropietarioTelefono = r.PropietarioTelefono .PropietarioDomicilio = r.PropietarioDomicilio .PropietarioCodigoPostal = r.PropietarioCodigoPostal .PropietarioPoblacion = r.PropietarioPoblacion .PropietarioProvincia = r.PropietarioProvincia .RiesgoSituacion = r.RiesgoSituacion .RiesgoCodigoPostal = r.RiesgoCodigoPostal .RiesgoPoblacion = r.RiesgoPoblacion .RiesgoProvincia = r.RiesgoProvincia .RiesgoActividad = r.RiesgoActividad .RiesgoEpigrafe = r.RiesgoEpigrafe .RiesgoDescripcion = r.RiesgoDescripcion .AclaracionesDeLaActividad = r.AclaracionesDeLaActividad .Observaciones = r.Observaciones .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString .IBAN = r.IBAN .OpcionElegida = r.OpcionElegida .TotalOpcionElegida = r.TotalOpcionElegida If Not r.IBAN = "" Then .NumCuenta = r.IBAN.Substring(12, 10) .Entidad = r.IBAN.Substring(4, 4) .Oficina = r.IBAN.Substring(8, 4) .DC = r.IBAN.Substring(10, 2) .NombreEntidad = bd.bancos.FirstOrDefault(Function(x) x.Codigo = r.IBAN.Substring(4, 4)).Nombre End If End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCTarificadorMaquinaria(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaTarificadorMaquinaria) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaTarificadorMaquinaria) Dim ccp As CombinacionCorrespondenciaTarificadorMaquinaria Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaTarificadorMaquinaria 'Dim fechaHoraEfecto As String = "" 'If p.FechaEfecto = Today.Date Then ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() 'Else ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() 'End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.TarificadorMaquinaria .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .PropietarioCIF = r.PropietarioCIF .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = r.PropietarioApellidos .PropietarioTelefono = r.PropietarioTelefono .PropietarioEmail = r.PropietarioEmail .PropietarioDomicilio = r.PropietarioDomicilio .PropietarioCodigoPostal = r.PropietarioCodigoPostal .PropietarioPoblacion = r.PropietarioPoblacion .PropietarioProvincia = r.PropietarioProvincia .PropietarioCodigoMunicipio = r.PropietarioCodigoMunicipio .Matricula = r.Matricula .UsoAlQueSeDestina = r.UsoAlQueSeDestina .AntiguedadMaquinaria = r.AntiguedadMaquinaria .NumeroMaquinasAseguradas = r.NumeroMaquinasAseguradas .Cosechadoras = r.Cosechadoras .CosechadorasRotura = r.CosechadorasRotura .TractoresAgricolas = r.TractoresAgricolas .Empacadoras = r.Empacadoras .Vendimiadoras = r.Vendimiadoras .NoAutoPropulsados = r.NoAutoPropulsados .VibradoresOlivos = r.VibradoresOlivos .CosechadorasCalculado = r.CosechadorasCalculado .CosechadorasRoturaCalculado = r.CosechadorasRoturaCalculado .TractoresAgricolasCalculado = r.TractoresAgricolasCalculado .EmpacadorasCalculado = r.EmpacadorasCalculado .VendimiadorasCalculado = r.VendimiadorasCalculado .NoAutoPropulsadosCalculado = r.NoAutoPropulsadosCalculado .VibradoresOlivosCalculado = r.VibradoresOlivosCalculado .PrimaNetaMinima = r.PrimaNetaMinima .PrimaNeta = r.PrimaNeta .Impuestos = r.Impuestos .PrimaTotal = r.PrimaTotal .Condicionantes = r.Condicionantes .Observaciones = r.Observaciones .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString .DaniosLuna = r.DaniosLuna End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCRCPerros(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRCPerros) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaRCPerros) Dim ccp As CombinacionCorrespondenciaRCPerros Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaRCPerros 'Dim fechaHoraEfecto As String = "" 'If p.FechaEfecto = Today.Date Then ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() 'Else ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() 'End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.RCPerros .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .PropietarioCIF = r.PropietarioCIF .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = r.PropietarioApellidos .PropietarioTelefono = r.PropietarioTelefono .PropietarioEmail = r.PropietarioEmail .PropietarioDomicilio = r.PropietarioDomicilio .PropietarioCodigoPostal = r.PropietarioCodigoPostal .PropietarioPoblacion = r.PropietarioPoblacion .PropietarioProvincia = r.PropietarioProvincia .PropietarioCodigoMunicipio = r.PropietarioCodigoMunicipio .CoberturaElegida = r.CoberturaElegida .PrecioCobertura = r.PrecioCobertura .NumeroPerrosPeligrosos = r.NumeroPerrosPeligrosos .NumeroPerrosNoPeligrosos = r.NumeroPerrosNoPeligrosos .PrimaPerroPeligrosos = r.PrimaPerrosPeligrosos.ToString("c2") .PrimaPerrosNoPeligrosos = r.PrimaPerrosNoPeligrosos.ToString("c2") .PrecioPerrosPeligrosos = r.PrecioPerrosPeligrosos.ToString("c2") .PrecioPerrosNoPeligrosos = r.PrecioPerrosNoPeligrosos.ToString("c2") .PrimeroRaza = r.PrimeroRaza .PrimeroMicrochip = r.PrimeroMicrochip .PrimeroNombre = r.PrimeroNombre .PrimeroFechaNacimiento = If(r.PrimeroFechaNacimiento.Year = 1, "", r.PrimeroFechaNacimiento) .TipoPerro = r.TipoPerro If r.TipoPerro = "Peligroso" Then If r.CoberturaElegida = "150000" Then .Op1P = "x" ElseIf r.CoberturaElegida = "180000" Then .Op2P = "x" ElseIf r.CoberturaElegida = "300000" Then .Op3P = "x" End If End If If r.TipoPerro = "No Peligroso" Then If r.CoberturaElegida = "150000" Then .Op1NP = "x" ElseIf r.CoberturaElegida = "180000" Then .Op2NP = "x" ElseIf r.CoberturaElegida = "300000" Then .Op3NP = "x" End If End If '.SegundoRaza = r.SegundoRaza '.SegundoMicrochip = r.SegundoMicrochip '.SegundoNombre = r.SegundoNombre '.SegundoFechaNacimiento = If(r.SegundoFechaNacimiento.Year = 1, "", r.SegundoFechaNacimiento) '.TerceroRaza = r.TerceroRaza '.TerceroMicrochip = r.TerceroMicrochip '.TerceroNombre = r.TerceroNombre '.TerceroFechaNacimiento = If(r.TerceroFechaNacimiento.Year = 1, "", r.TerceroFechaNacimiento) .Observaciones = r.Observaciones .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCRCCaballos(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRCCaballos) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaRCCaballos) Dim ccp As CombinacionCorrespondenciaRCCaballos Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaRCCaballos 'Dim fechaHoraEfecto As String = "" 'If p.FechaEfecto = Today.Date Then ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() 'Else ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() 'End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.RCCaballos .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .DocumentacionEquina = r.DocumentacionEquina .Observaciones = r.Observaciones .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCTransportesAXA(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaTransportesAXA) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaTransportesAXA) Dim ccp As CombinacionCorrespondenciaTransportesAXA Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaTransportesAXA With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.TransportesAXA .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .MatriculaRemolque = r.MatriculaRemolque .CalidadTomador = r.CalidadTomador .MedioTransporte = r.MedioTransporte .CapitalElegido = r.CapitalElegido .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCAccidentesIndividualesAXA(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaAccidentesIndividualesAXA) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaAccidentesIndividualesAXA) Dim ccp As CombinacionCorrespondenciaAccidentesIndividualesAXA Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaAccidentesIndividualesAXA With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.AccidentesIndividualesAXA .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .PropietarioCIF = r.PropietarioCIF .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = r.PropietarioApellidos .PropietarioTelefono = r.PropietarioTelefono .PropietarioEmail = r.PropietarioEmail .PropietarioDomicilio = r.PropietarioDomicilio .PropietarioCodigoPostal = r.PropietarioCodigoPostal .PropietarioPoblacion = r.PropietarioPoblacion .PropietarioProvincia = r.PropietarioProvincia .PropietarioCodigoMunicipio = r.PropietarioCodigoMunicipio .Observaciones = r.Observaciones .CapitalElegido = r.CapitalElegido .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCSaludMapfre(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaSaludMapfre) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaSaludMapfre) Dim ccp As CombinacionCorrespondenciaSaludMapfre Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaSaludMapfre With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.SaludMapfre .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .TomadorFechaNacimiento = r.TomadorFechaNacimiento .TomadorSexo = r.TomadorSexo .TomadorEstadoCivil = r.TomadorEstadoCivil .Asegurado1CIF = r.Asegurado1CIF .Asegurado1Nombre = r.Asegurado1Nombre .Asegurado1Apellidos = r.Asegurado1Apellidos .Asegurado1Domicilio = r.Asegurado1Domicilio .Asegurado1CodigoPostal = r.Asegurado1CodigoPostal .Asegurado1Poblacion = r.Asegurado1Poblacion .Asegurado1Provincia = r.Asegurado1Provincia .Asegurado1CodigoMunicipio = r.Asegurado1CodigoMunicipio .Asegurado1Telefono = r.Asegurado1Telefono .Asegurado1Email = r.Asegurado1Email .Asegurado1FechaNacimiento = r.Asegurado1FechaNacimiento .Asegurado1Sexo = r.Asegurado1Sexo .Asegurado1Peso = r.Asegurado1Peso .Asegurado1Estatura = r.Asegurado1Estatura .Asegurado1Profesion = r.Asegurado1Profesion .Asegurado1Parentesco = r.Asegurado1Parentesco .pregunta1Asegurado1 = If(r.Pregunta1Asegurado1, "SI", "NO") .pregunta2Asegurado1 = If(r.Pregunta2Asegurado1, "SI", "NO") .pregunta3Asegurado1 = If(r.Pregunta3Asegurado1, "SI", "NO") .pregunta4Asegurado1 = If(r.Pregunta4Asegurado1, "SI", "NO") .pregunta5Asegurado1 = If(r.Pregunta5Asegurado1, "SI", "NO") If Not r.Asegurado2CIF = "" Then .Asegurado2CIF = r.Asegurado2CIF .Asegurado2Nombre = r.Asegurado2Nombre .Asegurado2Apellidos = r.Asegurado2Apellidos .Asegurado2Domicilio = r.Asegurado2Domicilio .Asegurado2CodigoPostal = r.Asegurado2CodigoPostal .Asegurado2Poblacion = r.Asegurado2Poblacion .Asegurado2Provincia = r.Asegurado2Provincia .Asegurado2CodigoMunicipio = r.Asegurado2CodigoMunicipio .Asegurado2Telefono = r.Asegurado2Telefono .Asegurado2Email = r.Asegurado2Email .Asegurado2FechaNacimiento = r.Asegurado2FechaNacimiento .Asegurado2Sexo = r.Asegurado2Sexo .Asegurado2Peso = r.Asegurado2Peso .Asegurado2Estatura = r.Asegurado2Estatura .Asegurado2Profesion = r.Asegurado2Profesion .Asegurado2Parentesco = r.Asegurado2Parentesco .pregunta1Asegurado2 = If(r.Pregunta1Asegurado2, "SI", "NO") .pregunta2Asegurado2 = If(r.Pregunta2Asegurado2, "SI", "NO") .pregunta3Asegurado2 = If(r.Pregunta3Asegurado2, "SI", "NO") .pregunta4Asegurado2 = If(r.Pregunta4Asegurado2, "SI", "NO") .pregunta5Asegurado2 = If(r.Pregunta5Asegurado2, "SI", "NO") End If If Not r.Asegurado3CIF = "" Then .Asegurado3CIF = r.Asegurado3CIF .Asegurado3Nombre = r.Asegurado3Nombre .Asegurado3Apellidos = r.Asegurado3Apellidos .Asegurado3Domicilio = r.Asegurado3Domicilio .Asegurado3CodigoPostal = r.Asegurado3CodigoPostal .Asegurado3Poblacion = r.Asegurado3Poblacion .Asegurado3Provincia = r.Asegurado3Provincia .Asegurado3CodigoMunicipio = r.Asegurado3CodigoMunicipio .Asegurado3Telefono = r.Asegurado3Telefono .Asegurado3Email = r.Asegurado3Email .Asegurado3FechaNacimiento = r.Asegurado3FechaNacimiento .Asegurado3Sexo = r.Asegurado3Sexo .Asegurado3Peso = r.Asegurado3Peso .Asegurado3Estatura = r.Asegurado3Estatura .Asegurado3Profesion = r.Asegurado3Profesion .Asegurado3Parentesco = r.Asegurado3Parentesco .pregunta1Asegurado3 = If(r.Pregunta1Asegurado3, "SI", "NO") .pregunta2Asegurado3 = If(r.Pregunta2Asegurado3, "SI", "NO") .pregunta3Asegurado3 = If(r.Pregunta3Asegurado3, "SI", "NO") .pregunta4Asegurado3 = If(r.Pregunta4Asegurado3, "SI", "NO") .pregunta5Asegurado3 = If(r.Pregunta5Asegurado3, "SI", "NO") End If If Not r.Asegurado4CIF = "" Then .Asegurado4CIF = r.Asegurado4CIF .Asegurado4Nombre = r.Asegurado4Nombre .Asegurado4Apellidos = r.Asegurado4Apellidos .Asegurado4Domicilio = r.Asegurado4Domicilio .Asegurado4CodigoPostal = r.Asegurado4CodigoPostal .Asegurado4Poblacion = r.Asegurado4Poblacion .Asegurado4Provincia = r.Asegurado4Provincia .Asegurado4CodigoMunicipio = r.Asegurado4CodigoMunicipio .Asegurado4Telefono = r.Asegurado4Telefono .Asegurado4Email = r.Asegurado4Email .Asegurado4FechaNacimiento = r.Asegurado4FechaNacimiento .Asegurado4Sexo = r.Asegurado4Sexo .Asegurado4Peso = r.Asegurado4Peso .Asegurado4Estatura = r.Asegurado4Estatura .Asegurado4Profesion = r.Asegurado4Profesion .Asegurado4Parentesco = r.Asegurado4Parentesco .pregunta1Asegurado4 = If(r.Pregunta1Asegurado4, "SI", "NO") .pregunta2Asegurado4 = If(r.Pregunta2Asegurado4, "SI", "NO") .pregunta3Asegurado4 = If(r.Pregunta3Asegurado4, "SI", "NO") .pregunta4Asegurado4 = If(r.Pregunta4Asegurado4, "SI", "NO") .pregunta5Asegurado4 = If(r.Pregunta5Asegurado4, "SI", "NO") End If .Observaciones = r.Observaciones .AsistenciaSanitaria = If(r.AsistenciaSanitaria, "X", "") .GarantíaBucodental = If(r.GarantiaBucodental, "X", "") .ReembolsoGastosCompletos = If(r.ReembolsoGastosCompletos, "X", "") .ReembolsoGastosHospitalarios = If(r.ReembolsoGastosHospitalarios, "X", "") .ReembolsoGranCobertura = If(r.ReembolsoGranCobertura, "X", "") .FormaPago = r.FormaPago .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCCasetasRiegoAxa(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaCasetasRiegoAXA) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaCasetasRiegoAXA) Dim ccp As CombinacionCorrespondenciaCasetasRiegoAXA Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaCasetasRiegoAXA With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.CasetasRiegoAXA .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorEmail = r.TomadorEmail .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .casetaUbicacion = r.CasetaUbicacion .casetaLocalidad = r.CasetaLocalidad .casetaCodigoPostal = r.CasetaCodigoPostal .casetaProvincia = r.CasetaProvincia .EdificiosDescripcion = r.EdificiosDescripcion .EdificiosCapital = r.EdificiosCapital .mobiliarioDescripcion = r.MobiliarioDescripcion .mobiliarioCapital = r.MobiliarioCapital .existenciasDescripcion = r.ExistenciasDescripcion .existenciasCapital = r.ExistenciasCapital .capitalElegido = r.CapitalElegido .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCPresupuestoRCSociosZurich(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaRCSociosZurich) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaRCSociosZurich) Dim ccp As CombinacionCorrespondenciaRCSociosZurich Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaRCSociosZurich Dim fechaHoraEfecto As String = "" If p.FechaEfecto = Today.Date Then Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() Else Dim fechaEf As Date = p.FechaEfecto fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.RCSociosZurich .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos.Trim .TomadorTelefono = r.TomadorTelefono .TomadorDomicilio = r.TomadorDomicilio.Trim .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TipoRC = r.TipoRC .PrimaNetaA = r.PrimaNetaA .PrimaNetaB = r.PrimaNetaB .PrimaNetaC = r.PrimaNetaC .ImpuestosA = r.ImpuestosA .ImpuestosB = r.ImpuestosB .ImpuestosC = r.ImpuestosC .PrimaTotalA = r.PrimaTotalA .PrimaTotalB = r.PrimaTotalB .PrimaTotalC = r.PrimaTotalC .PropietarioCIF = r.PropietarioCIF .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = r.PropietarioApellidos .PropietarioTelefono = r.PropietarioTelefono .propietarioCorreo = r.PropietarioEmail .PropietarioDomicilio = r.PropietarioDomicilio .PropietarioCodigoPostal = r.PropietarioCodigoPostal .PropietarioPoblacion = r.PropietarioPoblacion .PropietarioProvincia = r.PropietarioProvincia .PropietarioCodigoMunicipio = r.PropietarioCodigoMunicipio .Dehesa = r.Dehesa .SuperficieCosechable = r.SuperficieCosechable .CotoDeCaza = r.CotoDeCaza .VidaPrivada = r.VidaPrivada .CabezasVacuno = r.CabezasVacuno .CabezasOvino = r.CabezasOvino .CabezasPorcino = r.CabezasPorcino .CabezasEquino = r.CabezasEquino .CabezasGanadoBravo = r.CabezasGanadoBravo .Observaciones = r.Observaciones .NumeroRega = r.NumeroRega .CodigoGanadero = r.CodigoGanadero .SumaContratar = r.SumaContratar .FormaPago = r.FormaPago .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto .FechaVencimiento = r.FechaVencimiento End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCTractoresEuropAssistance(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaTractoresEuropAssistance) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaTractoresEuropAssistance) Dim ccp As CombinacionCorrespondenciaTractoresEuropAssistance Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaTractoresEuropAssistance With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.TractoresEuropAssistance .Matricula = r.Matricula .Marca = r.Marca .Modelo = r.Modelo .Version = r.Version .FechaMatriculacion = r.FechaMatriculacion .CIF = r.CIF .RazonSocial = .RazonSocial '.Nombre = r.Nombre '.Apellido1 = r.Apellido1 '.Apellido2 = r.Apellido2 .FechaNacimiento = r.FechaNacimiento .EstadoCivil = r.EstadoCivil .Sexo = r.Sexo .Telefono1 = r.Telefono1 .Telefono2 = r.Telefono2 .Email = r.Email .Direccion = r.Direccion .CodigoPostal = r.CodigoPostal .CodigoPoblacion = r.CodigoPoblacion .Poblacion = r.Poblacion .CodigoProvincia = r.CodigoProvincia .Provincia = r.Provincia .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto .FechaVencimiento = r.FechaVencimiento End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function ObtieneCCPatinetes(ListaPolizasG As List(Of polizassg), Optional MostrarProgreso As Boolean = False) As List(Of CombinacionCorrespondenciaPatinetes) Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() Dim ListaCCP As New List(Of CombinacionCorrespondenciaPatinetes) Dim ccp As CombinacionCorrespondenciaPatinetes Dim i As Integer = 0 Dim n As Integer = ListaPolizasG.Count Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContexto() Dim fCastellano = tsl5.Utilidades.FechaEnCastellano(bdGestionAsegasa.Utilidades.AhoraMysql(bd), tsl5.FormatoFechasEnum.FECHA_ESPACIADO_PEQUEÑO) For Each p In ListaPolizasG i += 1 If MostrarProgreso Then DXSplashScreen.SetState("Preparando informe (" & i.ToString & " de " & n.ToString & " registros)") ccp = New CombinacionCorrespondenciaPatinetes 'Dim fechaHoraEfecto As String = "" 'If p.FechaEfecto = Today.Date Then ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, Now.ToLongTimeString).Trim() 'Else ' Dim fechaEf As Date = p.FechaEfecto ' fechaHoraEfecto = String.Format("{0} {1}", fechaEf.ToShortDateString, "00:00").Trim() 'End If With ccp Dim myTI As Globalization.TextInfo = New Globalization.CultureInfo("es-ES", False).TextInfo Dim fechaCabecera As String = String.Format("{0} {1}", myTI.ToTitleCase(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Today.Month)), Today.Year) Dim r = p.Patinetes .TomadorCIF = r.TomadorCIF .TomadorNombre = r.TomadorNombre .TomadorApellidos = r.TomadorApellidos .TomadorTelefono = r.TomadorTelefono .TomadorCorreo = r.TomadorCorreo .TomadorDomicilio = r.TomadorDomicilio .TomadorCodigoPostal = r.TomadorCodigoPostal .tomadorPoblacion = r.TomadorPoblacion .TomadorProvincia = r.TomadorProvincia .TomadorCodigoMunicipio = r.TomadorCodigoMunicipio .PropietarioCIF = r.PropietarioCIF .PropietarioNombre = r.PropietarioNombre .PropietarioApellidos = r.PropietarioApellidos .PropietarioTelefono = r.PropietarioTelefono .propietarioCorreo = r.PropietarioCorreo .PropietarioDomicilio = r.PropietarioDomicilio .PropietarioCodigoPostal = r.PropietarioCodigoPostal .PropietarioPoblacion = r.PropietarioPoblacion .PropietarioProvincia = r.PropietarioProvincia .PropietarioCodigoMunicipio = r.PropietarioCodigoMunicipio .Producto = r.Producto .Identificador = r.Identificador .FechaCompra = r.FechaCompra .PrimaAnualizada = r.PrimaAnualizada .Observaciones = r.Observaciones .IBAN = r.IBAN .FechaEfecto = r.FechaEfecto.ToShortDateString .FechaVencimiento = r.FechaVencimiento.ToShortDateString End With ListaCCP.Add(ccp) Next Return ListaCCP Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Function FusionaPlantillaConDatos(Plantilla As Byte(), Datos As Object, Optional MostrarProgreso As Boolean = False) As IO.MemoryStream Try If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() If MostrarProgreso Then DXSplashScreen.SetState("Fusionando datos ...") ' Dim rec As New DevExpress.XtraRichEdit.RichEditControl Dim rec As New RichEditDocumentServer rec.LoadDocument(New IO.MemoryStream(Plantilla), DevExpress.XtraRichEdit.DocumentFormat.OpenXml) Dim mmo As DevExpress.XtraRichEdit.API.Native.MailMergeOptions = rec.CreateMailMergeOptions mmo.DataSource = Datos mmo.MergeMode = API.Native.MergeMode.NewSection rec.Options.MailMerge.DataSource = Datos Dim ms As New MemoryStream rec.MailMerge(mmo, ms, DevExpress.XtraRichEdit.DocumentFormat.OpenXml) Return ms Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function Friend Shared Sub ImprimePlantillaFusionada(bd As gestionasegasaEntities, Plantilla As String, Datos As Object, ImpresoraPredeterminada As Boolean) Dim qr As ObjectQuery(Of plantillas) = bd.plantillas qr.MergeOption = MergeOption.OverwriteChanges Dim pl = qr.Where(Function(x) x.Codigo = Plantilla).First ImprimePlantillaFusionada(pl.Plantilla, Datos, ImpresoraPredeterminada) End Sub Public Shared Sub ImprimePlantillaFusionada(Plantilla As Byte(), Datos As Object, ImpresoraPredeterminada As Boolean) Try Dim ms As MemoryStream = FusionaPlantillaConDatos(Plantilla, Datos) DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() DXSplashScreen.SetState("Imprimiendo ...") ms.Seek(0, SeekOrigin.Begin) Dim rec As New DevExpress.XtraRichEdit.RichEditControl rec.LoadDocument(ms, DevExpress.XtraRichEdit.DocumentFormat.OpenXml) DXSplashScreen.Close() 'rec.LoadDocument(New MemoryStream(ms.ToArray), DevExpress.XtraRichEdit.DocumentFormat.OpenXml) If ImpresoraPredeterminada Then rec.Print() Else rec.ShowPrintDialog() End If Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Sub Shared Function FusionaPlantillaENPDF(Plantilla As Byte(), Datos As Object, Optional MostrarProgreso As Boolean = False) As Byte() Try Dim ms As MemoryStream = FusionaPlantillaConDatos(Plantilla, Datos) If MostrarProgreso Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)() If MostrarProgreso Then DXSplashScreen.SetState("Generando PDF ...") ms.Seek(0, SeekOrigin.Begin) Dim rec As New RichEditDocumentServer rec.LoadDocument(ms, DevExpress.XtraRichEdit.DocumentFormat.OpenXml) If MostrarProgreso Then DXSplashScreen.Close() Dim mspdf As New IO.MemoryStream rec.ExportToPdf(mspdf) ' mspdf.Seek(0, SeekOrigin.Begin) Return mspdf.ToArray Catch ex As Exception Throw New Exception(ex.Message, ex) Finally If MostrarProgreso AndAlso DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Function End Class End Namespace