Compare commits

...

4 Commits

213 changed files with 19600 additions and 0 deletions

63
.gitattributes vendored Normal file
View File

@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

363
.gitignore vendored Normal file
View File

@@ -0,0 +1,363 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

43
Asegasa.sln Normal file
View File

@@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36414.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSAsegasa", "WSAsegasa\WSAsegasa.csproj", "{C891F2E3-60D2-449F-962A-BF78F58C67D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdAsegasa", "bdAsegasa\bdAsegasa.csproj", "{E42D668E-CB26-498B-89AF-8A205528C4EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tsVeriFactu", "..\..\Comunes\tsVeriFactu\tsVeriFactu.csproj", "{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdfactu", "..\Tecnosis\tsFactu\bdFactu\bdfactu.csproj", "{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C891F2E3-60D2-449F-962A-BF78F58C67D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C891F2E3-60D2-449F-962A-BF78F58C67D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C891F2E3-60D2-449F-962A-BF78F58C67D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C891F2E3-60D2-449F-962A-BF78F58C67D6}.Release|Any CPU.Build.0 = Release|Any CPU
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.Build.0 = Release|Any CPU
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Release|Any CPU.Build.0 = Release|Any CPU
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {55ECD6B3-4E25-4F93-A690-693E6C01EE6C}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,16 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WSAsegasa
{
public class Configuracion
{
public int SegundosMinimosEntreProcesos { get; set; }
public string? HoraProcesosDiarios { get; set; }
public string? NombreConexionBD { get; set; }
}
}

102
WSAsegasa/Logs.cs Normal file
View File

@@ -0,0 +1,102 @@
using bdAsegasa;
using bdAsegasa.db;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Serilog;
//mmm
namespace WSAsegasa
{
internal class Logs
{
private static object oBloqueoLog;
//private static EventLog el;
public static void AñadeLog(tsUtilidades.Enumeraciones.TipoLog Tipo, string Mensaje, Exception e = null)
{
// ----------------------------------------------------------------------------------------------------
// Descripción Sub: Gestión de logs de la aplicación
// Fecha. Creacion: ???
// Creada por: manmog
// Ultima Modificacion: 24/11/2010
//
// Modificaciones:
// ===============
if (oBloqueoLog == null) oBloqueoLog = new object();
lock (oBloqueoLog)
{
try
{
if (e != null)
{
string sStackTrace = "Tipo excepción: " + e.ToString() + Constants.vbCrLf;
Exception exError = e;
do
{
sStackTrace += exError.StackTrace + Constants.vbCrLf;
exError = exError.InnerException;
}
while (!Information.IsNothing(exError));
if (sStackTrace != "")
Mensaje += Constants.vbCrLf + "|StackTrace: " + sStackTrace;
}
bdAsegasa.db.cuentascorreo? cta = null;
try
{
var bd = tscgestionasegasa.NuevoContexto(Procesos.Conf.NombreConexionBD, true, false, true, "WSAsegasa");
cta = bd.cuentascorreo.First(x => x.Codigo == "DEFECTO");
}
catch
{
}
switch (Tipo)
{
case tsUtilidades.Enumeraciones.TipoLog.Fallo:
Mensaje = "Error WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". Mensaje: " + Mensaje;
Log.Fatal(Mensaje);
if (cta != null) tsCorreos.Funciones.EnviaCorreo(cta.ServidorSMTP, cta.Remitente, "sevilla@tecnosis.net", "Error en WSAsegasa", Mensaje, null, null, "", "", cta.CuentaCorreo, cta.Password, cta.Puerto.Value, true);
break;
case tsUtilidades.Enumeraciones.TipoLog.Advertencia:
Mensaje = "Advertencia WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". " + Mensaje;
Log.Warning(Mensaje);
if (cta != null) tsCorreos.Funciones.EnviaCorreo(cta.ServidorSMTP, cta.Remitente, "sevilla@tecnosis.net", "Advertencia en WSAsegasa", Mensaje, null, null, "", "", cta.CuentaCorreo, cta.Password, cta.Puerto.Value, true);
break;
case tsUtilidades.Enumeraciones.TipoLog.InicioServicio:
Mensaje = "Inicio WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". Mensaje: " + Mensaje;
Log.Information(Mensaje);
if (cta != null) tsCorreos.Funciones.EnviaCorreo(cta.ServidorSMTP, cta.Remitente, "sevilla@tecnosis.net", "Inicio WSAsegasa", Mensaje, null, null, "", "", cta.CuentaCorreo, cta.Password, cta.Puerto.Value, true);
break;
case tsUtilidades.Enumeraciones.TipoLog.FinServicio:
Mensaje = "Finalización WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". Mensaje: " + Mensaje;
Log.Information(Mensaje);
if (cta != null) tsCorreos.Funciones.EnviaCorreo(cta.ServidorSMTP, cta.Remitente, "sevilla@tecnosis.net", "Finalización WSAsegasa", Mensaje, null, null, "", "", cta.CuentaCorreo, cta.Password, cta.Puerto.Value, true);
break;
default:
Mensaje = Tipo.ToString() + " WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". " + Mensaje;
Log.Information(Mensaje);
break;
}
}
catch (Exception ex)
{
if (e != null)
Mensaje += " --- " + e.StackTrace;
Log.Fatal(Mensaje + " ---" + ex.Message + " --- " + ex.StackTrace);
}
}
}
}
}

46
WSAsegasa/Procesos.cs Normal file
View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WSAsegasa;
namespace WSAsegasa
{
public class Procesos
{
public static Configuracion Conf;
public static DateTime? HoraUtcUltimaEjecucionProcesos = null;
private static bool Procesando;
public static void Procesar()
{
if (!Procesando && (HoraUtcUltimaEjecucionProcesos.HasValue == false || DateTime.UtcNow.Subtract(HoraUtcUltimaEjecucionProcesos.Value).TotalSeconds > Conf.SegundosMinimosEntreProcesos)) ;
{
Procesando = true;
HoraUtcUltimaEjecucionProcesos = DateTime.UtcNow;
try
{
// ProcesosCorreos.EnviaCorreos();
// Comprobaciones.CompruebaReplica();
// Comprobaciones.ChequeaColaCorreo();
}
catch (Exception ex)
{
Debug.WriteLine(@"Procesar: EXCEPCIÓN: " + ex.Message + " " + ex.StackTrace);
}
finally
{
Procesando = false;
}
}
}
}
}

View File

@@ -0,0 +1,515 @@
using bdAsegasa;
using bdAsegasa.db;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Update.Internal;
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using System.Web.Services.Description;
using System.Xml;
using tsUtilidades;
using tsUtilidades.Enumeraciones;
using tsUtilidades.Extensiones;
using tsVeriFactu;
using tsVeriFactu.tsClases;
using wsVerifactu;
using static bdAsegasa.db.registrosverifactu;
using static Org.BouncyCastle.Math.EC.ECCurve;
using static Quartz.Logging.OperationName;
using static tsVeriFactu.Enums;
using static tsVeriFactu.tsDetalle;
namespace WSAsegasa
{
public class ProcesosVeriFactuAsegasa : ItsVeriFactu
{
private tscgestionasegasa? bd;
private List<registrosverifactu>? lrp;
private DatosConfig? Configuracion;
private enumeraciones? confVerifactu = null;
private enumeraciones? confSI = null;
public async Task Iniciar(CancellationToken cancellationToken)
{
try
{
bd = tscgestionasegasa.NuevoContexto(Procesos.Conf.NombreConexionBD, true, false, true, "ProcesosVeriFactu");
confVerifactu = bd.enumeraciones.First(x => x.Codigo == "VF.CONF");
var Hoy = DateTime.Today;
confSI = bd.enumeraciones.Where(x => x.Codigo.StartsWith("VF.SI-") && x.Fecha1.HasValue && x.Fecha1 <= Hoy).OrderByDescending(x => x.Fecha1).FirstOrDefault();
if (confSI != null)
{
if (confVerifactu.Fecha2.HasValue == false)
{
if (confVerifactu.Fecha3.HasValue)
{
TimeSpan espera = confVerifactu.Fecha3.Value - DateTime.Now;
if (espera.TotalMilliseconds > 0) await System.Threading.Tasks.Task.Delay(espera, cancellationToken);
}
confVerifactu.ValorAlfabeticoLargo = "";
var pc = await tsVeriFactu.Procesos.EnviaFacturasAEAT(this, cancellationToken);
}
}
}
catch (Exception ex)
{
Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, ex);
}
}
public DatosConfig ObtieneConfiguracion()
{
var bd = tscgestionasegasa.NuevoContexto(Procesos.Conf.NombreConexionBD, true, false, true, "ProcesosVeriFactu");
var bdts = bdFactu.tscFactu.NuevoContexto("Producción", true, false, true, "ProcesosVeriFactu");
//var emp = bd.enumeraciones.First(x => x.Codigo == "CONF.EMP");
var rso = bd.enumeraciones.First(x => x.Codigo == "DATEMP.RAZONSOCIAL").ValorAlfabeticoLargo;
var cif = bd.enumeraciones.First(x => x.Codigo == "DATEMP.CIF").ValorAlfabeticoLargo;
var c = bdts.certificados.First(x => x.Codigo == "PFX-A29221801" && x.FechaValidez <= DateTime.Now && x.FechaCaducidad >= DateTime.Now);
var p = tsUtilidades.crypt.SHA256(System.Text.Encoding.UTF8.GetBytes(c.FechaCaducidad.Value.ToString("yyyyMMddhhmmss") + c.CERT_ID + "-M3Soft."));
Assembly ensamblado = Assembly.GetAssembly(typeof(ProcesosVeriFactuAsegasa));
var Version = ensamblado?.GetName().Version?.Major.ToString().PadLeft(3, '0') + "." + ensamblado?.GetName().Version?.Minor.ToString().PadLeft(3, '0') + "." + ensamblado?.GetName().Version?.Build.ToString().PadLeft(3, '0');
Configuracion = new DatosConfig(
NIFEmpresa: cif,
RazonSocialEmpresa: rso,
EsProduccion: confSI.ValorNumerico4.Value > 0,
Certificado: new X509Certificate2(c.ContenedorClaves, p),
TipoCertificadoSello: false,
datosSistemInfor: new tsDatosSistemaInformatico
{
NombreRazon = confSI.ValorAlfabetico1,
NIFEmpresa = confSI.ValorAlfabetico2,
NombreSistemaInformatico = confSI.ValorAlfabetico3,
IdSistemaInformatico = confSI.ValorNumerico1.ToString(),
Version = Version,
NumeroInstalacion = confSI.ValorNumerico2.ToString().PadLeft(12, '0'),
}
);
return Configuracion;
}
public List<tsRegistroFacturacion> ObtenerOperacionesPendientes()
{
DateTime Ahora = DateTime.Now;
int OperAlta = (int)bdAsegasa.db.registrosverifactu.OperacionEnum.ALTA;
//DateTime fl = DateTime.Now.AddMinutes(-120);
DateOnly fl = DateOnly.FromDateTime(DateTime.Now);
DateOnly fc = DateOnly.FromDateTime(confSI.Fecha1.Value);
int tl = (int)AplicacionEnum.LIQUIDACION_AGENTE;
var lfp = bd.liquidacionesagentes
.Where(l =>
l.idSerieFactura.HasValue &&
l.FechaFactura.HasValue &&
l.FechaFactura.Value >= fc &&
l.FechaFactura.Value <= fl &&
l.idSerieFacturaNavigation.TipoVerifactu.HasValue &&
!bd.registrosverifactu.Any(r => r.idAplicacion == l.idLiquidacionAgente && r.TipoFactura==tl)
).OrderBy(x => x.FechaFactura).ThenBy(x => x.NumeroFactura).ToList();
//List<bdAsegasa.db.liquidacionesagentes> lfp = bd.liquidacionesagentes.Where(x => x.idSerieFactura.HasValue && x.FechaFactura.HasValue && x.FechaFactura.Value >= fc && x.FechaEmision < fl && x.idSerieFacturaNavigation.TipoVerifactu.HasValue && !x.registrosverifactu.Any(y => y.Operacion == OperAlta)).OrderBy(x => x.FechaFactura).ThenBy(x => x.NumeroFactura).ToList();
foreach (var f in lfp)
{
registrosverifactu rvf = new registrosverifactu();
bd.registrosverifactu.Add(rvf);
rvf.idAplicacion = f.idLiquidacionAgente;
rvf.Aplicacion = (int)registrosverifactu.AplicacionEnum.LIQUIDACION_AGENTE;
rvf.TipoFactura = f.idSerieFacturaNavigation.TipoVerifactu.Value;
rvf.Estado = (int)bdAsegasa.db.registrosverifactu.EstadoEnum.PENDIENTE_RESPUESTA;
rvf.FechaGeneracion = DateTime.Now;
rvf.Operacion = OperAlta;
}
bd.SaveChanges();
int EstPendiente = (int)bdAsegasa.db.registrosverifactu.EstadoEnum.PENDIENTE_RESPUESTA;
lrp = bd.registrosverifactu.Where(x => x.Estado == EstPendiente).OrderBy(x => x.idRegistro).ToList();
return LiquidacionesAgentesAtsFACTURAS();
}
private List<tsRegistroFacturacion> LiquidacionesAgentesAtsFACTURAS()
{
List<tsRegistroFacturacion> lf = new List<tsRegistroFacturacion>();
try
{
var rso = bd.enumeraciones.First(x => x.Codigo == "DATEMP.RAZONSOCIAL").ValorAlfabeticoLargo;
var cif = bd.enumeraciones.First(x => x.Codigo == "DATEMP.CIF").ValorAlfabeticoLargo;
foreach (registrosverifactu r in lrp)
{
try
{
if (r.Operacion == (int)registrosverifactu.OperacionEnum.ANULACIÓN)
{
// Anulación de factura
liquidacionesagentes fCancelar = bd.liquidacionesagentes.First(x=> x.idLiquidacionAgente==r.idAplicacion);
tsRegistroFacturacionAnulacion nf = new tsRegistroFacturacionAnulacion(
"01",
fCancelar.idAgenteNavigation.CIF,
fCancelar.NumeroFacturaVF(confSI.ValorAlfabetico4),
fCancelar.FechaFactura.Value,
r.idRegistro.ToString()
);
lf.Add(nf);
}
else
{
liquidacionesagentes fr = bd.liquidacionesagentes.First(x => x.idLiquidacionAgente == r.idAplicacion);
tsRegistroFacturacionAlta nf = new tsRegistroFacturacionAlta(
"01",
fr.idAgenteNavigation.CIF,//emp.ValorAlfabetico1,
fr.FechaFactura.Value.Year==2025? "2025": fr.idSerieFacturaNavigation.Serie,
fr.NumeroFacturaVF(confSI.ValorAlfabetico4),
fr.FechaFactura.Value,
fr.idAgenteNavigation.Nombre, // emp.ValorAlfabeticoLargo,
TercerosODestinatarioType.D,
(ClaveTipoFacturaType)fr.idSerieFacturaNavigation.TipoVerifactu,
"COMISIONES SEGUROS",
rso, //fr.idAgenteNavigation.Nombre ,
cif, //fr.idAgenteNavigation.CIF,
fr.IVA,
fr.TotalFacturaSinIRPF,
ObtieneImpuestos(fr).ToArray(),
r.idRegistro.ToString(),
(TipoRegistroAltaEnum)r.Operacion
);
if (nf.TipoFactura >= ClaveTipoFacturaType.R1 )
{
nf.TipoRectificativa = TipoRectificativaEnum.POR_DIFERENCIAS;
nf.FacturasRectificadas = new List<tsFacturaRectificada>();
foreach (var frect in fr.InverseidLiquidacionRectificativaNavigation)
{
nf.FacturasRectificadas.Add(new tsFacturaRectificada
{
NumeroFacturaRectificada = frect.NumeroFacturaVF(confSI.ValorAlfabetico4),
FechaFacturaRectificada = frect.FechaFactura.Value,
BaseImponibleRectificada = frect.BaseImponible,
CuotaRectificada = frect.IVA,
CuotaRecargoRectificada = null
});
}
}
lf.Add(nf);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
return lf;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public static List<tsDetalle> ObtieneImpuestos(liquidacionesagentes factura)
// IdOperacionesTrascendenciaTributariaType:
// Representa el tipo de operación con trascendencia tributaria según el reglamento VERI*FACTU.
// Estos valores permiten clasificar las facturas según su naturaleza fiscal.
// 01 - Operación sujeta y no exenta de IVA
// 02 - Operación sujeta y exenta de IVA
// 03 - Operación no sujeta a IVA
// 04 - Operación intracomunitaria
// 05 - Exportación
// 06 - Régimen especial (agencias de viajes, bienes usados, etc.)
// 07 - Operación con inversión del sujeto pasivo
// 08 - Operación en régimen simplificado
// 09 - Operación en régimen de recargo de equivalencia
// 10 - Otras operaciones con relevancia tributaria
// S1,
// Operación sujeta a IVA (tipo general, reducido o superreducido).
// Ejemplo: Ventas estándar de bienes y servicios (21%, 10%, 4%).
// S2,
// Operación sujeta a IVA con régimen especial (Recargo de Equivalencia, Agricultura, etc.).
//Ejemplo: Ventas en Recargo de Equivalencia para comerciantes minoristas.
// N1,
// Operación exenta de IVA (pero declarable).
// Ejemplo: Servicios médicos, educación, servicios financieros exentos.
// N2
// Operación no sujeta a IVA (fuera del ámbito del impuesto).
// Ejemplo: Donaciones, ventas entre particulares no profesionales.
// CAUSA DE EXENCIÓN (E1 a E8 y NA)
/// <summary>
/// No asignada causa exención.
/// </summary>
///NA,
/// <summary>
/// Exenta por el artículo 20 (Exenciones en operaciones interiores).
/// </summary>
///E1,
/// <summary>
/// Exenta por el artículo 21 (Exportaciones).
/// </summary>
///E2,
/// <summary>
/// Exenta por el artículo 22 (Operaciones asimiladas a las
/// exportaciones: Navegación marítima internacional, aeronaves...).
/// </summary>
///E3,
/// <summary>
/// Exenta por los artículos 23 y 24 (Exenciones relativas a
/// regímenes aduaneros y fiscales: Depositos aduaneros...).
/// </summary>
///E4,
/// <summary>
/// Exenta por el artículo 25 (Operaciones UE).
/// </summary>
///E5,
/// <summary>
/// Exenta por otros.
/// </summary>
///E6,
/// <summary>
/// Reservado 1 Impuesto = “03” (IGIC)
/// </summary>
///E7,
/// <summary>
/// Reservado Impuesto = “03” (IGIC)
/// </summary>
///E8
{
List<tsDetalle> listaImpuestos = new List<tsDetalle>();
tsDetalle nd = new tsDetalle();
nd.ClaveRegimen = (IdOperacionesTrascendenciaTributariaType)factura.idSerieFacturaNavigation.TranscendenciaTributaria.Value;
nd.CalificacionOperacionOExencion = (CalificacionOperacionOExencionEnum)factura.idSerieFacturaNavigation.CalificacionOperacionesOExencion.Value;
nd.BaseImponibleOimporteNoSujeto = factura.BaseImponible;
// nd.ClaveRegimenSpecified = true;
if (factura.PorcentajeIVA.HasValue && factura.IVA > 0)
{
nd.TipoImpositivo = (double)factura.PorcentajeIVA;
nd.CuotaRepercutida = factura.IVA;
}
listaImpuestos.Add(nd);
return listaImpuestos;
}
public tsEncadenamiento? ObtenerUltimoEncadenamiento(string idEmisorFactura)
{
int pr = (int)bdAsegasa.db.registrosverifactu.EstadoEnum.PENDIENTE_RESPUESTA;
// int ae = (int)bdAsegasa.db.registrosverifactu.EstadoEnum.ACEPTADO_CON_ERRORES;
// int OperAlta = (int)bdAsegasa.db.registrosverifactu.OperacionEnum.ALTA;
var ultimoEncadenamiento = (
from rv in bd.registrosverifactu
join la in bd.liquidacionesagentes
on rv.idAplicacion equals la.idLiquidacionAgente
where rv.Estado > pr && !string.IsNullOrEmpty(rv.Huella) && la.idAgenteNavigation.CIF==idEmisorFactura
orderby rv.idRegistro descending
select new { Registro = rv, Liquidacion = la }
).FirstOrDefault();
//var ultimoEncadenamiento = bd.registrosverifactu
// .Where(x => x.Estado > pr && x.Huella != null && x.Huella != "")
// .OrderByDescending(x => x.idRegistro)
// .FirstOrDefault();
if (ultimoEncadenamiento != null)
{
liquidacionesagentes liq = bd.liquidacionesagentes.First(x => x.idLiquidacionAgente == ultimoEncadenamiento.Registro.idAplicacion);
return new tsEncadenamiento
{
ReferenciaExterna = ultimoEncadenamiento.Registro.idRegistro.ToString(),
FechaExpedicionFactura = liq.FechaFactura.Value,
NumSerieFactura = liq.NumeroFacturaVF(confSI.ValorAlfabetico4),
Huella = ultimoEncadenamiento.Registro.Huella,
IDEmisorFactura = idEmisorFactura
};
}
else
{
return null;
}
}
private peticionesverifactu? pvf;
public void GuardarPeticionAEAT(string Peticion)
{
pvf = new peticionesverifactu();
pvf.Peticion = System.Text.UTF8Encoding.UTF8.GetBytes(Peticion);
pvf.FechaHoraPeticion = DateTime.Now;
bd.Add(pvf);
bd.SaveChanges();
}
public void GuardarRespuestaAEAT(RespuestaRegFactuSistemaFacturacionType Respuesta, List<tsRegistroFacturacion> listadoRegistros)
{
try
{
pvf.Respuesta = System.Text.UTF8Encoding.UTF8.GetBytes(tsUtilidades.Utilidades.serializar(Respuesta));
pvf.FechaHoraRespuesta = DateTime.Now;
pvf.CSV = Respuesta.CSV;
var ProximoEnvio = DateTime.Now.AddSeconds(int.Parse(Respuesta.TiempoEsperaEnvio));
confVerifactu.Fecha3 = ProximoEnvio;
bd.SaveChanges();
foreach (var linea in Respuesta.RespuestaLinea)
{
// string nf = linea.IDFactura.NumSerieFactura;
int refex = int.Parse(linea.RefExterna);
var rvf = lrp.First(x => x.idRegistro == refex);
var tsRf = listadoRegistros.First(x => x.ReferenciaExterna == rvf.idRegistro.ToString());
rvf.Huella = tsRf.Huella;
rvf.FechaEncadenado = tsRf.FechaHoraHusoGenRegistro;
int? idRa = tsRf.EncadenamientoAnterior == null ? null : int.Parse(tsRf.EncadenamientoAnterior.ReferenciaExterna);
rvf.idRegistroAnterior = idRa;
rvf.idRespuestaVerifactuNavigation = pvf;
switch (linea.EstadoRegistro)
{
case EstadoRegistroType.Correcto:
rvf.Estado = (int)registrosverifactu.EstadoEnum.CORRECTO;
break;
case EstadoRegistroType.AceptadoConErrores:
rvf.Estado = (int)registrosverifactu.EstadoEnum.ACEPTADO_CON_ERRORES;
rvf.ErrorVerifactu = linea.DescripcionErrorRegistro.Acortar(500);
break;
case EstadoRegistroType.Incorrecto:
rvf.Estado = (int)registrosverifactu.EstadoEnum.INCORRECTO;
rvf.ErrorVerifactu = linea.DescripcionErrorRegistro.Acortar(500);
break;
}
}
bd.SaveChanges();
}
catch (Exception ex)
{
Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, ex);
}
}
public (bool,string, DateOnly?)? ObtenerUltimaFacturaEnviada(string Serie, DateOnly Fecha)
{
//int iAlta = (int)registrosverifactu.OperacionEnum.ALTA;
//int iPendiente = (int)registrosverifactu.EstadoEnum.PENDIENTE_RESPUESTA;
//liquidacionesagentes? ultimaFactura;
//if (Fecha.Year != 2025)
//{
// ultimaFactura = (
// from l in bd.liquidacionesagentes
// join r in bd.registrosverifactu
// on l.idLiquidacionAgente equals r.idAplicacion
// where l.idSerieFacturaNavigation.Serie == Serie
// && l.FechaFactura.HasValue
// && l.FechaFactura.Value.Year == Fecha.Year
// && r.Operacion == iAlta
// && r.Estado > iPendiente
// orderby l.NumeroFactura descending
// select l).FirstOrDefault();
// if (ultimaFactura != null)
// {
// return (true,ultimaFactura.NumeroFactura, ultimaFactura.FechaFactura.Value);
// }
// else
// {
// return null;
// }
//}
//else
//{
return (false,"", null); // Se devuelve vacío para que no se compruebe la numeración
//}
}
public void Excepcion(Exception ex, string RespuestaAEAT)
{
try
{
// Si la excepción es de tipo FACTURA_ERRONEA, se detiene el proceso de envío
if (pvf != null && RespuestaAEAT != null)
{
pvf.Respuesta = System.Text.UTF8Encoding.UTF8.GetBytes(RespuestaAEAT);
pvf.FechaHoraRespuesta = DateTime.Now;
pvf.Estado = (int)peticionesverifactu.EstadoEnum.ENVIO_RECHAZADO_O_CON_ERRORES;
}
if (!tsExcepcion.Es(ex, "RECHAZO_VERIFACTU.ERROR_503") && (!tsExcepcion.Es(ex, "RECHAZO_VERIFACTU.ERROR_EN_SERVICIO_AEAT")) || (confVerifactu.ValorNumerico4.HasValue && confVerifactu.ValorNumerico4.Value > 4))
{
string sMensaje = @"Error en envío de facturas por VERIFACTU. Los procesos de envío se detendrán. Una vez corregido los problemas se deberá reanudar manualmente los envíos.";
if (RespuestaAEAT != null) sMensaje += " Respuesta AEAT: " + RespuestaAEAT;
Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, sMensaje, ex);
confVerifactu.Fecha2 = DateTime.Now;
confVerifactu.ValorAlfabeticoLargo = ex.Message.Acortar(255);
}
else
{
string sMensaje = @"Servicio Verifactu no disponible, se reintentará en 1 Hora.";
if (RespuestaAEAT != null) sMensaje += " Respuesta AEAT: " + RespuestaAEAT;
Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Advertencia, sMensaje, ex);
confVerifactu.Fecha3 = DateTime.Now.AddHours(1);
confVerifactu.ValorAlfabeticoLargo = ex.Message.Acortar(255);
confVerifactu.ValorNumerico4 = confVerifactu.ValorNumerico4.HasValue ? confVerifactu.ValorNumerico4.Value + 1 : 1;
}
bd.SaveChanges();
}
catch (Exception ex2)
{
Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex2.Message + Environment.NewLine + ex.Message, ex2);
}
}
public void OperacionIncorrecta(tsRegistroFacturacion op, Exception ex)
{
int idAplicacion = int.Parse(op.ReferenciaExterna);
var rvf = lrp.First(x => x.idAplicacion == idAplicacion);
rvf.Estado = (int)registrosverifactu.EstadoEnum.INCORRECTO;
rvf.ErrorVerifactu = ex.Message.Acortar(500);
bd.SaveChanges();
}
public void Log(string Mensaje, TipoLog Tipo)
{
Logs.AñadeLog(Tipo, Mensaje);
}
}
}

55
WSAsegasa/Program.cs Normal file
View File

@@ -0,0 +1,55 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging.Configuration;
using Microsoft.Extensions.Logging.EventLog;
using Serilog;
using System.IO;
using System.Reflection;
using WSAsegasa;
public class Program
{
public static void Main(string[] args)
{
Serilog.Debugging.SelfLog.Enable(msg => Console.Error.WriteLine(msg));
bdAsegasa.db.Utilidades.VersionPrograma = tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version");
// Configura Serilog antes de construir el host
string path = "";
if (OperatingSystem.IsWindows())
{
path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\WSAsegasa\WSAsegasa.log";
}
else
{
path = @"/var/log/WSAsegasa/WSAsegasa.log";
}
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.File(path, rollingInterval: RollingInterval.Day)
.CreateLogger();
var host = CreateHostBuilder(args).Build();
host.Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
IConfiguration configuration = hostContext.Configuration;
Configuracion options = configuration.GetSection("Configuracion").Get<Configuracion>();
services.AddSingleton(options);
// Solo registrar WindowsService si estamos en Windows
if (OperatingSystem.IsWindows())
{
services.AddWindowsService(config =>
{
config.ServiceName = "WSAsegasa";
});
}
services.AddHostedService<Worker>();
});
}

View File

@@ -0,0 +1,12 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"WSAsegasa": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-WSAsegasa-3170e77c-9190-48a1-9c66-26323b65ac5d</UserSecretsId>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
<PackageReference Include="Quartz" Version="3.15.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="System.ServiceModel.Http" Version="8.1.2" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="8.1.2" />
<PackageReference Include="System.ServiceModel.Primitives" Version="8.1.2" />
<PackageReference Include="tsCorreos" Version="1.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Comunes\tsVeriFactu\tsVeriFactu.csproj" />
<ProjectReference Include="..\..\Tecnosis\tsFactu\bdFactu\bdfactu.csproj" />
<ProjectReference Include="..\bdAsegasa\bdAsegasa.csproj" />
</ItemGroup>
</Project>

185
WSAsegasa/Worker.cs Normal file
View File

@@ -0,0 +1,185 @@
using bdAsegasa;
using bdAsegasa.db;
using Microsoft.Extensions.Logging;
using Microsoft.VisualBasic;
using Quartz;
using Quartz.Impl;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing.Text;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Services.Description;
using tsUtilidades.SEPA_3414;
using WSAsegasa;
namespace WSAsegasa
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
public Worker(ILogger<Worker> logger, Configuracion Conf)
{
_logger = logger;
Procesos.Conf = Conf;
}
protected override async System.Threading.Tasks.Task ExecuteAsync(CancellationToken stoppingToken)
{
string Mensaje = "WSAsegasa. Versi<73>n: " + tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version");
try
{
if (Procesos.Conf.HoraProcesosDiarios != null)
{
Mensaje += " Hora Procesos Programados: " + Procesos.Conf.HoraProcesosDiarios;
CreaTareaProcesosDiarios();
}
CreaTareaEnvioFacturas();
Logs.A<EFBFBD>adeLog(tsUtilidades.Enumeraciones.TipoLog.InicioServicio, "Inicio " + Mensaje);
while (!stoppingToken.IsCancellationRequested)
{
if (_logger.IsEnabled(LogLevel.Information))
{
_logger.LogInformation("Servicio en ejecuci<63>n: {time}", DateTimeOffset.Now);
//Creo q aqui se deberia llamar a los servicios
}
Procesos.Procesar();
await System.Threading.Tasks.Task.Delay(1000*60*5, stoppingToken);
}
}
catch (OperationCanceledException)
{
// Logs.A<>adeLog(tsUtilidades.Enumeraciones.TipoLog.FinServicio, "Detenci<63>n " + Mensaje);
// When the stopping token is canceled, for example, a call made from services.msc,
// we shouldn't exit with a non-zero exit code. In other words, this is expected...
}
catch (Exception ex)
{
_logger.LogError(ex, "{Message}", ex.Message);
Environment.Exit(1);
}
}
public override async Task StopAsync(CancellationToken cancellationToken)
{
string Mensaje = "WSAsegasa. Versi<73>n: " + tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version");
Logs.A<EFBFBD>adeLog(tsUtilidades.Enumeraciones.TipoLog.FinServicio, "Finalizando " + Mensaje);
await base.StopAsync(cancellationToken);
Logs.A<EFBFBD>adeLog(tsUtilidades.Enumeraciones.TipoLog.FinServicio, "Servicio Finalizado " + Mensaje);
}
private void CreaTareaProcesosDiarios()
{
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
IScheduler scheduler = schedulerFactory.GetScheduler().Result;
scheduler.Start().Wait();
// Crear un trabajo
IJobDetail job = JobBuilder.Create<TareasProgramadas>()
.WithIdentity("TareasProgramadas", "Grupo1")
.Build();
// Crear un trigger que se ejecute diariamente a una hora espec<65>fica
int Hora = int.Parse(Procesos.Conf.HoraProcesosDiarios.Split(":")[0]);
int Minutos = int.Parse(Procesos.Conf.HoraProcesosDiarios.Split(":")[1]);
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("TareasProgramadas", "Grupo1")
.StartAt(DateBuilder.TodayAt(Hora, Minutos, 0))
.WithSimpleSchedule(x => x
.WithIntervalInHours(24)
.RepeatForever())
.Build();
// Programar el trabajo con el trigger
scheduler.ScheduleJob(job, trigger).Wait();
}
private void CreaTareaEnvioFacturas()
{
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
IScheduler scheduler = schedulerFactory.GetScheduler().Result;
scheduler.Start().Wait();
// Crear un trabajo
IJobDetail job = JobBuilder.Create<EnvioFacturas>()
.WithIdentity("EnvioFacturas", "Grupo1")
.Build();
// Crear un trigger que se ejecute diariamente a una hora espec<65>fica
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("EnvioFacturas", "Grupo1")
.StartAt(DateBuilder.TodayAt(DateTime.Now.Hour, DateTime.Now.Minute, 0))
.WithSimpleSchedule(x => x
.WithIntervalInMinutes(15)
.RepeatForever())
.Build();
// Programar el trabajo con el trigger
scheduler.ScheduleJob(job, trigger).Wait();
}
}
public class TareasProgramadas : IJob
{
public Task Execute(IJobExecutionContext context)
{
//var ch = bdTecnosis.db.chequeos;
// var bd = bdTecnosis.tscTecnosis.NuevoContexto();
//var c = bd.chequeos.FirstOrDefault(x => x.idChequeo == ch.idChequeo);
//Comprobaciones.ChequeaColaCorreo(bd,c);
//Comprobaciones.CompruebaReplica();
//Aqui van los procesos y comprobaciones
return Task.CompletedTask;
}
}
public class EnvioFacturas : IJob
{
private static readonly SemaphoreSlim _semaforo = new SemaphoreSlim(1, 1);
public async Task Execute(IJobExecutionContext context)
{
var cancellationToken = context.CancellationToken;
if (await _semaforo.WaitAsync(0, cancellationToken)) // no espera si est<73> ocupado
{
try
{
var ft = new ProcesosVeriFactuAsegasa();
await ft.Iniciar(cancellationToken);
}
catch (Exception ex)
{
Logs.A<EFBFBD>adeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, ex);
}
finally
{
_semaforo.Release();
}
}
else
{
var bd = tscgestionasegasa.NuevoContexto(Procesos.Conf.NombreConexionBD, true, false, true, "ProcesosVeriFactuTecnosis");
var cvf = bd.enumeraciones.First(x => x.Codigo == "VF.CONF");
if (DateTime.Now.Hour < cvf.ValorNumerico2.Value) Logs.A<EFBFBD>adeLog(tsUtilidades.Enumeraciones.TipoLog.Advertencia, "Bloqueo en EnvioFacturas");
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View File

@@ -0,0 +1,8 @@
{
"Configuracion": {
"SegundosMinimosEntreProcesos": "60",
"HoraProcesosDiarios": "06:30",
"NombreConexionBD": "Producción Remoto"
}
}

View File

@@ -0,0 +1,353 @@
<#@ template hostSpecific="true" #>
<#@ assembly name="Microsoft.EntityFrameworkCore" #>
<#@ assembly name="Microsoft.EntityFrameworkCore.Design" #>
<#@ assembly name="Microsoft.EntityFrameworkCore.Relational" #>
<#@ assembly name="Microsoft.Extensions.DependencyInjection.Abstractions" #>
<#@ parameter name="Model" type="Microsoft.EntityFrameworkCore.Metadata.IModel" #>
<#@ parameter name="Options" type="Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions" #>
<#@ parameter name="NamespaceHint" type="System.String" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="Microsoft.EntityFrameworkCore" #>
<#@ import namespace="Microsoft.EntityFrameworkCore.Design" #>
<#@ import namespace="Microsoft.EntityFrameworkCore.Infrastructure" #>
<#@ import namespace="Microsoft.EntityFrameworkCore.Scaffolding" #>
<#@ import namespace="Microsoft.Extensions.DependencyInjection" #>
<#
// Template version: 800 - please do NOT remove this line
if (!ProductInfo.GetVersion().StartsWith("8.0"))
{
Warning("Your templates were created using an older version of Entity Framework. Additional features and bug fixes may be available. See https://aka.ms/efcore-docs-updating-templates for more information.");
}
var services = (IServiceProvider)Host;
var providerCode = services.GetRequiredService<IProviderConfigurationCodeGenerator>();
var annotationCodeGenerator = services.GetRequiredService<IAnnotationCodeGenerator>();
var code = services.GetRequiredService<ICSharpHelper>();
var usings = new List<string>
{
"System",
"System.Collections.Generic",
"Microsoft.EntityFrameworkCore"
};
if (NamespaceHint != Options.ModelNamespace
&& !string.IsNullOrEmpty(Options.ModelNamespace))
{
usings.Add(Options.ModelNamespace);
}
if (!string.IsNullOrEmpty(NamespaceHint))
{
#>
namespace <#= NamespaceHint #>;
<#
}
#>
public partial class <#= Options.ContextName #> : DbContext
{
<#
if (!Options.SuppressOnConfiguring)
{
#>
public <#= Options.ContextName #>()
{
}
<#
}
#>
public <#= Options.ContextName #>(DbContextOptions<<#= Options.ContextName #>> options)
: base(options)
{
}
<#
foreach (var entityType in Model.GetEntityTypes().Where(e => !e.IsSimpleManyToManyJoinEntityType()))
{
#>
public virtual DbSet<<#= entityType.Name #>> <#= entityType.GetDbSetName() #> { get; set; }
<#
}
if (!Options.SuppressOnConfiguring)
{
#>
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
<#
if (!Options.SuppressConnectionStringWarning)
{
#>
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
<#
}
#>
=> optionsBuilder<#= code.Fragment(providerCode.GenerateUseProvider(Options.ConnectionString), indent: 3) #>;
<#
}
#>
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
<#
var anyConfiguration = false;
var modelFluentApiCalls = Model.GetFluentApiCalls(annotationCodeGenerator);
if (modelFluentApiCalls != null)
{
usings.AddRange(modelFluentApiCalls.GetRequiredUsings());
#>
modelBuilder<#= code.Fragment(modelFluentApiCalls, indent: 3) #>;
<#
anyConfiguration = true;
}
StringBuilder mainEnvironment;
foreach (var entityType in Model.GetEntityTypes().Where(e => !e.IsSimpleManyToManyJoinEntityType()))
{
// Save all previously generated code, and start generating into a new temporary environment
mainEnvironment = GenerationEnvironment;
GenerationEnvironment = new StringBuilder();
if (anyConfiguration)
{
WriteLine("");
}
var anyEntityTypeConfiguration = false;
#>
modelBuilder.Entity<<#= entityType.Name #>>(entity =>
{
<#
var key = entityType.FindPrimaryKey();
if (key != null)
{
var keyFluentApiCalls = key.GetFluentApiCalls(annotationCodeGenerator);
if (keyFluentApiCalls != null
|| (!key.IsHandledByConvention() && !Options.UseDataAnnotations))
{
if (keyFluentApiCalls != null)
{
usings.AddRange(keyFluentApiCalls.GetRequiredUsings());
}
#>
entity.HasKey(<#= code.Lambda(key.Properties, "e") #>)<#= code.Fragment(keyFluentApiCalls, indent: 4) #>;
<#
anyEntityTypeConfiguration = true;
}
}
var entityTypeFluentApiCalls = entityType.GetFluentApiCalls(annotationCodeGenerator)
?.FilterChain(c => !(Options.UseDataAnnotations && c.IsHandledByDataAnnotations));
if (entityTypeFluentApiCalls != null)
{
usings.AddRange(entityTypeFluentApiCalls.GetRequiredUsings());
if (anyEntityTypeConfiguration)
{
WriteLine("");
}
#>
entity<#= code.Fragment(entityTypeFluentApiCalls, indent: 4) #>;
<#
anyEntityTypeConfiguration = true;
}
foreach (var index in entityType.GetIndexes()
.Where(i => !(Options.UseDataAnnotations && i.IsHandledByDataAnnotations(annotationCodeGenerator))))
{
if (anyEntityTypeConfiguration)
{
WriteLine("");
}
var indexFluentApiCalls = index.GetFluentApiCalls(annotationCodeGenerator);
if (indexFluentApiCalls != null)
{
usings.AddRange(indexFluentApiCalls.GetRequiredUsings());
}
#>
entity.HasIndex(<#= code.Lambda(index.Properties, "e") #>, <#= code.Literal(index.GetDatabaseName()) #>)<#= code.Fragment(indexFluentApiCalls, indent: 4) #>;
<#
anyEntityTypeConfiguration = true;
}
var firstProperty = true;
foreach (var property in entityType.GetProperties())
{
var propertyFluentApiCalls = property.GetFluentApiCalls(annotationCodeGenerator)
?.FilterChain(c => !(Options.UseDataAnnotations && c.IsHandledByDataAnnotations)
&& !(c.Method == "IsRequired" && Options.UseNullableReferenceTypes && !property.ClrType.IsValueType));
if (propertyFluentApiCalls == null)
{
continue;
}
usings.AddRange(propertyFluentApiCalls.GetRequiredUsings());
if (anyEntityTypeConfiguration && firstProperty)
{
WriteLine("");
}
#>
entity.Property(e => e.<#= property.Name #>)<#= code.Fragment(propertyFluentApiCalls, indent: 4) #>;
<#
anyEntityTypeConfiguration = true;
firstProperty = false;
}
foreach (var foreignKey in entityType.GetForeignKeys())
{
var foreignKeyFluentApiCalls = foreignKey.GetFluentApiCalls(annotationCodeGenerator)
?.FilterChain(c => !(Options.UseDataAnnotations && c.IsHandledByDataAnnotations));
if (foreignKeyFluentApiCalls == null)
{
continue;
}
usings.AddRange(foreignKeyFluentApiCalls.GetRequiredUsings());
if (anyEntityTypeConfiguration)
{
WriteLine("");
}
#>
entity.HasOne(d => d.<#= foreignKey.DependentToPrincipal.Name #>).<#= foreignKey.IsUnique ? "WithOne" : "WithMany" #>(<#= foreignKey.PrincipalToDependent != null ? $"p => p.{foreignKey.PrincipalToDependent.Name}" : "" #>)<#= code.Fragment(foreignKeyFluentApiCalls, indent: 4) #>;
<#
anyEntityTypeConfiguration = true;
}
foreach (var skipNavigation in entityType.GetSkipNavigations().Where(n => n.IsLeftNavigation()))
{
if (anyEntityTypeConfiguration)
{
WriteLine("");
}
var left = skipNavigation.ForeignKey;
var leftFluentApiCalls = left.GetFluentApiCalls(annotationCodeGenerator, useStrings: true);
var right = skipNavigation.Inverse.ForeignKey;
var rightFluentApiCalls = right.GetFluentApiCalls(annotationCodeGenerator, useStrings: true);
var joinEntityType = skipNavigation.JoinEntityType;
if (leftFluentApiCalls != null)
{
usings.AddRange(leftFluentApiCalls.GetRequiredUsings());
}
if (rightFluentApiCalls != null)
{
usings.AddRange(rightFluentApiCalls.GetRequiredUsings());
}
#>
entity.HasMany(d => d.<#= skipNavigation.Name #>).WithMany(p => p.<#= skipNavigation.Inverse.Name #>)
.UsingEntity<Dictionary<string, object>>(
<#= code.Literal(joinEntityType.Name) #>,
r => r.HasOne<<#= right.PrincipalEntityType.Name #>>().WithMany()<#= code.Fragment(rightFluentApiCalls, indent: 6) #>,
l => l.HasOne<<#= left.PrincipalEntityType.Name #>>().WithMany()<#= code.Fragment(leftFluentApiCalls, indent: 6) #>,
j =>
{
<#
var joinKey = joinEntityType.FindPrimaryKey();
var joinKeyFluentApiCalls = joinKey.GetFluentApiCalls(annotationCodeGenerator);
if (joinKeyFluentApiCalls != null)
{
usings.AddRange(joinKeyFluentApiCalls.GetRequiredUsings());
}
#>
j.HasKey(<#= code.Arguments(joinKey.Properties.Select(e => e.Name)) #>)<#= code.Fragment(joinKeyFluentApiCalls, indent: 7) #>;
<#
var joinEntityTypeFluentApiCalls = joinEntityType.GetFluentApiCalls(annotationCodeGenerator);
if (joinEntityTypeFluentApiCalls != null)
{
usings.AddRange(joinEntityTypeFluentApiCalls.GetRequiredUsings());
#>
j<#= code.Fragment(joinEntityTypeFluentApiCalls, indent: 7) #>;
<#
}
foreach (var index in joinEntityType.GetIndexes())
{
var indexFluentApiCalls = index.GetFluentApiCalls(annotationCodeGenerator);
if (indexFluentApiCalls != null)
{
usings.AddRange(indexFluentApiCalls.GetRequiredUsings());
}
#>
j.HasIndex(<#= code.Literal(index.Properties.Select(e => e.Name).ToArray()) #>, <#= code.Literal(index.GetDatabaseName()) #>)<#= code.Fragment(indexFluentApiCalls, indent: 7) #>;
<#
}
foreach (var property in joinEntityType.GetProperties())
{
var propertyFluentApiCalls = property.GetFluentApiCalls(annotationCodeGenerator);
if (propertyFluentApiCalls == null)
{
continue;
}
usings.AddRange(propertyFluentApiCalls.GetRequiredUsings());
#>
j.IndexerProperty<<#= code.Reference(property.ClrType) #>>(<#= code.Literal(property.Name) #>)<#= code.Fragment(propertyFluentApiCalls, indent: 7) #>;
<#
}
#>
});
<#
anyEntityTypeConfiguration = true;
}
#>
});
<#
// If any signicant code was generated, append it to the main environment
if (anyEntityTypeConfiguration)
{
mainEnvironment.Append(GenerationEnvironment);
anyConfiguration = true;
}
// Resume generating code into the main environment
GenerationEnvironment = mainEnvironment;
}
foreach (var sequence in Model.GetSequences())
{
var needsType = sequence.Type != typeof(long);
var needsSchema = !string.IsNullOrEmpty(sequence.Schema) && sequence.Schema != sequence.Model.GetDefaultSchema();
var sequenceFluentApiCalls = sequence.GetFluentApiCalls(annotationCodeGenerator);
#>
modelBuilder.HasSequence<#= needsType ? $"<{code.Reference(sequence.Type)}>" : "" #>(<#= code.Literal(sequence.Name) #><#= needsSchema ? $", {code.Literal(sequence.Schema)}" : "" #>)<#= code.Fragment(sequenceFluentApiCalls, indent: 3) #>;
<#
}
if (anyConfiguration)
{
WriteLine("");
}
#>
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
<#
mainEnvironment = GenerationEnvironment;
GenerationEnvironment = new StringBuilder();
foreach (var ns in usings.Distinct().OrderBy(x => x, new NamespaceComparer()))
{
#>
using <#= ns #>;
<#
}
WriteLine("");
GenerationEnvironment.Append(mainEnvironment);
#>

View File

@@ -0,0 +1,176 @@
<#@ template hostSpecific="true" #>
<#@ assembly name="Microsoft.EntityFrameworkCore" #>
<#@ assembly name="Microsoft.EntityFrameworkCore.Design" #>
<#@ assembly name="Microsoft.EntityFrameworkCore.Relational" #>
<#@ assembly name="Microsoft.Extensions.DependencyInjection.Abstractions" #>
<#@ parameter name="EntityType" type="Microsoft.EntityFrameworkCore.Metadata.IEntityType" #>
<#@ parameter name="Options" type="Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions" #>
<#@ parameter name="NamespaceHint" type="System.String" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.ComponentModel.DataAnnotations" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="Microsoft.EntityFrameworkCore" #>
<#@ import namespace="Microsoft.EntityFrameworkCore.Design" #>
<#@ import namespace="Microsoft.Extensions.DependencyInjection" #>
<#
// Template version: 800 - please do NOT remove this line
if (EntityType.IsSimpleManyToManyJoinEntityType())
{
// Don't scaffold these
return "";
}
var services = (IServiceProvider)Host;
var annotationCodeGenerator = services.GetRequiredService<IAnnotationCodeGenerator>();
var code = services.GetRequiredService<ICSharpHelper>();
var usings = new List<string>
{
"System",
"System.Collections.Generic",
"PropertyChanged"
};
if (Options.UseDataAnnotations)
{
usings.Add("System.ComponentModel.DataAnnotations");
usings.Add("System.ComponentModel.DataAnnotations.Schema");
usings.Add("Microsoft.EntityFrameworkCore");
}
if (!string.IsNullOrEmpty(NamespaceHint))
{
#>
namespace <#= NamespaceHint #>;
<#
}
if (!string.IsNullOrEmpty(EntityType.GetComment()))
{
#>
/// <summary>
/// <#= code.XmlComment(EntityType.GetComment()) #>
/// </summary>
<#
}
if (Options.UseDataAnnotations)
{
foreach (var dataAnnotation in EntityType.GetDataAnnotations(annotationCodeGenerator))
{
#>
<#= code.Fragment(dataAnnotation) #>
<#
}
}
#>
[AddINotifyPropertyChangedInterface]
public partial class <#= EntityType.Name #>
{
<#
var firstProperty = true;
foreach (var property in EntityType.GetProperties().OrderBy(p => p.GetColumnOrder() ?? -1))
{
if (!firstProperty)
{
WriteLine("");
}
if (!string.IsNullOrEmpty(property.GetComment()))
{
#>
/// <summary>
/// <#= code.XmlComment(property.GetComment(), indent: 1) #>
/// </summary>
<#
}
if (Options.UseDataAnnotations)
{
var dataAnnotations = property.GetDataAnnotations(annotationCodeGenerator)
.Where(a => !(a.Type == typeof(RequiredAttribute) && Options.UseNullableReferenceTypes && !property.ClrType.IsValueType));
foreach (var dataAnnotation in dataAnnotations)
{
#>
<#= code.Fragment(dataAnnotation) #>
<#
}
}
usings.AddRange(code.GetRequiredUsings(property.ClrType));
var needsNullable = Options.UseNullableReferenceTypes && property.IsNullable && !property.ClrType.IsValueType;
var needsInitializer = Options.UseNullableReferenceTypes && !property.IsNullable && !property.ClrType.IsValueType;
#>
public <#= code.Reference(property.ClrType) #><#= needsNullable ? "?" : "" #> <#= property.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
<#
firstProperty = false;
}
foreach (var navigation in EntityType.GetNavigations())
{
WriteLine("");
if (Options.UseDataAnnotations)
{
foreach (var dataAnnotation in navigation.GetDataAnnotations(annotationCodeGenerator))
{
#>
<#= code.Fragment(dataAnnotation) #>
<#
}
}
var targetType = navigation.TargetEntityType.Name;
if (navigation.IsCollection)
{
#>
public virtual ICollection<<#= targetType #>> <#= navigation.Name #> { get; set; } = new List<<#= targetType #>>();
<#
}
else
{
var needsNullable = Options.UseNullableReferenceTypes && !(navigation.ForeignKey.IsRequired && navigation.IsOnDependent);
var needsInitializer = Options.UseNullableReferenceTypes && navigation.ForeignKey.IsRequired && navigation.IsOnDependent;
#>
public virtual <#= targetType #><#= needsNullable ? "?" : "" #> <#= navigation.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
<#
}
}
foreach (var skipNavigation in EntityType.GetSkipNavigations())
{
WriteLine("");
if (Options.UseDataAnnotations)
{
foreach (var dataAnnotation in skipNavigation.GetDataAnnotations(annotationCodeGenerator))
{
#>
<#= code.Fragment(dataAnnotation) #>
<#
}
}
#>
public virtual ICollection<<#= skipNavigation.TargetEntityType.Name #>> <#= skipNavigation.Name #> { get; set; } = new List<<#= skipNavigation.TargetEntityType.Name #>>();
<#
}
#>
}
<#
var previousOutput = GenerationEnvironment;
GenerationEnvironment = new StringBuilder();
foreach (var ns in usings.Distinct().OrderBy(x => x, new NamespaceComparer()))
{
#>
using <#= ns #>;
<#
}
WriteLine("");
GenerationEnvironment.Append(previousOutput);
#>

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bdAsegasa.db
{
public partial class liquidacionesagentes
{
public double TotalFacturaSinIRPF
{
get
{
return Math.Round(BaseImponible + IVA, 2, MidpointRounding.AwayFromZero);
}
}
public string NumeroFacturaVF(string? PrefijoPruebas)
{
if (PrefijoPruebas != null)
{
return PrefijoPruebas + NumeroFactura;
}
else
{
return NumeroFactura;
}
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bdAsegasa.db
{
public partial class peticionesverifactu
{
public enum EstadoEnum
{
PENDIENTE_RESPUESTA = 0,
CORRECTO = 1,
PARCIALMENTE_CORRECTO = 2,
INCORRECTO = 10,
ENVIO_RECHAZADO_O_CON_ERRORES = 11,
}
}
}

View File

@@ -0,0 +1,71 @@
 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static bdAsegasa.db.registrosverifactu;
namespace bdAsegasa.db
{
public partial class registrosverifactu
{
public string CSV
{
get
{
if (this.idRespuestaVerifactuNavigation == null)
{
return string.Empty;
}
else
{
return this.idRespuestaVerifactuNavigation.CSV;
}
}
}
public string DescripcionEstado
{
get
{
return ((EstadoEnum)this.Estado).ToString().Replace("_"," ");
}
}
public string DescripcionOperacion
{
get
{
return ((OperacionEnum)this.Operacion).ToString().Replace("_", " ");
}
}
public enum OperacionEnum
{
ALTA = 0,
SUBSANACION = 1,
ALTA_POR_RECHAZO = 2,
REENVÍO = 3,
ANULACIÓN = 9,
CONSULTA_DATOS = 5,
OBTENCIÓN_QR = 100
}
public enum EstadoEnum
{
PENDIENTE_RESPUESTA = 0,
CORRECTO = 1,
ACEPTADO_CON_ERRORES = 2,
INCORRECTO = 3,
COMPLETADO = 10
}
public enum AplicacionEnum
{
LIQUIDACION_AGENTE = 0,
}
}
}

View File

@@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
</Weavers>

143
bdAsegasa/Utilidades.cs Normal file
View File

@@ -0,0 +1,143 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using bdAsegasa.dbcontext;
using Microsoft.VisualBasic;
namespace bdAsegasa.db
{
public class Utilidades
{
public static string Usuario;
public static int idUsuario;
public static usuarios UsuarioActual;
public static string VersionPrograma { get; set; }
public static EventLog el;
public static string DirectorioLogs;
private static object oBloqueoLog = new object();
public static void AñadeLog(tsUtilidades.Enumeraciones.TipoLog Tipo, string Asunto, string Mensaje, Exception e = null)
{
// ----------------------------------------------------------------------------------------------------
// Descripción Sub: Gestión de logs de la aplicación
// Fecha. Creacion: ???
// Creada por: manmog
// Ultima Modificacion: 24/11/2010
//
// Modificaciones:
// ===============
lock (oBloqueoLog)
{
string sFicheroLog = DirectorioLogs + "Log-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + ".txt";
try
{
// if (!(e == null))
if (e != null) //davrod
{
if (el is not null)
el.WriteEntry(e.Message + Constants.vbCrLf + e.StackTrace, EventLogEntryType.Error);
string sStackTrace = "Tipo excepción: " + e.ToString() + Constants.vbCrLf;
var exError = e;
do
{
sStackTrace += exError.StackTrace + Constants.vbCrLf;
exError = exError.InnerException;
}
while (exError != null);
if (!string.IsNullOrEmpty(sStackTrace))
Mensaje += Constants.vbCrLf + "StackTrace: " + sStackTrace;
Anadelogtxt(Mensaje + " --- " + e.StackTrace, sFicheroLog);
}
switch (Tipo)
{
case tsUtilidades.Enumeraciones.TipoLog.Fallo:
case tsUtilidades.Enumeraciones.TipoLog.Advertencia:
{
if (Tipo == tsUtilidades.Enumeraciones.TipoLog.Fallo)
{
sFicheroLog = DirectorioLogs + "Errores-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + ".txt";
Asunto = "Error Servicio Tecnosis. " + ". Version:" + VersionPrograma + ". " + Asunto;
Mensaje = "Error Servicio Tecnosis. " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + VersionPrograma + ". Mensaje: " + Mensaje;
}
else
{
Asunto = "Advertencia Servicio Tecnosis. " + ". Version:" + VersionPrograma + ". " + Asunto;
Mensaje = "Advertencia Servicio Tecnosis. " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + VersionPrograma + ". " + Mensaje;
}
string sDireccionesEnvio = "sevilla@tecnosis.net";
string sServidorSMTP = "mail.tecnosis.net";
string sRemitente = "logs@tecnosis.es";
tsUtilidades.Correo.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje, null, "", "", sRemitente, "jtvdzklmujkechje", 587, true); //Cambiar contraseña de logs -> LoGs20i9.
break;
}
}
// Anadelogtxt(Mensaje + " --- " + e.StackTrace, sFicheroLog);
}
catch (Exception ex)
{
sFicheroLog = DirectorioLogs + @"Errores\Errores-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + ".txt";
if (e is not null)
Mensaje += " --- " + e.StackTrace;
Anadelogtxt(Mensaje + " ---" + ex.Message + " --- " + ex.StackTrace, sFicheroLog);
}
}
}
public static void Anadelogtxt(string Mensaje, string FicheroLog)
{
System.IO.StreamWriter sw = null;
try
{
Mensaje = Mensaje.Replace(Constants.vbCrLf, "---");
if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(FicheroLog)))
tsUtilidades.Utilidades.CreaEstructuraDirectorio(System.IO.Path.GetDirectoryName(FicheroLog));
if (System.IO.File.Exists(FicheroLog))
{
sw = System.IO.File.AppendText(FicheroLog);
}
else
{
sw = System.IO.File.CreateText(FicheroLog);
}
Mensaje = DateTime.Now.ToString() + "|" + "Ws: " + Process.GetCurrentProcess().WorkingSet64.ToString().PadLeft(20) + " PMS: " + Process.GetCurrentProcess().PrivateMemorySize64.ToString().PadLeft(20) + "|" + Mensaje;
sw.WriteLine(Mensaje);
}
catch (Exception ex)
{
try
{
string sDireccionesEnvio = "sevilla@tecnosis.net";
string sServidorSMTP = "mail.tecnosis.net";
string sRemitente = "logs@tecnosis.es";
// tsUtilidades.Correo.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje,,,,, "se9608dc.g")
tsUtilidades.Correo.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, "Error Anadelogtxt. " + Mensaje, Environment.MachineName + ".- " + ex.Message + Constants.vbCrLf + ex.StackTrace + Constants.vbCrLf + ex.Source, null, "", "", sRemitente, "jtvdzklmujkechje", 587, true); //Cambiar contraseña de logs -> LoGs20i9.
}
catch (Exception ex2)
{
}
}
finally
{
try
{
sw.Close();
}
catch
{
}
}
}
}
}

View File

@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="8.6.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.20" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.3" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
<PackageReference Include="tsEFCore8" Version="1.0.1" />
<PackageReference Include="tsUtilidades" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="db\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class accionessiniestros_eiac
{
public int idAccion { get; set; }
public int? idSiniestroEIAC { get; set; }
public int? NumeroOrden { get; set; }
public int? AccionSiniestro { get; set; }
public DateTime? FechaAccion { get; set; }
public string? DescripcionAccion { get; set; }
public int? SituacionAccion { get; set; }
public virtual siniestros_eiac? idSiniestroEIACNavigation { get; set; }
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class actassiniestrosagrario
{
public int idActa { get; set; }
public string? NumeroActa { get; set; }
public DateOnly? FechaActa { get; set; }
public int? idPolizaAgrario { get; set; }
public DateOnly? FechaFirmaFiniquito { get; set; }
public string? NumeroSiniestro { get; set; }
public string? NumeroSiniestroAgroseguro { get; set; }
public DateOnly? FechaOcurrencia { get; set; }
public int? idCausaSiniestro { get; set; }
public double? Importe { get; set; }
public DateOnly? FechaPago { get; set; }
public virtual enumeraciones? idCausaSiniestroNavigation { get; set; }
public virtual polizasagrario? idPolizaAgrarioNavigation { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class actualizacioneshp
{
public int idActualizacionHP { get; set; }
public string? Aplicacion { get; set; }
public string? ExpresionBusqueda { get; set; }
public string? idAplicacion { get; set; }
public DateTime? FechaUltimaActualizacion { get; set; }
public string? sha1 { get; set; }
public bool ContieneErrores { get; set; }
public DateTime? FechaUltimaComprobacion { get; set; }
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class actualizacionessiniestros_eiac
{
public int idActualizacion { get; set; }
public int idSiniestroEIAC { get; set; }
public int? idFicheroCompania { get; set; }
public DateTime Fecha { get; set; }
public DateTime? FechaVisto { get; set; }
public int? idUsuarioVisto { get; set; }
public virtual ficheroscompanias? idFicheroCompaniaNavigation { get; set; }
public virtual siniestros_eiac idSiniestroEIACNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioVistoNavigation { get; set; }
}

125
bdAsegasa/db/agentes.cs Normal file
View File

@@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class agentes
{
public int idAgente { get; set; }
public string? Codigo { get; set; }
public string? Nombre { get; set; }
/// <summary>
/// tabla direcciones
/// </summary>
public int? idDireccion { get; set; }
public string? CIF { get; set; }
public DateOnly? FechaAlta { get; set; }
public DateOnly? FechaBaja { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? Fax { get; set; }
public string? Clave { get; set; }
public double? IRPF { get; set; }
public double? LimiteCondicionesGenerales { get; set; }
public double? ComisionMenorIgualLimiteEmision { get; set; }
public double? ComisionMayorLimiteEmision { get; set; }
public double? ComisionMenorIgualLimiteCartera { get; set; }
public double? ComisionMayorLimiteCartera { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public int? idInspector { get; set; }
public string? CuentaContableC { get; set; }
public string? CuentaContableR { get; set; }
public string? IBAN { get; set; }
/// <summary>
/// enumeraciones Formas de pago
/// </summary>
public int? idFormaPago { get; set; }
public double? Rapell { get; set; }
/// <summary>
/// enumeraciones rutas
/// </summary>
public int? idRuta { get; set; }
public string? Observaciones { get; set; }
public string? Email { get; set; }
public string? NumeroColegiado { get; set; }
public uint? idSuborganizacion { get; set; }
public string? codigoUsuarioAvant2 { get; set; }
public string? contrasenaAvant2 { get; set; }
public string? MapeoCaser { get; set; }
public string? MapeoAllianz { get; set; }
public string? MapeoPelayo { get; set; }
public bool SinAcreditacion { get; set; }
public string? hashContrasena { get; set; }
public virtual ICollection<avant2__sso> avant2__sso { get; set; } = new List<avant2__sso>();
public virtual ICollection<comisionesagentes> comisionesagentes { get; set; } = new List<comisionesagentes>();
public virtual ICollection<expedientesagentes> expedientesagentes { get; set; } = new List<expedientesagentes>();
public virtual ICollection<historicocomisiones> historicocomisiones { get; set; } = new List<historicocomisiones>();
public virtual direcciones? idDireccionNavigation { get; set; }
public virtual enumeraciones? idFormaPagoNavigation { get; set; }
public virtual usuarios? idInspectorNavigation { get; set; }
public virtual enumeraciones? idRutaNavigation { get; set; }
public virtual avant2__suborganizaciones? idSuborganizacionNavigation { get; set; }
public virtual ICollection<incentivos> incentivos { get; set; } = new List<incentivos>();
public virtual ICollection<liquidacionesagentes> liquidacionesagentes { get; set; } = new List<liquidacionesagentes>();
public virtual ICollection<personasdecontactoagentes> personasdecontactoagentes { get; set; } = new List<personasdecontactoagentes>();
public virtual ICollection<polizasagrario> polizasagrario { get; set; } = new List<polizasagrario>();
public virtual ICollection<polizassg> polizassg { get; set; } = new List<polizassg>();
public virtual ICollection<recibos> recibos { get; set; } = new List<recibos>();
public virtual ICollection<regularizacionespagosagentes> regularizacionespagosagentes { get; set; } = new List<regularizacionespagosagentes>();
public virtual ICollection<subagentes> subagentes { get; set; } = new List<subagentes>();
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class agentes_subagentes
{
public string? id { get; set; }
public string? agente { get; set; }
public string? subagente { get; set; }
public string? clave { get; set; }
public string? nombre { get; set; }
public string? Email { get; set; }
public DateOnly? FechaBaja { get; set; }
public uint? idSuborganizacion { get; set; }
public string? codigoUsuarioAvant2 { get; set; }
public string? contrasenaAvant2 { get; set; }
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class amortizacionrecibos
{
public int idAmortizacion { get; set; }
public int? idRecibo { get; set; }
public DateOnly FechaInicioAmortizacion { get; set; }
public DateOnly FechaFinAmortizacion { get; set; }
public double? PorcentajeAnual { get; set; }
public DateOnly? FechaBaja { get; set; }
public int? idMotivoBaja { get; set; }
public int idEmpresa { get; set; }
public string? NumeroCuenta { get; set; }
public string? Observaciones { get; set; }
public DateOnly FechaAlta { get; set; }
public virtual ICollection<detallesamortizacionrecibos> detallesamortizacionrecibos { get; set; } = new List<detallesamortizacionrecibos>();
public virtual enumeraciones idEmpresaNavigation { get; set; } = null!;
public virtual enumeraciones? idMotivoBajaNavigation { get; set; }
public virtual recibos? idReciboNavigation { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class aplicacionesasientos
{
public int idAplicacionAsiento { get; set; }
public int? Tipo { get; set; }
public int? idAplicacion { get; set; }
public int? idAsiento { get; set; }
public virtual asientos? idAsientoNavigation { get; set; }
}

42
bdAsegasa/db/apuntes.cs Normal file
View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class apuntes
{
public int idApunte { get; set; }
/// <summary>
/// tabla cuentas
/// </summary>
public int idCuenta { get; set; }
public string? Concepto { get; set; }
public string? NumeroDocumento { get; set; }
public double Debe { get; set; }
public double Haber { get; set; }
public int idAsiento { get; set; }
public int? idConcepto { get; set; }
public DateTime? FechaPunteo { get; set; }
public int? TipoDocumento { get; set; }
public int? idConciliacion { get; set; }
public virtual asientos idAsientoNavigation { get; set; } = null!;
public virtual conceptosapuntes? idConceptoNavigation { get; set; }
public virtual conciliacionesbancarias? idConciliacionNavigation { get; set; }
public virtual cuentas idCuentaNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class apuntesmodelo
{
public int idApunteModelo { get; set; }
public string NumeroCuenta { get; set; } = null!;
public string? Concepto { get; set; }
public double Debe { get; set; }
public double Haber { get; set; }
public int idAsientoModelo { get; set; }
public int? idConcepto { get; set; }
public string? NumeroDocumento { get; set; }
public int? TipoDocumento { get; set; }
public int Orden { get; set; }
public virtual asientosmodelos idAsientoModeloNavigation { get; set; } = null!;
public virtual conceptosapuntes? idConceptoNavigation { get; set; }
}

51
bdAsegasa/db/asientos.cs Normal file
View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class asientos
{
public int idAsiento { get; set; }
public DateOnly Fecha { get; set; }
public int idEjercicio { get; set; }
public double Importe { get; set; }
public int? NumeroAsiento { get; set; }
public int Tipo { get; set; }
public DateTime FechaIntroduccion { get; set; }
public int? idUsuario { get; set; }
public int? idAsientoModelo { get; set; }
public DateTime? FechaPunteo { get; set; }
public virtual ICollection<aplicacionesasientos> aplicacionesasientos { get; set; } = new List<aplicacionesasientos>();
public virtual ICollection<apuntes> apuntes { get; set; } = new List<apuntes>();
public virtual asientosmodelos? idAsientoModeloNavigation { get; set; }
public virtual ejercicioscontables idEjercicioNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<liquidacionesagentes> liquidacionesagentes { get; set; } = new List<liquidacionesagentes>();
public virtual ICollection<liquidacionescompanias> liquidacionescompanias { get; set; } = new List<liquidacionescompanias>();
public virtual ICollection<pagosliquidacionescias> pagosliquidacionescias { get; set; } = new List<pagosliquidacionescias>();
public virtual ICollection<recibos> recibosidAsientoDevueltoBancoNavigation { get; set; } = new List<recibos>();
public virtual ICollection<recibos> recibosidAsientoFacturacionNavigation { get; set; } = new List<recibos>();
public virtual ICollection<remesas> remesas { get; set; } = new List<remesas>();
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class asientosmodelos
{
public int idAsientoModelo { get; set; }
public string Codigo { get; set; } = null!;
public DateTime FechaIntroduccion { get; set; }
public int? idUsuario { get; set; }
public string Descripcion { get; set; } = null!;
public virtual ICollection<apuntesmodelo> apuntesmodelo { get; set; } = new List<apuntesmodelo>();
public virtual ICollection<asientos> asientos { get; set; } = new List<asientos>();
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class autorizacionesgrupos
{
public int idAutorizaciongrupo { get; set; }
public int? idGrupo { get; set; }
public int? idPermiso { get; set; }
public bool PermitirConsultas { get; set; }
public bool PermitirNuevos { get; set; }
public bool PermitirModificaciones { get; set; }
public bool PermitirEliminaciones { get; set; }
public bool PermitirImpresiones { get; set; }
public bool PermitirExportar { get; set; }
public bool OtrosPermisos { get; set; }
public virtual gruposusuarios? idGrupoNavigation { get; set; }
public virtual permisos? idPermisoNavigation { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class autorizacionesusuarios
{
public int idAutorizaciones { get; set; }
public int? idUsuario { get; set; }
public int idPermiso { get; set; }
public bool PermitirConsultas { get; set; }
public bool PermitirNuevos { get; set; }
public bool PermitirModificaciones { get; set; }
public bool PermitirEliminaciones { get; set; }
public bool PermitirImpresiones { get; set; }
public bool PermitirExportar { get; set; }
public bool OtrosPermisos { get; set; }
public virtual permisos idPermisoNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class avant2__agentes
{
public uint id { get; set; }
public uint? id_suborganizacion { get; set; }
public string codigoAgente { get; set; } = null!;
public string codigoSubAgente { get; set; } = null!;
public string nombreAgente { get; set; } = null!;
public string? codigoUsuarioAvant2 { get; set; }
public string? contraseñaAvant2 { get; set; }
public virtual avant2__suborganizaciones? id_suborganizacionNavigation { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class avant2__sso
{
public uint id { get; set; }
public int? idAgente { get; set; }
public int? idSubagente { get; set; }
public DateTime creacion { get; set; }
public bool valido { get; set; }
public string token { get; set; } = null!;
public virtual agentes? idAgenteNavigation { get; set; }
public virtual subagentes? idSubagenteNavigation { get; set; }
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class avant2__suborganizaciones
{
public uint id { get; set; }
public string descripcion { get; set; } = null!;
public string codigo { get; set; } = null!;
public virtual ICollection<agentes> agentes { get; set; } = new List<agentes>();
public virtual ICollection<avant2__agentes> avant2__agentes { get; set; } = new List<avant2__agentes>();
public virtual ICollection<subagentes> subagentes { get; set; } = new List<subagentes>();
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class axa__tractores_temp1
{
public int idPoliza { get; set; }
public DateTime? FechaAlta { get; set; }
public DateOnly? FechaEnvioCompania { get; set; }
public string? NumeroPoliza { get; set; }
public DateOnly? FechaReciboCompania { get; set; }
public DateOnly FechaEfecto { get; set; }
public DateOnly FechaVencimiento { get; set; }
/// <summary>
/// tabla compañia
/// </summary>
public int idCompania { get; set; }
/// <summary>
/// tabla ramos
/// </summary>
public int idRamo { get; set; }
/// <summary>
/// tabla agentes
/// </summary>
public int idAgente { get; set; }
public int? idSubAgente { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public int? idTipoCobro { get; set; }
public string? Matricula { get; set; }
/// <summary>
/// Tabla Modelos
/// </summary>
public int? idModelo { get; set; }
public int NumeroSuplemento { get; set; }
/// <summary>
/// tabla usuarios, quien da de alta
/// </summary>
public int? idUsuario { get; set; }
public DateOnly? FechaBaja { get; set; }
/// <summary>
/// Tabla enumeraciones
/// </summary>
public int? idCausaBaja { get; set; }
public DateOnly? FechaIncorporacionPropuesta { get; set; }
public bool RechazoSuplemento { get; set; }
/// <summary>
/// Numero de poliza del multitarificador
/// </summary>
public int? idMultitarificador { get; set; }
public string? BienesAsegurados { get; set; }
public string? Coberturas { get; set; }
public string? Garantias { get; set; }
public string? Observaciones { get; set; }
public int? idTipoPago { get; set; }
public DateOnly? FechaMandato { get; set; }
public int? NumeroDirectorio { get; set; }
public string? IBAN { get; set; }
public string? DescripcionSuplemento { get; set; }
public int? idDuracion { get; set; }
public int? idSituacion { get; set; }
public int? idFicheroPresupuesto { get; set; }
public DateTime? FechaAceptacionPresupuesto { get; set; }
public int? idOrigenPresupuesto { get; set; }
public string? ReferenciaAsegasa { get; set; }
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class axa__tractores_temp2
{
public int idPoliza { get; set; }
public DateTime? FechaAlta { get; set; }
public DateOnly? FechaEnvioCompania { get; set; }
public string? NumeroPoliza { get; set; }
public DateOnly? FechaReciboCompania { get; set; }
public DateOnly FechaEfecto { get; set; }
public DateOnly FechaVencimiento { get; set; }
/// <summary>
/// tabla compañia
/// </summary>
public int idCompania { get; set; }
/// <summary>
/// tabla ramos
/// </summary>
public int idRamo { get; set; }
/// <summary>
/// tabla agentes
/// </summary>
public int idAgente { get; set; }
public int? idSubAgente { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public int? idTipoCobro { get; set; }
public string? Matricula { get; set; }
/// <summary>
/// Tabla Modelos
/// </summary>
public int? idModelo { get; set; }
public int NumeroSuplemento { get; set; }
/// <summary>
/// tabla usuarios, quien da de alta
/// </summary>
public int? idUsuario { get; set; }
public DateOnly? FechaBaja { get; set; }
/// <summary>
/// Tabla enumeraciones
/// </summary>
public int? idCausaBaja { get; set; }
public DateOnly? FechaIncorporacionPropuesta { get; set; }
public bool RechazoSuplemento { get; set; }
/// <summary>
/// Numero de poliza del multitarificador
/// </summary>
public int? idMultitarificador { get; set; }
public string? BienesAsegurados { get; set; }
public string? Coberturas { get; set; }
public string? Garantias { get; set; }
public string? Observaciones { get; set; }
public int? idTipoPago { get; set; }
public DateOnly? FechaMandato { get; set; }
public int? NumeroDirectorio { get; set; }
public string? IBAN { get; set; }
public string? DescripcionSuplemento { get; set; }
public int? idDuracion { get; set; }
public int? idSituacion { get; set; }
public int? idFicheroPresupuesto { get; set; }
public DateTime? FechaAceptacionPresupuesto { get; set; }
public int? idOrigenPresupuesto { get; set; }
public string? ReferenciaAsegasa { get; set; }
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class axa__tractores_temp3
{
public int idPoliza { get; set; }
public DateTime? FechaAlta { get; set; }
public DateOnly? FechaEnvioCompania { get; set; }
public string? NumeroPoliza { get; set; }
public DateOnly? FechaReciboCompania { get; set; }
public DateOnly FechaEfecto { get; set; }
public DateOnly FechaVencimiento { get; set; }
/// <summary>
/// tabla compañia
/// </summary>
public int idCompania { get; set; }
/// <summary>
/// tabla ramos
/// </summary>
public int idRamo { get; set; }
/// <summary>
/// tabla agentes
/// </summary>
public int idAgente { get; set; }
public int? idSubAgente { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public int? idTipoCobro { get; set; }
public string? Matricula { get; set; }
/// <summary>
/// Tabla Modelos
/// </summary>
public int? idModelo { get; set; }
public int NumeroSuplemento { get; set; }
/// <summary>
/// tabla usuarios, quien da de alta
/// </summary>
public int? idUsuario { get; set; }
public DateOnly? FechaBaja { get; set; }
/// <summary>
/// Tabla enumeraciones
/// </summary>
public int? idCausaBaja { get; set; }
public DateOnly? FechaIncorporacionPropuesta { get; set; }
public bool RechazoSuplemento { get; set; }
/// <summary>
/// Numero de poliza del multitarificador
/// </summary>
public int? idMultitarificador { get; set; }
public string? BienesAsegurados { get; set; }
public string? Coberturas { get; set; }
public string? Garantias { get; set; }
public string? Observaciones { get; set; }
public int? idTipoPago { get; set; }
public DateOnly? FechaMandato { get; set; }
public int? NumeroDirectorio { get; set; }
public string? IBAN { get; set; }
public string? DescripcionSuplemento { get; set; }
public int? idDuracion { get; set; }
public int? idSituacion { get; set; }
public int? idFicheroPresupuesto { get; set; }
public DateTime? FechaAceptacionPresupuesto { get; set; }
public int? idOrigenPresupuesto { get; set; }
public string? ReferenciaAsegasa { get; set; }
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class axa__tractores_temp4
{
public int idPoliza { get; set; }
public DateTime? FechaAlta { get; set; }
public DateOnly? FechaEnvioCompania { get; set; }
public string? NumeroPoliza { get; set; }
public DateOnly? FechaReciboCompania { get; set; }
public DateOnly FechaEfecto { get; set; }
public DateOnly FechaVencimiento { get; set; }
/// <summary>
/// tabla compañia
/// </summary>
public int idCompania { get; set; }
/// <summary>
/// tabla ramos
/// </summary>
public int idRamo { get; set; }
/// <summary>
/// tabla agentes
/// </summary>
public int idAgente { get; set; }
public int? idSubAgente { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public int? idTipoCobro { get; set; }
public string? Matricula { get; set; }
/// <summary>
/// Tabla Modelos
/// </summary>
public int? idModelo { get; set; }
public int NumeroSuplemento { get; set; }
/// <summary>
/// tabla usuarios, quien da de alta
/// </summary>
public int? idUsuario { get; set; }
public DateOnly? FechaBaja { get; set; }
/// <summary>
/// Tabla enumeraciones
/// </summary>
public int? idCausaBaja { get; set; }
public DateOnly? FechaIncorporacionPropuesta { get; set; }
public bool RechazoSuplemento { get; set; }
/// <summary>
/// Numero de poliza del multitarificador
/// </summary>
public int? idMultitarificador { get; set; }
public string? BienesAsegurados { get; set; }
public string? Coberturas { get; set; }
public string? Garantias { get; set; }
public string? Observaciones { get; set; }
public int? idTipoPago { get; set; }
public DateOnly? FechaMandato { get; set; }
public int? NumeroDirectorio { get; set; }
public string? IBAN { get; set; }
public string? DescripcionSuplemento { get; set; }
public int? idDuracion { get; set; }
public int? idSituacion { get; set; }
public int? idFicheroPresupuesto { get; set; }
public DateTime? FechaAceptacionPresupuesto { get; set; }
public int? idOrigenPresupuesto { get; set; }
public string? ReferenciaAsegasa { get; set; }
}

17
bdAsegasa/db/bancos.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class bancos
{
public string Codigo { get; set; } = null!;
public string? Nombre { get; set; }
public string? BIC { get; set; }
public bool? Obsoleto { get; set; }
}

19
bdAsegasa/db/bloqueos.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class bloqueos
{
public int idBloqueo { get; set; }
public int idSesion { get; set; }
public string Aplicacion { get; set; } = null!;
public string idRegistroBloqueado { get; set; } = null!;
public virtual sesiones idSesionNavigation { get; set; } = null!;
}

39
bdAsegasa/db/cajas.cs Normal file
View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class cajas
{
public int idCaja { get; set; }
public string Descripcion { get; set; } = null!;
public int Tipo { get; set; }
public int? idPermiso { get; set; }
public string? IBAN { get; set; }
public DateOnly? FechaBaja { get; set; }
public float SaldoAlCierre { get; set; }
public DateOnly? FechaCierre { get; set; }
public string? SufijoBancario { get; set; }
public string Codigo { get; set; } = null!;
public int Contador { get; set; }
public string? CuentaContable { get; set; }
public virtual ICollection<conciliacionesbancarias> conciliacionesbancarias { get; set; } = new List<conciliacionesbancarias>();
public virtual ICollection<extractosbancarios> extractosbancarios { get; set; } = new List<extractosbancarios>();
public virtual permisos? idPermisoNavigation { get; set; }
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__autologin
{
public uint id { get; set; }
public string? claveagencia { get; set; }
public string? subagencia { get; set; }
public string csb { get; set; } = null!;
public string? distribuidor { get; set; }
public string? puntodeventa { get; set; }
public string? produccionenvigor { get; set; }
public string? oficina { get; set; }
public string? terminal { get; set; }
public string? nivel { get; set; }
public bool oculto { get; set; }
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__autologin__agentes
{
public string? agente { get; set; }
public string? subagente { get; set; }
public string? nombre { get; set; }
public string csb { get; set; } = null!;
public string? distribuidor { get; set; }
public string? produccionenvigor { get; set; }
public string? oficina { get; set; }
public string? terminal { get; set; }
public string? nivel { get; set; }
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__marcas
{
public int id { get; set; }
public string? MARCA { get; set; }
public string? FILLER { get; set; }
public DateTime? FECHA_ACTUALIZACION { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__modelos
{
public int id { get; set; }
public string? MARCA { get; set; }
public string? MODELO { get; set; }
public string? FILLER { get; set; }
public DateTime? FECHA_ACTUALIZACION { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__tipos_combustible
{
public int id { get; set; }
public string? CODIGO { get; set; }
public string? COMBUSTIBLE { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__tipos_vehiculos
{
public int id { get; set; }
public string? COD_TIPO_VEHICULO { get; set; }
public string? DENOMINACION { get; set; }
public string? CLASE_VEHICULO { get; set; }
public string? DESC_CLASE { get; set; }
public string? CATEGORIA { get; set; }
public string? FILLER { get; set; }
public DateTime? FECHA_ACTUALIZACION { get; set; }
}

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class caser__versiones
{
public int id { get; set; }
public string COD_VEHICULO { get; set; } = null!;
public string? COD_TIPO_VEHICULO { get; set; }
public string? MARCA { get; set; }
public string? MODELO { get; set; }
public string? VERSION { get; set; }
public int? PUERTAS { get; set; }
public int? POTENCIA { get; set; }
public string? TIPO_VEHICULO { get; set; }
public string? COMBUSTIBLE { get; set; }
public int? TARA { get; set; }
public int? PMA { get; set; }
public int? CILINDRADA { get; set; }
public int? VOLUMEN { get; set; }
public string? CHASIS { get; set; }
public string? LONGITUD { get; set; }
public string? CAJA { get; set; }
public string? CERRAMIENTO { get; set; }
public string? TECHO { get; set; }
public int? FECHA_LANZAMIENTO { get; set; }
public int? PLAZAS { get; set; }
public string? COD_PROHIBICION { get; set; }
public string? CLASE_VEHICULO { get; set; }
public string? FILLER { get; set; }
public DateTime? FECHA_ACTUALIZACION { get; set; }
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class celdasinformescontables
{
public int idCelda { get; set; }
public int Hoja { get; set; }
public int Fila { get; set; }
public string Columna { get; set; } = null!;
public int idInformeContable { get; set; }
public string? Observaciones { get; set; }
public string NombreCampo { get; set; } = null!;
public virtual ICollection<cuentasceldasinformescontables> cuentasceldasinformescontables { get; set; } = new List<cuentasceldasinformescontables>();
public virtual informescontables idInformeContableNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class certificados
{
public int idCertificado { get; set; }
public string? Codigo { get; set; }
public string? CIF { get; set; }
public string? Tipo { get; set; }
public string? Titulo { get; set; }
public string? CERT_ID { get; set; }
public DateTime? FechaValidez { get; set; }
public DateTime? FechaCreacion { get; set; }
public DateTime? FechaCaducidad { get; set; }
public string? Observaciones { get; set; }
public byte[]? ContenedorClaves { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class codigospostales
{
public int idCodigoPostal { get; set; }
public string CodigoPostal { get; set; } = null!;
public string CodigoMunicipio { get; set; } = null!;
public string? DescripcionAdicional { get; set; }
public virtual municipios CodigoMunicipioNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class colectivos
{
public int idColectivo { get; set; }
public string? descripcion { get; set; }
public string? numeroOrden { get; set; }
public string? referenciaHP { get; set; }
public virtual ICollection<polizasagrario> polizasagrario { get; set; } = new List<polizasagrario>();
}

19
bdAsegasa/db/comarcas.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class comarcas
{
public string CodigoComarca { get; set; } = null!;
public string CodigoProvincia { get; set; } = null!;
public string? Nombre { get; set; }
public virtual provincias CodigoProvinciaNavigation { get; set; } = null!;
public virtual ICollection<municipios> municipios { get; set; } = new List<municipios>();
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class comisionesagentes
{
public int idComisionAgente { get; set; }
public int? idAgente { get; set; }
public int? idCompania { get; set; }
public int? idRamo { get; set; }
public double? Limite { get; set; }
public double? ComisionMenorIgualLimiteEmision { get; set; }
public double? ComisionMenorIgualLimiteCartera { get; set; }
public double? ComisionMayorLimiteEmision { get; set; }
public double? ComisionMayorLimiteCartera { get; set; }
public virtual agentes? idAgenteNavigation { get; set; }
public virtual companias? idCompaniaNavigation { get; set; }
public virtual ramos? idRamoNavigation { get; set; }
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class comisionescompanias
{
public int idComisionCompania { get; set; }
/// <summary>
/// tabla compañias
/// </summary>
public int? idCompania { get; set; }
/// <summary>
/// tabla ramos
/// </summary>
public int? idRamo { get; set; }
public double? PorcentajeComisionEmision { get; set; }
public double? PorcentajeComisionCartera { get; set; }
public double? PorcentajeComisionEmisionAgente { get; set; }
public double? PorcentajeComisionCarteraAgente { get; set; }
public DateOnly? FechaInicioCampana { get; set; }
public DateOnly? FechaFinCampana { get; set; }
public virtual companias? idCompaniaNavigation { get; set; }
public virtual ramos? idRamoNavigation { get; set; }
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class comisionlineacompania
{
public int idComisionLineaCompania { get; set; }
public int? idCompania { get; set; }
public DateOnly? fechaInicio { get; set; }
public DateOnly? fechaFinal { get; set; }
public string? codigoASEGASA { get; set; }
public string? planLinea { get; set; }
public double? porcentajeComision { get; set; }
public double? porcentajeOGAS { get; set; }
public double? porcentajeCGI { get; set; }
public double? incentivos { get; set; }
public virtual companias? idCompaniaNavigation { get; set; }
}

133
bdAsegasa/db/companias.cs Normal file
View File

@@ -0,0 +1,133 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class companias
{
public int idCompania { get; set; }
public string? Codigo { get; set; }
public string? CodigoAsegasa { get; set; }
public string? Nombre { get; set; }
public string? CodigoAgrario { get; set; }
public int? idDireccion { get; set; }
public string? CIF { get; set; }
public DateOnly? FechaAlta { get; set; }
public DateOnly? FechaBaja { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? Fax { get; set; }
public double? LimiteRecargoExterno { get; set; }
/// <summary>
/// tabla enumeraciones
///
/// </summary>
public int? idTipoCobro { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public double? Consorcio { get; set; }
public int? PlazoRetornoComision { get; set; }
public int? DiaPlazoRetornoComision { get; set; }
public string? CBSB { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public int? idTipoRedondeo { get; set; }
public string? CuentaRecargosExternos { get; set; }
public string? CuentaAlCobro { get; set; }
public double? Rapell { get; set; }
public string? Sufijo { get; set; }
public string? Observaciones { get; set; }
public string? Email { get; set; }
public int? idUsuarioRevisor { get; set; }
public string? IBANLiquidacion { get; set; }
public string? emailLiquidacion { get; set; }
public int FormaLiquidacion { get; set; }
public string? CodigoDGS { get; set; }
public double LimiteRemesa { get; set; }
public int? NumeroDiasLimiteRemesa { get; set; }
public int? NumeroDiasLimiteFBCartera { get; set; }
public int? NumeroDiasLimiteFBEmision { get; set; }
public string? IBANCobros1 { get; set; }
public string? IBANCobros2 { get; set; }
public string? IBANCobros3 { get; set; }
public string? IBANCobros4 { get; set; }
public string? Usuario { get; set; }
public string? Contrasenna { get; set; }
public virtual ICollection<comisionesagentes> comisionesagentes { get; set; } = new List<comisionesagentes>();
public virtual ICollection<comisionescompanias> comisionescompanias { get; set; } = new List<comisionescompanias>();
public virtual ICollection<comisionlineacompania> comisionlineacompania { get; set; } = new List<comisionlineacompania>();
public virtual ICollection<departamentoscontactocompanias> departamentoscontactocompanias { get; set; } = new List<departamentoscontactocompanias>();
public virtual ICollection<excepcionesciasramos> excepcionesciasramos { get; set; } = new List<excepcionesciasramos>();
public virtual ICollection<ficheroscompanias> ficheroscompanias { get; set; } = new List<ficheroscompanias>();
public virtual direcciones? idDireccionNavigation { get; set; }
public virtual enumeraciones? idTipoCobroNavigation { get; set; }
public virtual enumeraciones? idTipoRedondeoNavigation { get; set; }
public virtual usuarios? idUsuarioRevisorNavigation { get; set; }
public virtual ICollection<incentivos> incentivos { get; set; } = new List<incentivos>();
public virtual ICollection<pagosliquidacionescias> pagosliquidacionescias { get; set; } = new List<pagosliquidacionescias>();
public virtual ICollection<personasdecontactocompanias> personasdecontactocompanias { get; set; } = new List<personasdecontactocompanias>();
public virtual ICollection<polizasagrario> polizasagrario { get; set; } = new List<polizasagrario>();
public virtual ICollection<polizassg> polizassg { get; set; } = new List<polizassg>();
public virtual ICollection<ramosdgscompania> ramosdgscompania { get; set; } = new List<ramosdgscompania>();
public virtual ICollection<siniestros_eiac> siniestros_eiac { get; set; } = new List<siniestros_eiac>();
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class conceptosapuntes
{
public int idConcepto { get; set; }
public string Concepto { get; set; } = null!;
public string Codigo { get; set; } = null!;
public virtual ICollection<apuntes> apuntes { get; set; } = new List<apuntes>();
public virtual ICollection<apuntesmodelo> apuntesmodelo { get; set; } = new List<apuntesmodelo>();
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class conciliacionesbancarias
{
public int idconciliacion { get; set; }
public DateTime FechaConciliacion { get; set; }
public int? idUsuario { get; set; }
public float TotalApuntes { get; set; }
public float TotalMovimientosBancarios { get; set; }
public DateOnly FechaInicio { get; set; }
public DateOnly FechaFin { get; set; }
public int idCaja { get; set; }
public virtual ICollection<apuntes> apuntes { get; set; } = new List<apuntes>();
public virtual cajas idCajaNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<movimientosbancarios> movimientosbancarios { get; set; } = new List<movimientosbancarios>();
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class conexiones
{
public int idConexion { get; set; }
public string? Usuario { get; set; }
public string? ip { get; set; }
public DateTime? FechaHora { get; set; }
public int idMysql { get; set; }
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class conexionesbd
{
public int idconexionesbd { get; set; }
public int idgrupobd { get; set; }
public string? ServidorLocal { get; set; }
public string? ServidorRemoto { get; set; }
public int? PuertoLocal { get; set; }
public int? PuertoRemoto { get; set; }
public string? Usuario { get; set; }
public string? Password { get; set; }
public string? Esquema { get; set; }
public virtual grupobd idgrupobdNavigation { get; set; } = null!;
}

65
bdAsegasa/db/correos.cs Normal file
View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class correos
{
public int idcorreo { get; set; }
public int? idcuenta { get; set; }
public string? Remitente { get; set; }
public string? Destinatario { get; set; }
public string? Copia { get; set; }
public string? CopiaOculta { get; set; }
public string? DireccionRespuesta { get; set; }
public string? Asunto { get; set; }
public string? Cuerpo { get; set; }
public string? RutaFicheroAdjunto { get; set; }
public int? idFicheroAdjunto { get; set; }
public DateTime? FechaCreacion { get; set; }
public DateTime? FechaEnvio { get; set; }
public DateTime? FechaUltimoIntento { get; set; }
public DateTime? FechaAnulacion { get; set; }
public DateTime? FechaAvisoError { get; set; }
public int? idAplicacion { get; set; }
public string? CodigoAplicacion { get; set; }
public bool Reciclable { get; set; }
public string? DescripcionError { get; set; }
public virtual ICollection<documentospolizassg> documentospolizassg { get; set; } = new List<documentospolizassg>();
public virtual ICollection<ficherosadjuntos> ficherosadjuntos { get; set; } = new List<ficherosadjuntos>();
public virtual ICollection<gestionesrecibos> gestionesrecibos { get; set; } = new List<gestionesrecibos>();
public virtual ICollection<gestionesvarias> gestionesvarias { get; set; } = new List<gestionesvarias>();
public virtual ficheros? idFicheroAdjuntoNavigation { get; set; }
public virtual cuentascorreo? idcuentaNavigation { get; set; }
public virtual ICollection<liquidacionesagentes> liquidacionesagentes { get; set; } = new List<liquidacionesagentes>();
public virtual ICollection<pagosliquidacionescias> pagosliquidacionescias { get; set; } = new List<pagosliquidacionescias>();
}

55
bdAsegasa/db/cuentas.cs Normal file
View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class cuentas
{
public int idCuenta { get; set; }
public string? Mote { get; set; }
public string Denominacion { get; set; } = null!;
public double PresupuestoEnero { get; set; }
public double PresupuestoFebrero { get; set; }
public double PresupuestoMarzo { get; set; }
public double PresupuestoAbril { get; set; }
public double PresupuestoMayo { get; set; }
public double PresupuestoJunio { get; set; }
public double PresupuestoJulio { get; set; }
public double PresupuestoAgosto { get; set; }
public double PresupuestoSeptiembre { get; set; }
public double PresupuestoOctubre { get; set; }
public double PresupuestoNoviembre { get; set; }
public double PresupuestoDiciembre { get; set; }
public string? Observaciones { get; set; }
public string NumeroCuenta { get; set; } = null!;
public int idEjercicio { get; set; }
public int? idEmpresaAmortizacion { get; set; }
public bool EsCuentaFinal { get; set; }
public virtual ICollection<apuntes> apuntes { get; set; } = new List<apuntes>();
public virtual ejercicioscontables idEjercicioNavigation { get; set; } = null!;
public virtual enumeraciones? idEmpresaAmortizacionNavigation { get; set; }
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class cuentasceldasinformescontables
{
public int idCuenta { get; set; }
public string NumeroCuenta { get; set; } = null!;
public int Factor { get; set; }
public bool SoloSiPositivo { get; set; }
public bool SoloSiNegativo { get; set; }
public int? idCelda { get; set; }
public virtual celdasinformescontables? idCeldaNavigation { get; set; }
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class cuentascorreo
{
public int idCuenta { get; set; }
public string? Codigo { get; set; }
public string? ServidorSMTP { get; set; }
public string? Remitente { get; set; }
public string? CuentaCorreo { get; set; }
public string? Password { get; set; }
public int? Puerto { get; set; }
public bool SSL { get; set; }
public bool Deshabilitada { get; set; }
public string? ResponderA { get; set; }
public string? ParametroConexion1 { get; set; }
public string? ParametroConexion2 { get; set; }
public DateTime? FechaAvisoCaducidadCredenciales { get; set; }
public virtual ICollection<correos> correos { get; set; } = new List<correos>();
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class departamentos
{
public int idDepartamentos { get; set; }
public string Descripcion { get; set; } = null!;
public int idUsuarioResponsable { get; set; }
public virtual ICollection<departamentosmiembros> departamentosmiembros { get; set; } = new List<departamentosmiembros>();
public virtual usuarios idUsuarioResponsableNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class departamentoscontactocompanias
{
public int idDepartamentosContactoCompania { get; set; }
public int? idCompania { get; set; }
public int? idDepartamento { get; set; }
public string? Telefono { get; set; }
public string? Email { get; set; }
public bool MostrarEnAPP { get; set; }
public virtual companias? idCompaniaNavigation { get; set; }
public virtual enumeraciones? idDepartamentoNavigation { get; set; }
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class departamentosmiembros
{
public int idDepartamentosMiembros { get; set; }
public int idDepartamento { get; set; }
public int idUsuario { get; set; }
public int idPuesto { get; set; }
public virtual departamentos idDepartamentoNavigation { get; set; } = null!;
public virtual enumeraciones idPuestoNavigation { get; set; } = null!;
public virtual usuarios idUsuarioNavigation { get; set; } = null!;
}

19
bdAsegasa/db/destinos.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class destinos
{
public int idDestinos { get; set; }
public int idLiquidacionViaje { get; set; }
public string? Lugar { get; set; }
public string? Concepto { get; set; }
public virtual liquidacionesviajes idLiquidacionViajeNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class detallesamortizacionrecibos
{
public int idDetalle { get; set; }
public int Mes { get; set; }
public double ValorAmortizado { get; set; }
public double ValorAcumulado { get; set; }
public double ValorResidual { get; set; }
public int? idAmortizacion { get; set; }
public DateTime? FechaAplicacion { get; set; }
public virtual amortizacionrecibos? idAmortizacionNavigation { get; set; }
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class direcciones
{
public int idDireccion { get; set; }
public string? Direccion { get; set; }
public int? idEntidad { get; set; }
public string? CodigoPostal { get; set; }
public string? CodigoMunicipio { get; set; }
public int? idTipo { get; set; }
public virtual municipios? CodigoMunicipioNavigation { get; set; }
public virtual ICollection<agentes> agentes { get; set; } = new List<agentes>();
public virtual ICollection<companias> companias { get; set; } = new List<companias>();
public virtual ICollection<entidades> entidades { get; set; } = new List<entidades>();
public virtual ICollection<entidadespolizas> entidadespolizas { get; set; } = new List<entidadespolizas>();
public virtual entidades? idEntidadNavigation { get; set; }
public virtual enumeraciones? idTipoNavigation { get; set; }
public virtual ICollection<polizasagrario> polizasagrario { get; set; } = new List<polizasagrario>();
public virtual ICollection<siniestros_eiac> siniestros_eiac { get; set; } = new List<siniestros_eiac>();
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class documentosasolicitar
{
public int idDocumento { get; set; }
public int idRamo { get; set; }
public int idTipo { get; set; }
public string? Observaciones { get; set; }
public bool SolicitarAAgente { get; set; }
public bool EnviarEmailAAsegasa { get; set; }
public bool Obligatorio { get; set; }
public virtual ICollection<documentospolizassg> documentospolizassg { get; set; } = new List<documentospolizassg>();
public virtual ramos idRamoNavigation { get; set; } = null!;
public virtual enumeraciones idTipoNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class documentospolizasagrario
{
public int idDocumento { get; set; }
public string? Descripcion { get; set; }
public int idPoliza { get; set; }
public int? idFichero { get; set; }
public DateTime? Fecha { get; set; }
public int? idUsuarioAdjuntaFichero { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual polizasagrario idPolizaNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioAdjuntaFicheroNavigation { get; set; }
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class documentospolizassg
{
public int idDocumento { get; set; }
public string? Descripcion { get; set; }
public int idPoliza { get; set; }
public int? idDocumentoASolicitar { get; set; }
public int? idFichero { get; set; }
public DateTime? FechaComprobacion { get; set; }
public int? idUsuarioComprueba { get; set; }
public int? idCorreoAsegasa { get; set; }
public bool Obligatorio { get; set; }
public DateTime? Fecha { get; set; }
public int? idUsuarioAdjuntaFichero { get; set; }
public int? idRecibo { get; set; }
public string? Codigo { get; set; }
public int Tipo { get; set; }
public string? Hash { get; set; }
public virtual correos? idCorreoAsegasaNavigation { get; set; }
public virtual documentosasolicitar? idDocumentoASolicitarNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual polizassg idPolizaNavigation { get; set; } = null!;
public virtual recibos? idReciboNavigation { get; set; }
public virtual usuarios? idUsuarioAdjuntaFicheroNavigation { get; set; }
public virtual usuarios? idUsuarioCompruebaNavigation { get; set; }
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class documentossiniestros
{
public int idDocumento { get; set; }
public string? Descripcion { get; set; }
public DateTime? Fecha { get; set; }
public byte[]? Fichero { get; set; }
public int? idSiniestro { get; set; }
public string? NombreFichero { get; set; }
public virtual siniestros? idSiniestroNavigation { get; set; }
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class documentosvarios
{
public int idDocumentosVarios { get; set; }
public string? Descripcion { get; set; }
public int? idUsuarioRevisor { get; set; }
public DateTime FechaEmision { get; set; }
public DateTime? FechaRevision { get; set; }
public DateTime? FechaModificacion { get; set; }
public int idTipo { get; set; }
public int idEstado { get; set; }
public int idFichero { get; set; }
public virtual enumeraciones idEstadoNavigation { get; set; } = null!;
public virtual ficheros idFicheroNavigation { get; set; } = null!;
public virtual enumeraciones idTipoNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioRevisorNavigation { get; set; }
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class ejercicioscontables
{
public int idEjercicio { get; set; }
public DateOnly FechaInicio { get; set; }
public DateOnly FechaFin { get; set; }
public DateOnly FechaApertura { get; set; }
public DateOnly? FechaCierre { get; set; }
public int idEmpresa { get; set; }
public string? NivelesCuentas { get; set; }
public string Descripcion { get; set; } = null!;
public virtual ICollection<asientos> asientos { get; set; } = new List<asientos>();
public virtual ICollection<cuentas> cuentas { get; set; } = new List<cuentas>();
public virtual empresascontables idEmpresaNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class empresascontables
{
public int idEmpresaContable { get; set; }
public string RazonSocial { get; set; } = null!;
public DateTime? FechaBaja { get; set; }
public virtual ICollection<ejercicioscontables> ejercicioscontables { get; set; } = new List<ejercicioscontables>();
}

91
bdAsegasa/db/entidades.cs Normal file
View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class entidades
{
public int idEntidad { get; set; }
public string? CIF { get; set; }
public string? RazonSocial { get; set; }
public string? Apellidos { get; set; }
public string? Nombre { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? AfiliacionSeguridadSocial { get; set; }
public string? Email { get; set; }
public string? IBAN { get; set; }
public int? idSexo { get; set; }
public DateOnly? FechaNacimiento { get; set; }
public DateOnly? FechaExpedicionCarnet { get; set; }
public int? idTipoPago { get; set; }
public string? CuentaContable { get; set; }
public bool VIP { get; set; }
public string? Situacion { get; set; }
public string? Observacion { get; set; }
public bool EsClienteSG { get; set; }
public bool EsTaller { get; set; }
public bool EsContrarioSiniestro { get; set; }
public int? idDireccionPrincipal { get; set; }
public string? EstadoCivil { get; set; }
public bool EsClienteSA { get; set; }
public bool EsProveedor { get; set; }
public string? SHA1Passwd { get; set; }
public DateTime? FechaAltaServiciosWeb { get; set; }
public string? Avisos { get; set; }
public virtual ICollection<direcciones> direcciones { get; set; } = new List<direcciones>();
public virtual ICollection<entidades_tokens> entidades_tokens { get; set; } = new List<entidades_tokens>();
public virtual ICollection<entidadespolizas> entidadespolizas { get; set; } = new List<entidadespolizas>();
public virtual ICollection<entidadesrelacionadas> entidadesrelacionadasidEntidadHijoNavigation { get; set; } = new List<entidadesrelacionadas>();
public virtual ICollection<entidadesrelacionadas> entidadesrelacionadasidEntidadPadreNavigation { get; set; } = new List<entidadesrelacionadas>();
public virtual direcciones? idDireccionPrincipalNavigation { get; set; }
public virtual enumeraciones? idSexoNavigation { get; set; }
public virtual enumeraciones? idTipoPagoNavigation { get; set; }
public virtual ICollection<personasdecontactoentidades> personasdecontactoentidades { get; set; } = new List<personasdecontactoentidades>();
public virtual ICollection<polizasagrario> polizasagrarioidAseguradoNavigation { get; set; } = new List<polizasagrario>();
public virtual ICollection<polizasagrario> polizasagrarioidTomadorNavigation { get; set; } = new List<polizasagrario>();
public virtual ICollection<siniestros> siniestrosidEntidadContrarioNavigation { get; set; } = new List<siniestros>();
public virtual ICollection<siniestros> siniestrosidEntidadTallerNavigation { get; set; } = new List<siniestros>();
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class entidades_tokens
{
public uint id { get; set; }
public int? idEntidad { get; set; }
public DateTime creacion { get; set; }
public bool valido { get; set; }
public string token { get; set; } = null!;
public virtual entidades? idEntidadNavigation { get; set; }
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class entidadespolizas
{
public int idEntidadPoliza { get; set; }
/// <summary>
/// tabla polizas
/// </summary>
public int idPoliza { get; set; }
/// <summary>
/// tabla entidad
/// </summary>
public int idEntidad { get; set; }
/// <summary>
/// tabla enumeraciones
/// </summary>
public bool EsTomador { get; set; }
public bool EsConductorHabitual { get; set; }
public bool EsConductorOcasional { get; set; }
public bool EsPagador { get; set; }
public bool EsPropietario { get; set; }
public int? idDireccion { get; set; }
public string? Observaciones { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? Email { get; set; }
public virtual direcciones? idDireccionNavigation { get; set; }
public virtual entidades idEntidadNavigation { get; set; } = null!;
public virtual polizassg idPolizaNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class entidadesrelacionadas
{
public int idEntidadRelacionada { get; set; }
public int idEntidadPadre { get; set; }
public int? idEntidadHijo { get; set; }
public string? Observaciones { get; set; }
public virtual entidades? idEntidadHijoNavigation { get; set; }
public virtual entidades idEntidadPadreNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class enumeraciones
{
public int idEnumeracion { get; set; }
public int idGrupoEnumeracion { get; set; }
public string? Codigo { get; set; }
public string Descripcion { get; set; } = null!;
public string? ValorAlfabetico1 { get; set; }
public string? ValorAlfabetico2 { get; set; }
public double? ValorNumerico1 { get; set; }
public double? ValorNumerico2 { get; set; }
public int? Orden { get; set; }
public bool Oculto { get; set; }
public string? ValorAlfabetico3 { get; set; }
public string? ValorAlfabetico4 { get; set; }
public string? ValorAlfabeticoLargo { get; set; }
public double? ValorNumerico3 { get; set; }
public double? ValorNumerico4 { get; set; }
public DateTime? Fecha1 { get; set; }
public DateTime? Fecha2 { get; set; }
public DateTime? Fecha3 { get; set; }
public DateTime? Fecha4 { get; set; }
public virtual ICollection<actassiniestrosagrario> actassiniestrosagrario { get; set; } = new List<actassiniestrosagrario>();
public virtual ICollection<agentes> agentesidFormaPagoNavigation { get; set; } = new List<agentes>();
public virtual ICollection<agentes> agentesidRutaNavigation { get; set; } = new List<agentes>();
public virtual ICollection<amortizacionrecibos> amortizacionrecibosidEmpresaNavigation { get; set; } = new List<amortizacionrecibos>();
public virtual ICollection<amortizacionrecibos> amortizacionrecibosidMotivoBajaNavigation { get; set; } = new List<amortizacionrecibos>();
public virtual ICollection<companias> companiasidTipoCobroNavigation { get; set; } = new List<companias>();
public virtual ICollection<companias> companiasidTipoRedondeoNavigation { get; set; } = new List<companias>();
public virtual ICollection<cuentas> cuentas { get; set; } = new List<cuentas>();
public virtual ICollection<departamentoscontactocompanias> departamentoscontactocompanias { get; set; } = new List<departamentoscontactocompanias>();
public virtual ICollection<departamentosmiembros> departamentosmiembros { get; set; } = new List<departamentosmiembros>();
public virtual ICollection<direcciones> direcciones { get; set; } = new List<direcciones>();
public virtual ICollection<documentosasolicitar> documentosasolicitar { get; set; } = new List<documentosasolicitar>();
public virtual ICollection<documentosvarios> documentosvariosidEstadoNavigation { get; set; } = new List<documentosvarios>();
public virtual ICollection<documentosvarios> documentosvariosidTipoNavigation { get; set; } = new List<documentosvarios>();
public virtual ICollection<entidades> entidadesidSexoNavigation { get; set; } = new List<entidades>();
public virtual ICollection<entidades> entidadesidTipoPagoNavigation { get; set; } = new List<entidades>();
public virtual ICollection<expedientespolizas> expedientespolizas { get; set; } = new List<expedientespolizas>();
public virtual ICollection<expedientesrecibos> expedientesrecibos { get; set; } = new List<expedientesrecibos>();
public virtual ICollection<ficheros> ficheros { get; set; } = new List<ficheros>();
public virtual ICollection<gestionespolizasagrario> gestionespolizasagrario { get; set; } = new List<gestionespolizasagrario>();
public virtual ICollection<gestionespolizassg> gestionespolizassg { get; set; } = new List<gestionespolizassg>();
public virtual ICollection<gestionesvarias> gestionesvarias { get; set; } = new List<gestionesvarias>();
public virtual gruposenumeraciones idGrupoEnumeracionNavigation { get; set; } = null!;
public virtual ICollection<liquidacionesagentes> liquidacionesagentes { get; set; } = new List<liquidacionesagentes>();
public virtual ICollection<liquidacionescompanias> liquidacionescompanias { get; set; } = new List<liquidacionescompanias>();
public virtual ICollection<liquidacionesviajes> liquidacionesviajes { get; set; } = new List<liquidacionesviajes>();
public virtual ICollection<modificacionespolizasagrario> modificacionespolizasagrario { get; set; } = new List<modificacionespolizasagrario>();
public virtual ICollection<pagossiniestros_eiac> pagossiniestros_eiac { get; set; } = new List<pagossiniestros_eiac>();
public virtual ICollection<personasdecontactoagentes> personasdecontactoagentes { get; set; } = new List<personasdecontactoagentes>();
public virtual ICollection<planeslineas> planeslineas { get; set; } = new List<planeslineas>();
public virtual ICollection<plantillas> plantillasidGrupoNavigation { get; set; } = new List<plantillas>();
public virtual ICollection<plantillas> plantillasidTipoNavigation { get; set; } = new List<plantillas>();
public virtual ICollection<polizassg> polizassgidCausaBajaNavigation { get; set; } = new List<polizassg>();
public virtual ICollection<polizassg> polizassgidDuracionNavigation { get; set; } = new List<polizassg>();
public virtual ICollection<polizassg> polizassgidSituacionNavigation { get; set; } = new List<polizassg>();
public virtual ICollection<polizassg> polizassgidTipoCobroNavigation { get; set; } = new List<polizassg>();
public virtual ICollection<polizassg> polizassgidTipoPagoNavigation { get; set; } = new List<polizassg>();
public virtual ICollection<procesos> procesosidSubtipoNavigation { get; set; } = new List<procesos>();
public virtual ICollection<procesos> procesosidTipoNavigation { get; set; } = new List<procesos>();
public virtual ICollection<ramos> ramosidFamiliaDGSNavigation { get; set; } = new List<ramos>();
public virtual ICollection<ramos> ramosidFamiliaRamoNavigation { get; set; } = new List<ramos>();
public virtual ICollection<recibos> recibosidCausaBajaNavigation { get; set; } = new List<recibos>();
public virtual ICollection<recibos> recibosidCausaDevolucionNavigation { get; set; } = new List<recibos>();
public virtual ICollection<recibos> recibosidDuracionNavigation { get; set; } = new List<recibos>();
public virtual ICollection<recibos> recibosidSituacionNavigation { get; set; } = new List<recibos>();
public virtual ICollection<recibos> recibosidTipoNavigation { get; set; } = new List<recibos>();
public virtual ICollection<recibos> recibosidTipoPagoNavigation { get; set; } = new List<recibos>();
public virtual ICollection<remesas> remesas { get; set; } = new List<remesas>();
public virtual ICollection<siniestros> siniestrosidCulpaNavigation { get; set; } = new List<siniestros>();
public virtual ICollection<siniestros> siniestrosidTramitacionNavigation { get; set; } = new List<siniestros>();
public virtual ICollection<tiposgestionsiniestros> tiposgestionsiniestrosidClaseNavigation { get; set; } = new List<tiposgestionsiniestros>();
public virtual ICollection<tiposgestionsiniestros> tiposgestionsiniestrosidDestinatarioNavigation { get; set; } = new List<tiposgestionsiniestros>();
public virtual ICollection<usuarios> usuarios { get; set; } = new List<usuarios>();
}

16
bdAsegasa/db/epiban.cs Normal file
View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class epiban
{
/// <summary>
/// tabla entidad
/// </summary>
public int identidad { get; set; }
public string? IBAN { get; set; }
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class estadossiniestros_eiac
{
public int idEstado { get; set; }
public int idSiniestroEIAC { get; set; }
public int NumeroOrden { get; set; }
public int? SituacionSiniestro { get; set; }
public string? DescripcionSituacion { get; set; }
public virtual siniestros_eiac idSiniestroEIACNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class excepcionesciasramos
{
public int idExcepcion { get; set; }
public int idCompania { get; set; }
public int idRamo { get; set; }
public int NumeroDiasRemesaPago { get; set; }
public virtual companias idCompaniaNavigation { get; set; } = null!;
public virtual ramos idRamoNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class expedientesagentes
{
public int idExpediente { get; set; }
public string? Descripcion { get; set; }
public DateTime? Fecha { get; set; }
public int? idFichero { get; set; }
public int? idAgente { get; set; }
public int? idUsuario { get; set; }
public virtual agentes? idAgenteNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class expedientespolizas
{
public int idExpedientePoliza { get; set; }
public DateTime? FechaHora { get; set; }
/// <summary>
/// tabla
/// </summary>
public int? idTipo { get; set; }
public string? Valor1Alfabetico { get; set; }
public string? Valor2Alfabetico { get; set; }
public string? Valor3Alfabetico { get; set; }
public double? Valor1Numerico { get; set; }
public double? Valor2Numerico { get; set; }
public string? Valor3Numerico { get; set; }
public int idPoliza { get; set; }
public virtual polizassg idPolizaNavigation { get; set; } = null!;
public virtual enumeraciones? idTipoNavigation { get; set; }
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class expedientesrecibos
{
public int idExpedienteRecibo { get; set; }
public DateTime? FechaHora { get; set; }
/// <summary>
/// tabla
/// </summary>
public int? idTipo { get; set; }
public string? Valor1Alfabetico { get; set; }
public string? Valor2Alfabetico { get; set; }
public double? Valor1Numerico { get; set; }
public double? Valor2Numerico { get; set; }
public int? idRecibo { get; set; }
public virtual recibos? idReciboNavigation { get; set; }
public virtual enumeraciones? idTipoNavigation { get; set; }
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class expedientessiniestros_eiac
{
public int idExpedienteEIAC { get; set; }
public string NumeroExpediente { get; set; } = null!;
public int EstadoExpediente { get; set; }
public double? ImporteReserva { get; set; }
public double? TotalPagos { get; set; }
public double? TotalRecobros { get; set; }
public DateTime? FechaInicio { get; set; }
public DateTime? FechaFin { get; set; }
public int idSiniestroEIAC { get; set; }
public int NumeroOrden { get; set; }
public virtual siniestros_eiac idSiniestroEIACNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class extractosbancarios
{
public int idExtracto { get; set; }
public int idCaja { get; set; }
public DateOnly FechaInicial { get; set; }
public DateOnly FechaFinal { get; set; }
public float SaldoAnterior { get; set; }
public DateTime FechaLectura { get; set; }
public int idUsuario { get; set; }
public virtual cajas idCajaNavigation { get; set; } = null!;
public virtual usuarios idUsuarioNavigation { get; set; } = null!;
public virtual ICollection<movimientosbancarios> movimientosbancarios { get; set; } = new List<movimientosbancarios>();
}

63
bdAsegasa/db/ficheros.cs Normal file
View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class ficheros
{
public int idFichero { get; set; }
public string? Descripcion { get; set; }
public DateTime? Fecha { get; set; }
public int? idTipo { get; set; }
public string? Observaciones { get; set; }
public byte[]? Fichero { get; set; }
public string? NombreFichero { get; set; }
public int? idAplicacion { get; set; }
public virtual ICollection<correos> correos { get; set; } = new List<correos>();
public virtual ICollection<documentospolizasagrario> documentospolizasagrario { get; set; } = new List<documentospolizasagrario>();
public virtual ICollection<documentospolizassg> documentospolizassg { get; set; } = new List<documentospolizassg>();
public virtual ICollection<documentosvarios> documentosvarios { get; set; } = new List<documentosvarios>();
public virtual ICollection<expedientesagentes> expedientesagentes { get; set; } = new List<expedientesagentes>();
public virtual ICollection<ficherosadjuntos> ficherosadjuntos { get; set; } = new List<ficherosadjuntos>();
public virtual ICollection<gestionesrecibos> gestionesrecibos { get; set; } = new List<gestionesrecibos>();
public virtual ICollection<gestionessiniestros> gestionessiniestros { get; set; } = new List<gestionessiniestros>();
public virtual ICollection<gestionesvarias> gestionesvarias { get; set; } = new List<gestionesvarias>();
public virtual enumeraciones? idTipoNavigation { get; set; }
public virtual ICollection<informescontables> informescontables { get; set; } = new List<informescontables>();
public virtual ICollection<liquidacionesagentes> liquidacionesagentes { get; set; } = new List<liquidacionesagentes>();
public virtual ICollection<notificaciones> notificaciones { get; set; } = new List<notificaciones>();
public virtual ICollection<pagosliquidacionescias> pagosliquidacionescias { get; set; } = new List<pagosliquidacionescias>();
public virtual ICollection<plantillas> plantillas { get; set; } = new List<plantillas>();
public virtual ICollection<polizassg> polizassg { get; set; } = new List<polizassg>();
public virtual ICollection<procesos> procesos { get; set; } = new List<procesos>();
public virtual ICollection<remesas> remesas { get; set; } = new List<remesas>();
public virtual ICollection<tiposgestionsiniestros> tiposgestionsiniestros { get; set; } = new List<tiposgestionsiniestros>();
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class ficherosadjuntos
{
public int idFicheroAdjunto { get; set; }
public int idFichero { get; set; }
public int idCorreo { get; set; }
public virtual correos idCorreoNavigation { get; set; } = null!;
public virtual ficheros idFicheroNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class ficheroscompanias
{
public int idFichero { get; set; }
public DateTime FechaCreacion { get; set; }
public DateTime? FechaProcesado { get; set; }
public DateTime? FechaError { get; set; }
public string? NombreFichero { get; set; }
public int Tipo { get; set; }
public int? idUsuario { get; set; }
public int idCompania { get; set; }
public byte[]? Fichero { get; set; }
public string? SHA1 { get; set; }
public bool ProcesadoSinRecibosCorrectos { get; set; }
public string? Observaciones { get; set; }
public string? Version { get; set; }
public bool ContieneRecibos { get; set; }
public bool ContienePolizas { get; set; }
public bool ContieneSiniestros { get; set; }
public bool ContieneLiquidaciones { get; set; }
public virtual ICollection<actualizacionessiniestros_eiac> actualizacionessiniestros_eiac { get; set; } = new List<actualizacionessiniestros_eiac>();
public virtual companias idCompaniaNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<recibos> recibos { get; set; } = new List<recibos>();
public virtual ICollection<registrosactualizados> registrosactualizados { get; set; } = new List<registrosactualizados>();
public virtual ICollection<siniestros_eiac> siniestros_eiac { get; set; } = new List<siniestros_eiac>();
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class ficherosconfiguracion
{
public int idFicheroConfiguracion { get; set; }
public int? idUsuario { get; set; }
public string? Codigo { get; set; }
public byte[]? Configuracion { get; set; }
public string? Descripcion { get; set; }
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdAsegasa.db;
[AddINotifyPropertyChangedInterface]
public partial class gestionespolizasagrario
{
public int idGestionPoliza { get; set; }
public DateTime? Fecha { get; set; }
public string? GestionesRealizadas { get; set; }
public int? idUsuario { get; set; }
public string? Observaciones { get; set; }
public int? idPoliza { get; set; }
public int? idTipo { get; set; }
public bool ContieneErrores { get; set; }
public int? idGestionVarias { get; set; }
public virtual gestionesvarias? idGestionVariasNavigation { get; set; }
public virtual polizasagrario? idPolizaNavigation { get; set; }
public virtual enumeraciones? idTipoNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
}

Some files were not shown because too many files have changed in this diff Show More