Agregar archivos de proyecto.

This commit is contained in:
2026-01-23 12:45:41 +01:00
parent 5ed4e0bc46
commit c8d1044267
237 changed files with 34721 additions and 0 deletions

View File

@@ -0,0 +1,242 @@
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using bdGrupoSanchoToro;
using bdGrupoSanchoToro.db;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
namespace bdGrupoSanchoToro
{
public class CalculosDinamicos
{
private System.Reflection.Assembly oEnsamblado;
public bool PrecompilarFuncion(string Funcion, List<string> ListaEnsamblados, List<string> ListaParametros, List<string> ListaEspacioNombres, List<string> AccionesIniciales = null)
{
try
{
string mStrings;
string mParametros = "";
// Definimos un objeto de tipo StringBuilder que contendra el código a compilar
var CodigoFuente = new StringBuilder();
// Agregamos los Imports necesarios a nuestro codigo fuente
// CodigoFuente.Append("Option Explicit Off" & vbCr)
foreach (var currentMStrings in ListaEspacioNombres)
{
mStrings = currentMStrings;
CodigoFuente.Append("Imports " + mStrings + Constants.vbCr);
}
// Preparamos un string con los parametros que usará el metodo Eval
// de de la clase EvalClase
if (ListaParametros is not null)
{
foreach (var currentMStrings1 in ListaParametros)
{
mStrings = currentMStrings1;
mParametros += ", " + mStrings;
}
}
mParametros = Strings.Trim(mParametros);
if (mParametros.Length > 0)
{
mParametros = Strings.Trim(Strings.Mid(mParametros, 2));
}
// Terminamos de construir la clase a compilar
CodigoFuente.Append("Public Class EvalClase" + Constants.vbCr);
CodigoFuente.Append(" Public Shared Function Eval(" + mParametros + ") as Double" + Constants.vbCr);
CodigoFuente.Append("Try" + Constants.vbCr);
if (!(AccionesIniciales == null))
{
foreach (var currentMStrings2 in AccionesIniciales)
{
mStrings = currentMStrings2;
CodigoFuente.Append(mStrings + Constants.vbCr);
}
}
CodigoFuente.Append(" Return " + Funcion + Constants.vbCr);
CodigoFuente.Append("Catch ex as Exception" + Constants.vbCr);
CodigoFuente.Append(" Throw New Exception(ex.Message, ex)" + Constants.vbCr);
CodigoFuente.Append("End Try" + Constants.vbCr);
CodigoFuente.Append("End Function " + Constants.vbCr);
CodigoFuente.Append("End Class " + Constants.vbCr);
var oCProvider = new VBCodeProvider();
CodeDomProvider oCompiler = oCProvider;
var oCParam = new CompilerParameters();
oCParam.GenerateInMemory = true;
foreach (var ens in ListaEnsamblados)
oCParam.ReferencedAssemblies.Add(ens);
// oCParam.ReferencedAssemblies.Add("Cablin.dll")
// oCParam.ReferencedAssemblies.Add("FuncionesTsl4.dll")
// oCParam.ReferencedAssemblies.Add("System.dll")
// oCParam.ReferencedAssemblies.Add("System.Data.dll")
// oCParam.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll")
// Creamos un objeto CompilerResult que obtendrá los resultados de la compilación
CompilerResults oCResult;
// Comprobamos que no existan errores de compilación.
oCResult = oCompiler.CompileAssemblyFromSource(oCParam, CodigoFuente.ToString());
string sErrores = "";
if (oCResult.Errors.Count > 0)
{
// Si existen errores los mostramos.
// Si bien, podriamos implementar un mejor método para visualizar
// los errores de compilación, este nos servirá por los momentos.
foreach (CompilerError oCError in oCResult.Errors)
// MsgBox(oCError.ErrorText.ToString)
sErrores += oCError.ErrorText.ToString() + " --- ";
throw new Exception(sErrores);
}
else
{
// Como el ensamblado se generó en memoria, debemos obtener
// una referencia al ensamblado generado, para esto usamos
// la propiedad CompiledAssembly
oEnsamblado = oCResult.CompiledAssembly;
return true;
}
}
catch (Exception EX)
{
throw new Exception("Errores en Compilacion:" + EX.Message, EX);
}
}
public double Evaluar(params object[] Parametros)
{
if (oEnsamblado is null)
{
throw new Exception("La función no está compilada");
}
else
{
var oClass = oEnsamblado.GetType("EvalClase");
return Conversions.ToDouble(oClass.GetMethod("Eval").Invoke(null, Parametros));
}
}
//public static double FNTabla(tscGrupoSanchoToro bd, string CodigoTabla, double Valor, int? ParametroNumerico = default, string ParametroAlfabetico = "")
//{
// valorestablas vt;
// var iqvt = bd.valorestablas.Where(x => (x.idTablaNavigation.Codigo ?? "") == (CodigoTabla ?? "") && x.ValorInicial <= Valor && x.ValorFinal >= Valor);
// if (ParametroNumerico.HasValue)
// {
// iqvt = iqvt.Where(x => x.ParametroNumerico == ParametroNumerico.Value);
// }
// if (!string.IsNullOrEmpty(ParametroAlfabetico))
// {
// iqvt = iqvt.Where(x => (x.ParametroAlfabetico ?? "") == (ParametroAlfabetico ?? ""));
// }
// vt = iqvt.FirstOrDefault();
// if (vt is null)
// {
// return 0d;
// }
// else
// {
// return vt.Factor;
// }
//}
//public static double CalculaPrecioServicio(tscGrupoSanchoToro bd, presupuestos Presupuesto, detallepresupuesto DetPresupuesto, productos servicio, ref double cantidad)
//{
// preciosservicio precio;
// switch (DetPresupuesto.productos.Tipo) // servicio.Tipo
// {
// case (int)productos.TipoProductoEnum.TRIBUNA:
// {
// int NumFilas = (int)Math.Round((double)DetPresupuesto.Bloques.Sum(x => x.productos.NumeroFilas) / (double)DetPresupuesto.Bloques.Count);
// // precio = servicio.preciosservicioidProductoNavigation.FirstOrDefault(x => x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.NumeroFilasDesde >= NumFilas && x.NumeroFilasHasta <= NumFilas && x.NumeroAsientosDesde <= DetPresupuesto.NumeroAsientos.Value && x.NumeroAsientosHasta >= DetPresupuesto.NumeroAsientos.Value && x.DiasAlquilerDesde <= Presupuesto.DiasAlquiler && x.DiasAlquilerHasta >= Presupuesto.DiasAlquiler && x.MesDesde <= Presupuesto.MesAlquiler && x.MesHasta >= Presupuesto.MesAlquiler && x.idProducto == DetPresupuesto.idProducto);
// precio = servicio.preciosservicioidProductoServicioNavigation.FirstOrDefault(x => x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.NumeroFilasDesde <= NumFilas && x.NumeroFilasHasta >= NumFilas && x.NumeroAsientosDesde <= DetPresupuesto.NumeroAsientos.Value && x.NumeroAsientosHasta >= DetPresupuesto.NumeroAsientos.Value && x.idProducto == DetPresupuesto.idProductoNavigation.idProducto);
// break;
// }
// default:
// {
// int Ancho = DetPresupuesto.productos.Ancho;
// int Largo = DetPresupuesto.productos.Largo;
// //precio = servicio.preciosservicioidProductoNavigation.FirstOrDefault(x => x.AnchoDesde <= Ancho && x.AnchoHasta >= Ancho && x.LargoDesde <= Ancho && x.LargoHasta >= Ancho && x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.DiasAlquilerDesde <= Presupuesto.DiasAlquiler && x.DiasAlquilerHasta >= Presupuesto.DiasAlquiler && x.MesDesde <= Presupuesto.MesAlquiler && x.MesHasta >= Presupuesto.MesAlquiler && x.idProducto == DetPresupuesto.idProducto);
// string Codigo = DetPresupuesto.idProductoNavigation.Codigo.Split(".")[0];
// precio = servicio.preciosservicioidProductoServicioNavigation.FirstOrDefault(x => x.AnchoDesde <= Ancho && x.AnchoHasta >= Ancho && x.LargoDesde <= Ancho && x.LargoHasta >= Ancho && x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.idProductoNavigation.Codigo == Codigo);
// break;
// }
// }
// // If precio Is Nothing Then Throw New Exception("No existen precios del servicio " & servicio.Descripcion & " con los datos indicados")
// if (precio is not null)
// {
// cantidad = precio.CantidadCalculada;
// double pr = precio.PrecioFijo;
// if (servicio.PrecioPorDia)
// pr = pr * (double)Presupuesto.DiasAlquiler;
// if (servicio.PrecioPorKm)
// pr = pr * Presupuesto.Kilometros;
// if (servicio.PrecioPorAsiento)
// pr = (double)(pr * DetPresupuesto.NumeroAsientos);
// return Math.Max(servicio.PrecioMinimo, pr);
// }
// else
// {
// // PENDIENTE DE ADVERTENCIA
// cantidad = 1d;
// return servicio.PrecioMinimo;
// }
//}
//private static double CalculaPrecioProducto(tscGrupoSanchoToro bd, detallepresupuesto DetPresupuesto, desgloseproductos dproServicio)
//{
// string formula = dproServicio.idFormulaNavigation.Formula;
// var parametros = DetPresupuesto.parametrosdetallepresupuesto;
// foreach (var p in parametros)
// formula = formula.Replace("!P(" + p.idParametroNavigation.Codigo + ")", p.Valor.ToString());
// formula = formula.Replace("!T(", "CalculosDinamicos.FNTabla(bd,");
// formula = formula.Replace("!TF(", "CalculosDinamicos.FNTablaPorFilas(bd,");
// // formula = formula.Replace("!V(NUMFIL)", DetPresupuesto.productos.NumeroFilas.ToString)
// formula = formula.Replace("!V(NUMASI)", DetPresupuesto.NumeroAsientos.Value.ToString());
// formula = formula.Replace("!V(KM)", DetPresupuesto.idPresupuestoNavigation.Kilometros.ToString());
// formula = formula.Replace("!V(CPR)", '"' + dproServicio.idProductoNavigation.Codigo.ToString() + '"');
// var cd = new CalculosDinamicos();
// var las = new List<string>();
// las.Add("System.dll");
// las.Add("System.Data.dll");
// las.Add("System.Data.Entity.dll");
// las.Add("dll");
// las.Add("tsWPF.dll");
// las.Add("tsl5.dll");
// var lp = new List<string>();
// lp.Add("bd As tscGrupoSanchoToro");
// // For Each p In parametros
// // Dim spar As String = p.parametros.Codigo & " as "
// // Select Case p.parametros.Tipo
// // Case TipoParametroEnum.ENTERO
// // End Select
// // lp.Add(p.parametros.Codigo) & " as "
// // Next
// var le = new List<string>();
// le.Add("System");
// le.Add("System.Text");
// le.Add("bdGrupoSanchoToro");
// le.Add("tscGrupoSanchoToro");
// le.Add("Utilidades");
// cd.PrecompilarFuncion(formula, las, lp, le);
// var pars = new object[1];
// pars[0] = bd;
// return cd.Evaluar(pars);
//}
}
}

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,104 @@
{
"ExtendedData": {
"inputs": [
"https://prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/SistemaFacturacion.wsdl"
],
"collectionTypes": [
"System.Array",
"System.Collections.Generic.Dictionary`2"
],
"namespaceMappings": [
"*, ServiceReference1"
],
"references": [
"C:\\m3soft\\vs.net\\GrupoSanchoToro\\bdGrupoSanchoToro\\bin\\Debug\\net8.0\\tsEFCore8.dll",
"C:\\m3soft\\vs.net\\GrupoSanchoToro\\bdGrupoSanchoToro\\bin\\Debug\\net8.0\\tsUtilidades.dll",
"Castle.Core, {Castle.Core, 5.1.1}",
"Google.Protobuf, {Google.Protobuf, 3.25.2}",
"IbanNet, {IbanNet, 5.14.0}",
"K4os.Compression.LZ4, {K4os.Compression.LZ4, 1.3.6}",
"K4os.Compression.LZ4.Streams, {K4os.Compression.LZ4.Streams, 1.3.6}",
"K4os.Hash.xxHash, {K4os.Hash.xxHash, 1.0.8}",
"Microsoft.Bcl.AsyncInterfaces, {Microsoft.Bcl.AsyncInterfaces, 6.0.0}",
"Microsoft.EntityFrameworkCore, {Microsoft.EntityFrameworkCore, 8.0.10}",
"Microsoft.EntityFrameworkCore.Abstractions, {Microsoft.EntityFrameworkCore.Abstractions, 8.0.10}",
"Microsoft.EntityFrameworkCore.DynamicLinq, {Microsoft.EntityFrameworkCore.DynamicLinq, 8.3.8}",
"Microsoft.EntityFrameworkCore.Proxies, {Microsoft.EntityFrameworkCore.Proxies, 8.0.1}",
"Microsoft.EntityFrameworkCore.Relational, {Microsoft.EntityFrameworkCore.Relational, 8.0.10}",
"Microsoft.Extensions.Caching.Abstractions, {Microsoft.Extensions.Caching.Abstractions, 8.0.0}",
"Microsoft.Extensions.Caching.Memory, {Microsoft.Extensions.Caching.Memory, 8.0.1}",
"Microsoft.Extensions.Configuration.Abstractions, {Microsoft.Extensions.Configuration.Abstractions, 8.0.0}",
"Microsoft.Extensions.DependencyInjection, {Microsoft.Extensions.DependencyInjection, 8.0.1}",
"Microsoft.Extensions.DependencyInjection.Abstractions, {Microsoft.Extensions.DependencyInjection.Abstractions, 8.0.2}",
"Microsoft.Extensions.Logging, {Microsoft.Extensions.Logging, 8.0.1}",
"Microsoft.Extensions.Logging.Abstractions, {Microsoft.Extensions.Logging.Abstractions, 8.0.2}",
"Microsoft.Extensions.ObjectPool, {Microsoft.Extensions.ObjectPool, 6.0.16}",
"Microsoft.Extensions.Options, {Microsoft.Extensions.Options, 8.0.2}",
"Microsoft.Extensions.Primitives, {Microsoft.Extensions.Primitives, 8.0.0}",
"Microsoft.IdentityModel.Logging, {Microsoft.IdentityModel.Logging, 6.8.0}",
"Microsoft.IdentityModel.Protocols.WsTrust, {Microsoft.IdentityModel.Protocols.WsTrust, 6.8.0}",
"Microsoft.IdentityModel.Tokens, {Microsoft.IdentityModel.Tokens, 6.8.0}",
"Microsoft.IdentityModel.Tokens.Saml, {Microsoft.IdentityModel.Tokens.Saml, 6.8.0}",
"Microsoft.IdentityModel.Xml, {Microsoft.IdentityModel.Xml, 6.8.0}",
"Microsoft.Win32.Registry.AccessControl, {Microsoft.Win32.Registry.AccessControl, 8.0.0}",
"Microsoft.Win32.SystemEvents, {Microsoft.Win32.SystemEvents, 8.0.0}",
"MySqlConnector, {MySqlConnector, 2.3.1}",
"Newtonsoft.Json, {Newtonsoft.Json, 13.0.3}",
"Pomelo.EntityFrameworkCore.MySql, {Pomelo.EntityFrameworkCore.MySql, 8.0.0-beta.2}",
"PropertyChanged, {PropertyChanged.Fody, 4.1.0}",
"Renci.SshNet, {SSH.NET, 2023.0.1}",
"SshNet.Security.Cryptography, {SshNet.Security.Cryptography, 1.3.0}",
"System.CodeDom, {System.CodeDom, 8.0.0}",
"System.ComponentModel.Annotations, {System.ComponentModel.Annotations, 5.0.0}",
"System.ComponentModel.Composition, {System.ComponentModel.Composition, 8.0.0}",
"System.ComponentModel.Composition.Registration, {System.ComponentModel.Composition.Registration, 8.0.0}",
"System.Configuration.ConfigurationManager, {System.Configuration.ConfigurationManager, 8.0.0}",
"System.Data.DataSetExtensions, {System.Data.DataSetExtensions, 4.5.0}",
"System.Data.Odbc, {System.Data.Odbc, 8.0.0}",
"System.Data.OleDb, {System.Data.OleDb, 8.0.0}",
"System.Data.SqlClient, {System.Data.SqlClient, 4.8.5}",
"System.Diagnostics.EventLog, {System.Diagnostics.EventLog, 8.0.0}",
"System.Diagnostics.PerformanceCounter, {System.Diagnostics.PerformanceCounter, 8.0.0}",
"System.DirectoryServices, {System.DirectoryServices, 8.0.0}",
"System.DirectoryServices.AccountManagement, {System.DirectoryServices.AccountManagement, 8.0.0}",
"System.DirectoryServices.Protocols, {System.DirectoryServices.Protocols, 8.0.0}",
"System.Drawing.Common, {System.Drawing.Common, 8.0.1}",
"System.Formats.Asn1, {System.Formats.Asn1, 8.0.0}",
"System.IO, {System.IO, 4.3.0}",
"System.IO.Packaging, {System.IO.Packaging, 8.0.0}",
"System.IO.Pipelines, {System.IO.Pipelines, 6.0.3}",
"System.IO.Ports, {System.IO.Ports, 8.0.0}",
"System.Linq.Dynamic.Core, {System.Linq.Dynamic.Core, 1.4.6}",
"System.Management, {System.Management, 8.0.0}",
"System.Reflection.Context, {System.Reflection.Context, 8.0.0}",
"System.Reflection.DispatchProxy, {System.Reflection.DispatchProxy, 4.7.1}",
"System.Runtime, {System.Runtime, 4.3.0}",
"System.Runtime.Caching, {System.Runtime.Caching, 8.0.0}",
"System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 4.5.0}",
"System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 8.0.0}",
"System.Security.Cryptography.ProtectedData, {System.Security.Cryptography.ProtectedData, 8.0.0}",
"System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 8.0.0}",
"System.Security.Permissions, {System.Security.Permissions, 8.0.0}",
"System.Security.Principal.Windows, {System.Security.Principal.Windows, 5.0.0}",
"System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.0}",
"System.ServiceModel.Federation, {System.ServiceModel.Federation, 8.0.0}",
"System.ServiceModel.Http, {System.ServiceModel.Http, 8.0.0}",
"System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.0}",
"System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 8.0.0}",
"System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.0}",
"System.ServiceModel.Syndication, {System.ServiceModel.Syndication, 8.0.0}",
"System.ServiceProcess.ServiceController, {System.ServiceProcess.ServiceController, 8.0.0}",
"System.Speech, {System.Speech, 8.0.0}",
"System.Text.Encoding, {System.Text.Encoding, 4.3.0}",
"System.Text.Encoding.CodePages, {System.Text.Encoding.CodePages, 8.0.0}",
"System.Threading.AccessControl, {System.Threading.AccessControl, 8.0.0}",
"System.Threading.Tasks, {System.Threading.Tasks, 4.3.0}",
"System.Web.Services.Description, {System.Web.Services.Description, 4.10.0}",
"System.Windows.Extensions, {System.Windows.Extensions, 8.0.0}",
"System.Xml.ReaderWriter, {System.Xml.ReaderWriter, 4.3.0}",
"System.Xml.XmlDocument, {System.Xml.XmlDocument, 4.3.0}"
],
"targetFramework": "net8.0",
"typeReuseMode": "All"
}
}

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,144 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.VisualBasic;
using bdGrupoSanchoToro.db;
using bdGrupoSanchoToro.dbcontext;
namespace bdGrupoSanchoToro.db
{
public class Utilidades
{
public static empresas? EmpresaActual;
public static string Usuario;
public static int idUsuario;
public static usuarios UsuarioActual;
public static string VersionPrograma { get; set; }
// public static double PorcentajeIva { 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)
{
GrupoSanchoToroContext ctx;
string sFicheroLog = DirectorioLogs + "Log-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + ".txt";
try
{
if (!(e == null))
{
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;
}
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 GrupoSanchoToro. " + ". Version:" + VersionPrograma + ". " + Asunto;
Mensaje = "Error GrupoSanchoToro. " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + VersionPrograma + ". Mensaje: " + Mensaje;
}
else
{
Asunto = "Advertencia GrupoSanchoToro. " + ". Version:" + VersionPrograma + ". " + Asunto;
Mensaje = "Advertencia GrupoSanchoToro. " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + VersionPrograma + ". " + Mensaje;
}
string sDireccionesEnvio = "manmog@gmail.com";
string sServidorSMTP = "smtp.gmail.com";
string sRemitente = "administracion@english-skills.net";
tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje, null,null, "", "", sRemitente, "", 587, true);
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 = "manmog@gmail.com";
string sServidorSMTP = "smtp.gmail.com";
string sRemitente = "administracion@english-skills.net";
// tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje,,,,, "se9608dc.g")
tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, "Error Anadelogtxt. " + Mensaje, Environment.MachineName + ".- " + ex.Message + Constants.vbCrLf + ex.StackTrace + Constants.vbCrLf + ex.Source, null,null, "", "", sRemitente, "", 587, true);
}
catch (Exception ex2)
{
}
}
finally
{
try
{
sw.Close();
}
catch
{
}
}
}
}
}

View File

@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="extensiones\tscGrupoSanchoToro.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="8.4.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.14" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
<PackageReference Include="System.ServiceModel.Duplex" Version="6.0.*" />
<PackageReference Include="System.ServiceModel.Http" Version="8.1.0" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Security" Version="6.0.*" />
<PackageReference Include="tsCorreos" Version="1.0.2" />
<PackageReference Include="tsEFCore8" Version="1.0.1" />
<PackageReference Include="tsUtilidades" Version="1.0.5" />
</ItemGroup>
<ItemGroup>
<Folder Include="db\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class albaranes
{
public int idAlbaran { get; set; }
public DateOnly Fecha { get; set; }
public int? idPresupuesto { get; set; }
public int? idValeTransporte { get; set; }
public int Tipo { get; set; }
public DateTime? FechaCarga { get; set; }
public string? LugarCarga { get; set; }
public string? Cargadores { get; set; }
public DateTime? FechaDescarga { get; set; }
public string? LugarDescarga { get; set; }
public string? Descargadores { get; set; }
public double Peso { get; set; }
public double Volumen { get; set; }
public double PorcentajeTransporte { get; set; }
public double CostoEstimadoTransporte { get; set; }
public int idUsuario { get; set; }
public int? idAlmacenOrigen { get; set; }
public string? CodigoPostalCarga { get; set; }
public string? CodigoMunicipioCarga { get; set; }
public string? CodigoPostalDescarga { get; set; }
public string? CodigoMunicipioDescarga { get; set; }
public string? Telefono1Carga { get; set; }
public string? Telefono2Carga { get; set; }
public string? EmailCarga { get; set; }
public string? Telefono1Descarga { get; set; }
public string? Telefono2Descarga { get; set; }
public string? EmailDescarga { get; set; }
public int? idAlmacenDestino { get; set; }
public int? idEntidad { get; set; }
public int NumeroBultos { get; set; }
public bool TransporteExterno { get; set; }
public DateOnly? FechaPrevistaFinSubalquiler { get; set; }
public virtual municipios? CodigoMunicipioCargaNavigation { get; set; }
public virtual municipios? CodigoMunicipioDescargaNavigation { get; set; }
public virtual ICollection<detallesalbaranes> detallesalbaranes { get; set; } = new List<detallesalbaranes>();
public virtual almacenes? idAlmacenDestinoNavigation { get; set; }
public virtual almacenes? idAlmacenOrigenNavigation { get; set; }
public virtual entidades? idEntidadNavigation { get; set; }
public virtual presupuestos? idPresupuestoNavigation { get; set; }
public virtual usuarios idUsuarioNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class almacenes
{
public int idAlmacen { get; set; }
public string? Descripcion { get; set; }
public string? Direccion { get; set; }
public string? CodigoPostal { get; set; }
public string? CodigoMunicipio { get; set; }
public string? Telefono1 { get; set; }
public string? Email { get; set; }
public string? Encargados { get; set; }
public int Tipo { get; set; }
public DateOnly? FechaBaja { get; set; }
public int idEmpresa { get; set; }
public virtual municipios? CodigoMunicipioNavigation { get; set; }
public virtual ICollection<albaranes> albaranesidAlmacenDestinoNavigation { get; set; } = new List<albaranes>();
public virtual ICollection<albaranes> albaranesidAlmacenOrigenNavigation { get; set; } = new List<albaranes>();
public virtual empresas idEmpresaNavigation { get; set; } = null!;
public virtual ICollection<stocks> stocks { get; set; } = new List<stocks>();
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class articulos
{
public int idArticulo { get; set; }
public int? idProducto { get; set; }
public string? CodigoArticulo { get; set; }
public string? NumeroSerie { get; set; }
public int? idProveedor { get; set; }
public string? NumeroFraCompra { get; set; }
public DateOnly? FechaCompra { get; set; }
public DateOnly? FechaFinGarantia { get; set; }
public DateOnly? FechaBaja { get; set; }
public string? Observaciones { get; set; }
public double? PrecioCompra { get; set; }
public int? idFichero { get; set; }
public string? Averias { get; set; }
public virtual ICollection<detallepresupuesto> detallepresupuesto { get; set; } = new List<detallepresupuesto>();
public virtual ICollection<detallesalbaranes> detallesalbaranes { get; set; } = new List<detallesalbaranes>();
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual productos? idProductoNavigation { get; set; }
public virtual entidades? idProveedorNavigation { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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 bdGrupoSanchoToro.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,17 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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; }
}

View File

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

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class conciliacionesbancarias
{
public int idConciliacion { get; set; }
public DateTime FechaConciliacion { get; set; }
public int? idUsuario { get; set; }
public double TotalMovimientosCaja { get; set; }
public double TotalMovimientosBancarios { get; set; }
public DateOnly FechaInicio { get; set; }
public DateOnly FechaFin { get; set; }
public int idCaja { get; set; }
public virtual cajas idCajaNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<movimientosbancarios> movimientosbancarios { get; set; } = new List<movimientosbancarios>();
public virtual ICollection<movimientoscaja> movimientoscaja { get; set; } = new List<movimientoscaja>();
}

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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 int? idEntidad { get; set; }
public string? MensajeError { get; set; }
public int? idUsuario { get; set; }
public virtual ICollection<ficherosadjuntos> ficherosadjuntos { get; set; } = new List<ficherosadjuntos>();
public virtual entidades? idEntidadNavigation { get; set; }
public virtual ficheros? idFicheroAdjuntoNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual cuentascorreo? idcuentaNavigation { get; set; }
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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 int? idEmpresa { get; set; }
public virtual ICollection<correos> correos { get; set; } = new List<correos>();
public virtual empresas? idEmpresaNavigation { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class detallepresupuesto
{
public int idDetallePresupuesto { get; set; }
public int idProducto { get; set; }
public int? idArticulo { get; set; }
public double Cantidad { get; set; }
public double Precio { get; set; }
public int idPresupuesto { get; set; }
public bool EsVenta { get; set; }
public string? Observaciones { get; set; }
public virtual ICollection<detallesfacturas> detallesfacturas { get; set; } = new List<detallesfacturas>();
public virtual articulos? idArticuloNavigation { get; set; }
public virtual presupuestos idPresupuestoNavigation { get; set; } = null!;
public virtual productos idProductoNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class detallesalbaranes
{
public int idDetalle { get; set; }
public int idProducto { get; set; }
public int? idArticulo { get; set; }
public int idAlbaran { get; set; }
public double Cantidad { get; set; }
public double Peso { get; set; }
public double Volumen { get; set; }
public bool EsVenta { get; set; }
public bool IncluidoEnPresupuesto { get; set; }
public virtual albaranes idAlbaranNavigation { get; set; } = null!;
public virtual articulos? idArticuloNavigation { get; set; }
public virtual productos idProductoNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class detallesfacturas
{
public int idDetalle { get; set; }
public int idFactura { get; set; }
public int idProducto { get; set; }
public int? idDetallePresupuesto { get; set; }
public double Cantidad { get; set; }
public double Precio { get; set; }
public bool EsVenta { get; set; }
public string? Observaciones { get; set; }
public int idTipoIVA { get; set; }
public double? PorcentajeIVA { get; set; }
public int? idDetalleRTF { get; set; }
public virtual detallepresupuesto? idDetallePresupuestoNavigation { get; set; }
public virtual ficheros? idDetalleRTFNavigation { get; set; }
public virtual facturas idFacturaNavigation { get; set; } = null!;
public virtual productos idProductoNavigation { get; set; } = null!;
public virtual enumeraciones idTipoIVANavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class detallesfacturasrecibidas
{
public int idDetalle { get; set; }
public int idFactura { get; set; }
public int idProducto { get; set; }
public double Cantidad { get; set; }
public double Precio { get; set; }
public int idTipoIva { get; set; }
public double? PorcentajeIVA { get; set; }
public string? Observaciones { get; set; }
public virtual facturasrecibidas idFacturaNavigation { get; set; } = null!;
public virtual productos idProductoNavigation { get; set; } = null!;
public virtual enumeraciones idTipoIvaNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class documentosfacturas
{
public int idDocumento { get; set; }
public string? Descripcion { get; set; }
public DateTime? Fecha { get; set; }
public int? idFichero { get; set; }
public int? idFactura { get; set; }
public int? idUsuario { get; set; }
public int Tipo { get; set; }
public virtual facturas? idFacturaNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class documentosfacturasrecibidas
{
public int idDocumento { get; set; }
public string? Descripcion { get; set; }
public DateTime? Fecha { get; set; }
public int? idFichero { get; set; }
public int? idFactura { get; set; }
public int? idUsuario { get; set; }
public int Tipo { get; set; }
public virtual facturasrecibidas? idFacturaNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class documentospresupuestos
{
public int idDocumento { get; set; }
public int idPresupuesto { get; set; }
public int idTipoDocumento { get; set; }
public int? idFichero { get; set; }
public DateTime? Fecha { get; set; }
public string? Descripcion { get; set; }
public int idUsuario { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual presupuestos idPresupuestoNavigation { get; set; } = null!;
public virtual enumeraciones idTipoDocumentoNavigation { get; set; } = null!;
public virtual usuarios idUsuarioNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class empresas
{
public int idEmpresa { get; set; }
public string RazonSocial { get; set; } = null!;
public DateOnly? FechaBaja { get; set; }
public int? idLogo1 { get; set; }
public int? idLogo2 { get; set; }
public string? Domicilio { get; set; }
public string? Poblacion { get; set; }
public string? CIF { get; set; }
public bool DescAmpliadaEnFE { get; set; }
public virtual ICollection<almacenes> almacenes { get; set; } = new List<almacenes>();
public virtual ICollection<cajas> cajas { get; set; } = new List<cajas>();
public virtual ICollection<cuentascorreo> cuentascorreo { get; set; } = new List<cuentascorreo>();
public virtual ICollection<entidades> entidades { get; set; } = new List<entidades>();
public virtual ficheros? idLogo1Navigation { get; set; }
public virtual ficheros? idLogo2Navigation { get; set; }
public virtual ICollection<plantillas> plantillas { get; set; } = new List<plantillas>();
public virtual ICollection<productos> productos { get; set; } = new List<productos>();
public virtual ICollection<seriesfacturas> seriesfacturas { get; set; } = new List<seriesfacturas>();
}

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class entidades
{
public int idEntidad { get; set; }
public string? NIF { get; set; }
public string? RazonSocial { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? Telefono3 { get; set; }
public string? FAX { get; set; }
public string? Email { get; set; }
public string? IBAN { get; set; }
public int? idTipoPago { get; set; }
public string? Observaciones { get; set; }
public bool EsCliente { get; set; }
public bool EsProveedor { get; set; }
public string? PersonaContacto { get; set; }
public double Descuento { get; set; }
public DateOnly? FechaAlta { get; set; }
public DateOnly? FechaBaja { get; set; }
public int? idUsuarioCreador { get; set; }
public int? idUsuarioModificador { get; set; }
public string? Codigo_Cliente_Ant { get; set; }
public string? Codigo_Proveedor_Ant { get; set; }
public string? Direccion { get; set; }
public string? CodigoPostal { get; set; }
public string? CodigoMunicipio { get; set; }
public int? idTipo { get; set; }
public int TipoImpresionAlbaranEntrega { get; set; }
public string? Email2 { get; set; }
public int idEmpresa { get; set; }
public virtual municipios? CodigoMunicipioNavigation { get; set; }
public virtual ICollection<albaranes> albaranes { get; set; } = new List<albaranes>();
public virtual ICollection<articulos> articulos { get; set; } = new List<articulos>();
public virtual ICollection<correos> correos { get; set; } = new List<correos>();
public virtual ICollection<eventos> eventos { get; set; } = new List<eventos>();
public virtual ICollection<expedientesentidades> expedientesentidades { get; set; } = new List<expedientesentidades>();
public virtual ICollection<facturas> facturas { get; set; } = new List<facturas>();
public virtual ICollection<facturasrecibidas> facturasrecibidas { get; set; } = new List<facturasrecibidas>();
public virtual empresas idEmpresaNavigation { get; set; } = null!;
public virtual enumeraciones? idTipoPagoNavigation { get; set; }
public virtual usuarios? idUsuarioCreadorNavigation { get; set; }
public virtual usuarios? idUsuarioModificadorNavigation { get; set; }
public virtual ICollection<presupuestos> presupuestos { get; set; } = new List<presupuestos>();
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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? FechaBaja { get; set; }
public DateTime? Fecha1 { get; set; }
public DateTime? Fecha2 { get; set; }
public virtual ICollection<detallesfacturas> detallesfacturas { get; set; } = new List<detallesfacturas>();
public virtual ICollection<detallesfacturasrecibidas> detallesfacturasrecibidas { get; set; } = new List<detallesfacturasrecibidas>();
public virtual ICollection<documentospresupuestos> documentospresupuestos { get; set; } = new List<documentospresupuestos>();
public virtual ICollection<entidades> entidades { get; set; } = new List<entidades>();
public virtual ICollection<facturasrecibidas> facturasrecibidas { get; set; } = new List<facturasrecibidas>();
public virtual ICollection<ficheros> ficheros { get; set; } = new List<ficheros>();
public virtual gruposenumeraciones idGrupoEnumeracionNavigation { get; set; } = null!;
public virtual ICollection<plantillas> plantillas { get; set; } = new List<plantillas>();
public virtual ICollection<procesos> procesosidSubtipoNavigation { get; set; } = new List<procesos>();
public virtual ICollection<procesos> procesosidTipoNavigation { get; set; } = new List<procesos>();
public virtual ICollection<usuarios> usuarios { get; set; } = new List<usuarios>();
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class eventos
{
public int idEvento { get; set; }
public string Descripcion { get; set; } = null!;
public int? idEntidad { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? Email { get; set; }
public string? PersonaContacto { get; set; }
public DateOnly FechaAlta { get; set; }
public DateOnly? FechaBaja { get; set; }
public int? idUsuario { get; set; }
public string? Direccion { get; set; }
public string? CodigoPostal { get; set; }
public string? CodigoMunicipio { get; set; }
public string? Observaciones { get; set; }
public virtual municipios? CodigoMunicipioNavigation { get; set; }
public virtual ICollection<facturas> facturas { get; set; } = new List<facturas>();
public virtual entidades? idEntidadNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<presupuestos> presupuestos { get; set; } = new List<presupuestos>();
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class expedientesentidades
{
public int idExpediente { get; set; }
public string? Descripcion { get; set; }
public DateTime? Fecha { get; set; }
public int? idFichero { get; set; }
public int? idEntidad { get; set; }
public int? idUsuario { get; set; }
public bool EsAdvertencia { get; set; }
public virtual entidades? idEntidadNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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 double SaldoAnterior { get; set; }
public DateTime FechaLectura { get; set; }
public int idUsuario { get; set; }
public double SaldoFinal { 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>();
}

View File

@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class facturas
{
public int idFactura { get; set; }
public string NumeroFactura { get; set; } = null!;
public DateOnly FechaFactura { get; set; }
public DateTime FechaEmision { get; set; }
public int idCliente { get; set; }
public double BaseImponibleExenta { get; set; }
public double? BaseImponible1 { get; set; }
public double? BaseImponible2 { get; set; }
public double? BaseImponible3 { get; set; }
public double? PorcentajeIVA1 { get; set; }
public double? PorcentajeIVA2 { get; set; }
public double? PorcentajeIVA3 { get; set; }
public double? CuotaIVA1 { get; set; }
public double? CuotaIVA2 { get; set; }
public double? CuotaIVA3 { get; set; }
public double TotalBaseImponible { get; set; }
public double PorcentajeIRPF { get; set; }
public double IRPF { get; set; }
public double TotalIVA { get; set; }
public double TotalFactura { get; set; }
public int? idUsuario { get; set; }
public int? idDatosClienteOriginal { get; set; }
public int idSerieFactura { get; set; }
public string? Observaciones { get; set; }
public string? ObservacionesAImprimir { get; set; }
public int? idEvento { get; set; }
public double ImportePagado { get; set; }
public DateOnly? FechaPago { get; set; }
public string? NIF { get; set; }
public string? RazonSocial { get; set; }
public string? Direccion { get; set; }
public string? CodigoPostal { get; set; }
public string? CodigoMunicipio { get; set; }
public DateTime? FechaEnvioAsesoria { get; set; }
public virtual municipios? CodigoMunicipioNavigation { get; set; }
public virtual ICollection<detallesfacturas> detallesfacturas { get; set; } = new List<detallesfacturas>();
public virtual ICollection<documentosfacturas> documentosfacturas { get; set; } = new List<documentosfacturas>();
public virtual entidades idClienteNavigation { get; set; } = null!;
public virtual ficheros? idDatosClienteOriginalNavigation { get; set; }
public virtual eventos? idEventoNavigation { get; set; }
public virtual seriesfacturas idSerieFacturaNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<movimientoscaja> movimientoscaja { get; set; } = new List<movimientoscaja>();
}

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class facturasrecibidas
{
public int idFactura { get; set; }
public string NumeroFactura { get; set; } = null!;
public DateOnly FechaFactura { get; set; }
public DateOnly FechaRegistro { get; set; }
public int idProveedor { get; set; }
public double BaseImponibleExenta { get; set; }
public double? BaseImponible1 { get; set; }
public double? BaseImponible2 { get; set; }
public double? BaseImponible3 { get; set; }
public double? PorcentajeIVA1 { get; set; }
public double? PorcentajeIVA2 { get; set; }
public double? PorcentajeIVA3 { get; set; }
public double TotalBaseImponible { get; set; }
public double TotalIVA { get; set; }
public double PorcentajeIRPF { get; set; }
public double IRPF { get; set; }
public double TotalFactura { get; set; }
public double ImportePagado { get; set; }
public DateOnly? FechaPago { get; set; }
public int? idUsuario { get; set; }
public int? idDatosProveedorOriginal { get; set; }
public int? idFichero { get; set; }
public double? CuotaIVA1 { get; set; }
public double? CuotaIVA2 { get; set; }
public double? CuotaIVA3 { get; set; }
public string? Observaciones { get; set; }
public string? NIF { get; set; }
public string? RazonSocial { get; set; }
public string? Direccion { get; set; }
public string? CodigoPostal { get; set; }
public string? CodigoMunicipio { get; set; }
public DateTime? FechaEnvioAsesoria { get; set; }
public int? idCategoria { get; set; }
public virtual ICollection<detallesfacturasrecibidas> detallesfacturasrecibidas { get; set; } = new List<detallesfacturasrecibidas>();
public virtual ICollection<documentosfacturasrecibidas> documentosfacturasrecibidas { get; set; } = new List<documentosfacturasrecibidas>();
public virtual enumeraciones? idCategoriaNavigation { get; set; }
public virtual ficheros? idDatosProveedorOriginalNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual entidades idProveedorNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual ICollection<movimientoscaja> movimientoscaja { get; set; } = new List<movimientoscaja>();
}

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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<articulos> articulos { get; set; } = new List<articulos>();
public virtual ICollection<correos> correos { get; set; } = new List<correos>();
public virtual ICollection<detallesfacturas> detallesfacturas { get; set; } = new List<detallesfacturas>();
public virtual ICollection<documentosfacturas> documentosfacturas { get; set; } = new List<documentosfacturas>();
public virtual ICollection<documentosfacturasrecibidas> documentosfacturasrecibidas { get; set; } = new List<documentosfacturasrecibidas>();
public virtual ICollection<documentospresupuestos> documentospresupuestos { get; set; } = new List<documentospresupuestos>();
public virtual ICollection<empresas> empresasidLogo1Navigation { get; set; } = new List<empresas>();
public virtual ICollection<empresas> empresasidLogo2Navigation { get; set; } = new List<empresas>();
public virtual ICollection<expedientesentidades> expedientesentidades { get; set; } = new List<expedientesentidades>();
public virtual ICollection<facturas> facturas { get; set; } = new List<facturas>();
public virtual ICollection<facturasrecibidas> facturasrecibidasidDatosProveedorOriginalNavigation { get; set; } = new List<facturasrecibidas>();
public virtual ICollection<facturasrecibidas> facturasrecibidasidFicheroNavigation { get; set; } = new List<facturasrecibidas>();
public virtual ICollection<ficherosadjuntos> ficherosadjuntos { get; set; } = new List<ficherosadjuntos>();
public virtual enumeraciones? idTipoNavigation { get; set; }
public virtual ICollection<movimientoscaja> movimientoscaja { get; set; } = new List<movimientoscaja>();
public virtual ICollection<plantillas> plantillas { get; set; } = new List<plantillas>();
public virtual ICollection<presupuestos> presupuestos { get; set; } = new List<presupuestos>();
public virtual ICollection<procesos> procesos { get; set; } = new List<procesos>();
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.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,15 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class fiestas
{
public int idFiesta { get; set; }
public string? Descripcion { get; set; }
public DateOnly Fecha { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class formulas
{
public int idFormula { get; set; }
public string Codigo { get; set; } = null!;
public string Descripcion { get; set; } = null!;
public string? Formula { get; set; }
public int Tipo { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class gruposenumeraciones
{
public int idGrupoEnumeracion { get; set; }
public string Grupo { get; set; } = null!;
public string? Descripcion { get; set; }
public bool Oculto { get; set; }
public virtual ICollection<enumeraciones> enumeraciones { get; set; } = new List<enumeraciones>();
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class gruposusuarios
{
public int idGrupo { get; set; }
public string? Descripcion { get; set; }
public virtual ICollection<autorizacionesgrupos> autorizacionesgrupos { get; set; } = new List<autorizacionesgrupos>();
public virtual ICollection<usuarios> usuarios { get; set; } = new List<usuarios>();
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class logs
{
public int idLog { get; set; }
public string? Tabla { get; set; }
public string Aplicacion { get; set; } = null!;
public int id { get; set; }
public string? Usuario { get; set; }
public string? ip { get; set; }
public DateTime? FechaHora { get; set; }
public string? Log { get; set; }
public int? idConexion { get; set; }
public double? idTimeStamp { get; set; }
public string? Tipo { get; set; }
public int? idRelacionado { get; set; }
public string? VersionPrograma { get; set; }
public bool? SuperUsuario { get; set; }
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class menus
{
public int idMenus { get; set; }
public string? Texto { get; set; }
public string? Ayuda { get; set; }
public string? Accion { get; set; }
public int? Orden { get; set; }
public int? idMenuPadre { get; set; }
public bool MostrarEnPanel { get; set; }
public int? idPermiso { get; set; }
public virtual permisos? idPermisoNavigation { get; set; }
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class movimientosbancarios
{
public int idMovimientoBancario { get; set; }
public int idExtractoBancario { get; set; }
public DateOnly FechaOperacion { get; set; }
public DateOnly FechaValor { get; set; }
public string CodigoConcepto { get; set; } = null!;
public string ConceptoPropio { get; set; } = null!;
public double Importe { get; set; }
public string NumeroDocumento { get; set; } = null!;
public string ReferenciaBanco { get; set; } = null!;
public string Detalle { get; set; } = null!;
public int? idConciliacion { get; set; }
public virtual conciliacionesbancarias? idConciliacionNavigation { get; set; }
public virtual extractosbancarios idExtractoBancarioNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class movimientoscaja
{
public int idMovimiento { get; set; }
public int idCaja { get; set; }
public double Importe { get; set; }
public int? idFactura { get; set; }
public DateTime Fecha { get; set; }
public DateTime FechaCreacion { get; set; }
public int? idMovimientoCierre { get; set; }
public int? idUsuario { get; set; }
public DateTime? FechaSupervision { get; set; }
public int? idUsuarioSupervisa { get; set; }
public string? DocumentoPago { get; set; }
public string? Observaciones { get; set; }
public string? NumeroRecibo { get; set; }
public int Tipo { get; set; }
public int? idFacturaRecibida { get; set; }
public double SaldoAntesCierre { get; set; }
public int? idConciliacion { get; set; }
public int? idFichero { get; set; }
public virtual ICollection<movimientoscaja> InverseidMovimientoCierreNavigation { get; set; } = new List<movimientoscaja>();
public virtual cajas idCajaNavigation { get; set; } = null!;
public virtual conciliacionesbancarias? idConciliacionNavigation { get; set; }
public virtual facturas? idFacturaNavigation { get; set; }
public virtual facturasrecibidas? idFacturaRecibidaNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual movimientoscaja? idMovimientoCierreNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
public virtual usuarios? idUsuarioSupervisaNavigation { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class municipios
{
public string CodigoMunicipio { get; set; } = null!;
public string? CodigoProvincia { get; set; }
public string? Nombre { get; set; }
public string? DC { get; set; }
public virtual provincias? CodigoProvinciaNavigation { get; set; }
public virtual ICollection<albaranes> albaranesCodigoMunicipioCargaNavigation { get; set; } = new List<albaranes>();
public virtual ICollection<albaranes> albaranesCodigoMunicipioDescargaNavigation { get; set; } = new List<albaranes>();
public virtual ICollection<almacenes> almacenes { get; set; } = new List<almacenes>();
public virtual ICollection<codigospostales> codigospostales { get; set; } = new List<codigospostales>();
public virtual ICollection<entidades> entidades { get; set; } = new List<entidades>();
public virtual ICollection<eventos> eventos { get; set; } = new List<eventos>();
public virtual ICollection<facturas> facturas { get; set; } = new List<facturas>();
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class permisos
{
public int idPermiso { get; set; }
public string? CodigoPermiso { get; set; }
public string? Descripcion { get; set; }
public virtual ICollection<autorizacionesgrupos> autorizacionesgrupos { get; set; } = new List<autorizacionesgrupos>();
public virtual ICollection<autorizacionesusuarios> autorizacionesusuarios { get; set; } = new List<autorizacionesusuarios>();
public virtual ICollection<cajas> cajas { get; set; } = new List<cajas>();
public virtual ICollection<menus> menus { get; set; } = new List<menus>();
public virtual ICollection<plantillas> plantillas { get; set; } = new List<plantillas>();
public virtual ICollection<procesos> procesos { get; set; } = new List<procesos>();
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class plantillas
{
public int idPlantilla { get; set; }
public string? Codigo { get; set; }
public string Descripcion { get; set; } = null!;
public int? idTipo { get; set; }
public string? Observaciones { get; set; }
public int idGrupo { get; set; }
public bool Oculta { get; set; }
public bool TipoListado { get; set; }
public int? idPermiso { get; set; }
public int? idFichero { get; set; }
public bool? Oculto { get; set; }
public int? Orden { get; set; }
public int? idEmpresa { get; set; }
public virtual empresas? idEmpresaNavigation { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual enumeraciones idGrupoNavigation { get; set; } = null!;
public virtual permisos? idPermisoNavigation { get; set; }
}

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class presupuestos
{
public int idPresupuesto { get; set; }
public DateOnly FechaPresupuesto { get; set; }
public DateOnly? FechaAceptacion { get; set; }
public int idCliente { get; set; }
public int? idEvento { get; set; }
public double ImporteBruto { get; set; }
public double PorcentajeIVA { get; set; }
public double IVA { get; set; }
public double TotalPresupuesto { get; set; }
public int? idUsuario { get; set; }
public int? idDatosClienteOriginal { get; set; }
public string? Observaciones { get; set; }
public DateOnly? FechaAceptacionPresupuesto { get; set; }
public int? idPersonaContacto { get; set; }
public double Kilometros { get; set; }
public DateOnly? FechaInicioEvento { get; set; }
public DateOnly? FechaFinEvento { get; set; }
public DateOnly? FechaMontaje { get; set; }
public DateOnly? FechaDesmontaje { get; set; }
public virtual ICollection<albaranes> albaranes { get; set; } = new List<albaranes>();
public virtual ICollection<detallepresupuesto> detallepresupuesto { get; set; } = new List<detallepresupuesto>();
public virtual ICollection<documentospresupuestos> documentospresupuestos { get; set; } = new List<documentospresupuestos>();
public virtual entidades idClienteNavigation { get; set; } = null!;
public virtual ficheros? idDatosClienteOriginalNavigation { get; set; }
public virtual eventos? idEventoNavigation { get; set; }
public virtual usuarios? idUsuarioNavigation { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class procesos
{
public int idProceso { get; set; }
public string? Descripcion { get; set; }
public string? Accion { get; set; }
public int? idTipo { get; set; }
public int? idSubtipo { get; set; }
public int? idPermiso { get; set; }
public int? idFichero { get; set; }
public string? Observaciones { get; set; }
public virtual ficheros? idFicheroNavigation { get; set; }
public virtual permisos? idPermisoNavigation { get; set; }
public virtual enumeraciones? idSubtipoNavigation { get; set; }
public virtual enumeraciones? idTipoNavigation { get; set; }
}

View File

@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class productos
{
public int idProducto { get; set; }
public string Descripcion { get; set; } = null!;
public DateTime? FechaBaja { get; set; }
public double PrecioVenta { get; set; }
public double PrecioAlquiler { get; set; }
public int? idUsuarioCreador { get; set; }
public int? idUsuarioModificador { get; set; }
public string? Observaciones { get; set; }
public bool? FacturarComoVentaPorDefecto { get; set; }
public string? Codigo { get; set; }
public double UltimoPrecioCompra { get; set; }
public double Peso { get; set; }
public double Volumen { get; set; }
public double HorasMontaje { get; set; }
public double HorasDesmontaje { get; set; }
public double TotalUnidades { get; set; }
public double UnidadesInicialesOFabricadas { get; set; }
public double UnidadesCompradas { get; set; }
public double UnidadesVendidas { get; set; }
public double UnidadesAlquiladas { get; set; }
public double UnidadesAveriadas { get; set; }
public double UnidadesDesechadas { get; set; }
public double UnidadesSubAlquiladas { get; set; }
public double PorcentajeDesgasteDiaAlquilado { get; set; }
public int NumeroAsientos { get; set; }
public int Tipo { get; set; }
public int NumeroFilas { get; set; }
public bool PrecioPorDia { get; set; }
public bool PrecioPorAsiento { get; set; }
public bool PrecioPorKm { get; set; }
public double PrecioMinimo { get; set; }
public double IncrementoGastosGenerales { get; set; }
public int Ancho { get; set; }
public int Largo { get; set; }
public bool IncluyeTarima { get; set; }
public bool IncluyeIluminacion { get; set; }
public int idEmpresa { get; set; }
public virtual ICollection<articulos> articulos { get; set; } = new List<articulos>();
public virtual ICollection<detallepresupuesto> detallepresupuesto { get; set; } = new List<detallepresupuesto>();
public virtual ICollection<detallesalbaranes> detallesalbaranes { get; set; } = new List<detallesalbaranes>();
public virtual ICollection<detallesfacturas> detallesfacturas { get; set; } = new List<detallesfacturas>();
public virtual ICollection<detallesfacturasrecibidas> detallesfacturasrecibidas { get; set; } = new List<detallesfacturasrecibidas>();
public virtual empresas idEmpresaNavigation { get; set; } = null!;
public virtual usuarios? idUsuarioCreadorNavigation { get; set; }
public virtual usuarios? idUsuarioModificadorNavigation { get; set; }
public virtual ICollection<stocks> stocks { get; set; } = new List<stocks>();
}

View File

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

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class seriesfacturas
{
public int idSerieFactura { get; set; }
public string? Descripcion { get; set; }
public DateOnly? FechaBaja { get; set; }
public string Serie { get; set; } = null!;
public int idEmpresa { get; set; }
public int Tipo { get; set; }
public int NumeroDigitos { get; set; }
public bool IRPFDespuesDeIVA { get; set; }
public virtual ICollection<facturas> facturas { get; set; } = new List<facturas>();
public virtual empresas idEmpresaNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class stocks
{
public int idStock { get; set; }
public int idAlmacen { get; set; }
public int idProducto { get; set; }
public double Unidades { get; set; }
public virtual almacenes idAlmacenNavigation { get; set; } = null!;
public virtual productos idProductoNavigation { get; set; } = null!;
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class tablas
{
public int idTabla { get; set; }
public string Codigo { get; set; } = null!;
public string Descripcion { get; set; } = null!;
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class trabajador
{
public int idTrabajador { get; set; }
public string? DocumentoIdentidad { get; set; }
public string? Apellidos { get; set; }
public string? Nombre { get; set; }
public string? CorreoElectronico { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public DateOnly? FechaAlta { get; set; }
public DateOnly? FechaBaja { get; set; }
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class usuarios
{
public int idUsuario { get; set; }
public string Usuario { get; set; } = null!;
public string? Nombre { get; set; }
public string? SHA1Passwd { get; set; }
public int? idGrupo { get; set; }
public int? idTema { get; set; }
public DateOnly? FechaBaja { get; set; }
public double? Escala { get; set; }
public virtual ICollection<albaranes> albaranes { get; set; } = new List<albaranes>();
public virtual ICollection<autorizacionesusuarios> autorizacionesusuarios { get; set; } = new List<autorizacionesusuarios>();
public virtual ICollection<conciliacionesbancarias> conciliacionesbancarias { get; set; } = new List<conciliacionesbancarias>();
public virtual ICollection<correos> correos { get; set; } = new List<correos>();
public virtual ICollection<documentosfacturas> documentosfacturas { get; set; } = new List<documentosfacturas>();
public virtual ICollection<documentosfacturasrecibidas> documentosfacturasrecibidas { get; set; } = new List<documentosfacturasrecibidas>();
public virtual ICollection<documentospresupuestos> documentospresupuestos { get; set; } = new List<documentospresupuestos>();
public virtual ICollection<entidades> entidadesidUsuarioCreadorNavigation { get; set; } = new List<entidades>();
public virtual ICollection<entidades> entidadesidUsuarioModificadorNavigation { get; set; } = new List<entidades>();
public virtual ICollection<eventos> eventos { get; set; } = new List<eventos>();
public virtual ICollection<expedientesentidades> expedientesentidades { get; set; } = new List<expedientesentidades>();
public virtual ICollection<extractosbancarios> extractosbancarios { get; set; } = new List<extractosbancarios>();
public virtual ICollection<facturas> facturas { get; set; } = new List<facturas>();
public virtual ICollection<facturasrecibidas> facturasrecibidas { get; set; } = new List<facturasrecibidas>();
public virtual gruposusuarios? idGrupoNavigation { get; set; }
public virtual enumeraciones? idTemaNavigation { get; set; }
public virtual ICollection<movimientoscaja> movimientoscajaidUsuarioNavigation { get; set; } = new List<movimientoscaja>();
public virtual ICollection<movimientoscaja> movimientoscajaidUsuarioSupervisaNavigation { get; set; } = new List<movimientoscaja>();
public virtual ICollection<presupuestos> presupuestos { get; set; } = new List<presupuestos>();
public virtual ICollection<productos> productosidUsuarioCreadorNavigation { get; set; } = new List<productos>();
public virtual ICollection<productos> productosidUsuarioModificadorNavigation { get; set; } = new List<productos>();
}

View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using PropertyChanged;
namespace bdGrupoSanchoToro.db;
[AddINotifyPropertyChangedInterface]
public partial class v_albaranesextendidos
{
public int idAlbaran { get; set; }
public DateOnly Fecha { get; set; }
public int? idPresupuesto { get; set; }
public int? idValeTransporte { get; set; }
public int Tipo { get; set; }
public DateTime? FechaCarga { get; set; }
public string? LugarCarga { get; set; }
public string? Cargadores { get; set; }
public DateTime? FechaDescarga { get; set; }
public string? LugarDescarga { get; set; }
public string? Descargadores { get; set; }
public double Peso { get; set; }
public double Volumen { get; set; }
public double PorcentajeTransporte { get; set; }
public double CostoEstimadoTransporte { get; set; }
public int idUsuario { get; set; }
public int? idAlmacenOrigen { get; set; }
public string? CodigoPostalCarga { get; set; }
public string? CodigoMunicipioCarga { get; set; }
public string? CodigoPostalDescarga { get; set; }
public string? CodigoMunicipioDescarga { get; set; }
public string? Telefono1Carga { get; set; }
public string? Telefono2Carga { get; set; }
public string? EmailCarga { get; set; }
public string? Telefono1Descarga { get; set; }
public string? Telefono2Descarga { get; set; }
public string? EmailDescarga { get; set; }
public int? idAlmacenDestino { get; set; }
public int? idEntidad { get; set; }
public int? idEvento { get; set; }
public string? DescripcionEvento { get; set; }
public string? Telefono1Evento { get; set; }
public string? Telefono2Evento { get; set; }
public string? PersonaContactoEvento { get; set; }
public string? DireccionEvento { get; set; }
public string? CodigoPostalEvento { get; set; }
public string? CodigoMunicipioEvento { get; set; }
public string? ObservacionesEvento { get; set; }
public string? NIF { get; set; }
public string? RazonSocial { get; set; }
public string? Telefono1 { get; set; }
public string? Telefono2 { get; set; }
public string? Email { get; set; }
public string? CodigoUsuario { get; set; }
public string? Usuario { get; set; }
}

View File

@@ -0,0 +1,27 @@
using bdGrupoSanchoToro;
using bdGrupoSanchoToro.db;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bdGrupoSanchoToro.dbcontext
{
public class EntidadService
{
private readonly tscGrupoSanchoToro _context;
public EntidadService(tscGrupoSanchoToro context)
{
_context = context;
}
public tscGrupoSanchoToro GetContextFromEntity(enumeraciones entidad)
{
var entry = _context.Entry(entidad);
return (tscGrupoSanchoToro)entry.Context;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;
using tsUtilidades.Enumeraciones;
using System.Drawing.Imaging;
namespace bdGrupoSanchoToro.dbcontext
{
public class Conexion
{
public string Nombre { get; set; }
public string Servidor { get; set; }
public int Puerto { get; set; }
public string Database { get; set; }
public string Usuario { get; set; }
public string Contraseña { get; set; }
public static List<Conexion> ListaConexiones()
{
List<Conexion> lc = new List<Conexion>();
//lc.Add(new Conexion() { Nombre = "Producción", Puerto = 13306, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
lc.Add(new Conexion() { Nombre = "Producción", Puerto = 3306, Servidor = "10.10.10.1", Usuario = "root", Contraseña = "îéÂj,íçLÑ0*B", Database = "gruposanchotoro" });
lc.Add(new Conexion() { Nombre = "Producción LOCAL", Puerto = 3306, Servidor = "192.168.41.44", Usuario = "root", Contraseña = "îéÂj,íçLÑ0*B", Database = "gruposanchotoro" });
lc.Add(new Conexion() { Nombre = "Desarrollo", Puerto = 13306, Servidor = "localhost", Usuario = "root", Contraseña = "îéÂj,íçLÑ0*B", Database = "gruposanchotoro" });
//lc.Add(new Conexion() { Nombre = "lunes", Puerto = 40001, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "martes", Puerto = 40002, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "miercoles", Puerto = 40003, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "jueves", Puerto = 40004, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "viernes", Puerto = 40005, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "sabado", Puerto = 40006, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "domingo", Puerto = 40007, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "enero", Puerto = 40101, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "febrero", Puerto = 40102, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "marzo", Puerto = 40103, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "abril", Puerto = 40104, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "mayo", Puerto = 40105, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "junio", Puerto = 40106, Servidor = "192.168.200.1",Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "julio", Puerto = 40107, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "agosto", Puerto = 40108, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "septiembre", Puerto = 40109, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "octubre", Puerto = 40110, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "noviembre", Puerto = 40111, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "diciembre", Puerto = 40112, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
//lc.Add(new Conexion() { Nombre = "replica", Puerto = 40000, Servidor = "192.168.200.1", Usuario = "m3soft", Contraseña = "îéÂj,íçLÑ0*B", Database = "GrupoSanchoToro" });
return lc;
}
internal static string ObtieneConexionDefecto(string NombreConexion="Producción")
{
try
{
// optionsBuilder.UseMySql("server=GrupoSanchoToro;database=GrupoSanchoToro;port=13306;uid=m3soft;pwd=Romian2023--;persistsecurityinfo=True;TreatTinyAsBoolean=True;allowuservariables=True", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.2.0-mysql"));
string cs = @";persistsecurityinfo=True;TreatTinyAsBoolean=False;allowuservariables=True";
var lc = ListaConexiones();
var cn = lc.First(x => x.Nombre == NombreConexion);
string servidor = "";
if (Environment.MachineName.ToUpper() == "SERVIDOR-ES")
servidor = "localhost";
else
{
servidor = cn.Servidor;
try
{
servidor = System.Net.Dns.GetHostEntry("servidorbd").AddressList[0].ToString();
}
catch
{
}
}
cs = "server=" + servidor + ";pwd=" + tsUtilidades.crypt.FEncS(cn.Contraseña, @"[JO1]", @"[JD1]", -875421649) + ";port=" + cn.Puerto.ToString() + ";uid=" + cn.Usuario + ";database=" + cn.Database + cs;
return cs;
}
// End If
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
}
}

View File

@@ -0,0 +1,166 @@
//using bdGrupoSanchoToro.CompiledModels;
using bdGrupoSanchoToro.db;
using bdGrupoSanchoToro.dbcontext;
using bdGrupoSanchoToro.dbcontext;
using Castle.Components.DictionaryAdapter.Xml;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using tsEFCore8.Extensiones;
using tsUtilidades;
using tsUtilidades.Enumeraciones;
using tsUtilidades.Extensiones;
using static System.Net.Mime.MediaTypeNames;
using Microsoft.Extensions.Hosting;
namespace bdGrupoSanchoToro
{
public class tscGrupoSanchoToro : bdGrupoSanchoToro.dbcontext.GrupoSanchoToroContext, tsUtilidades.ItsContexto
{
public static bool Cargado = false;
private static String? _Ip = null;
public string? ip
{
get
{
return _Ip;
}
set
{
_Ip = value;
}
}
public string Aplicaciones { get; private set; }
public static readonly Microsoft.Extensions.Logging.LoggerFactory _myLoggerFactory =
new LoggerFactory(new[] {
new Microsoft.Extensions.Logging.Debug.DebugLoggerProvider()
});
private static string? ConexionPorDefecto=null;
public static tscGrupoSanchoToro NuevoContexto(string NombreConexion = "" ,bool Lazy = true, bool SoloLectura = false, bool ConEventoSavingChanges = false, string aplicaciones = "")
{
string? cnx = null;
if (NombreConexion=="")
{
if (ConexionPorDefecto == null) ConexionPorDefecto = Conexion.ObtieneConexionDefecto();
cnx = ConexionPorDefecto;
}
else
{
cnx = Conexion.ObtieneConexionDefecto(NombreConexion);
}
var ob = new DbContextOptionsBuilder<GrupoSanchoToroContext>();
// ob.UseLoggerFactory(_myLoggerFactory);
// ob.UseInternalServiceProvider(<EnumeracionesService>)
ob.UseMySql(cnx, Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.0-mysql"));
if (Lazy) ob.UseLazyLoadingProxies();
if (SoloLectura) ob.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
var Opciones = ob.Options;
tscGrupoSanchoToro bd = new tscGrupoSanchoToro(Opciones);
bd.Aplicaciones = aplicaciones;
if (ConEventoSavingChanges) bd.SavingChanges += GuardandoCambios;
return bd;
}
//public static Datos.BBDD ObtieneBBDD(string NombreConexion)
private static void GuardandoCambios(object? sender, SavingChangesEventArgs e)
{
try
{
tscGrupoSanchoToro bd = (tscGrupoSanchoToro)sender;
var lap = bd.Aplicaciones.Split("|");
foreach (string ap in lap)
{
switch (ap.ToLower())
{
case "facturas":
{
bdGrupoSanchoToro.db.facturas.GuardandoCambios(bd, ap);
break;
}
}
}
}
catch (Exception)
{
throw;
}
}
public tscGrupoSanchoToro(DbContextOptions<GrupoSanchoToroContext> Opciones) : base(Opciones)
{
if (_Ip == null) { ip = tsEFCore8.bbdd.ObtieneIPMysql(this); }
else { ip = _Ip; }
}
public void AñadeObjeto(object Registro)
{
this.Add(Registro);
}
public bool CompruebaUnico(EstadosAplicacion estado, string NombreCampo, object Valor, string NombreTablaBase, object DataContext)
{
return this.CompruebaRegistroUnico(estado == EstadosAplicacion.ModificandoRegistro, "bdGrupoSanchoToro.db", NombreTablaBase, NombreCampo, Valor, DataContext);
}
public void EliminaObjeto(object Registro)
{
if (this.Entry(Registro).State == Microsoft.EntityFrameworkCore.EntityState.Detached)
{
this.Entry(Registro).State = Microsoft.EntityFrameworkCore.EntityState.Unchanged;
}
else if (this.Entry(Registro).State == Microsoft.EntityFrameworkCore.EntityState.Added)
{
this.Remove(Registro);
this.Entry(Registro).State = Microsoft.EntityFrameworkCore.EntityState.Unchanged;
}
else
{
this.Remove(Registro);
}
}
public int GuardarCambios()
{
return this.SaveChanges();
}
public bool HayModificaciones()
{
return this.ChangeTracker.HasChanges();
//IEnumerable<Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry> res = from e in this.ChangeTracker.Entries()
// where e.State.HasFlag(Microsoft.EntityFrameworkCore.EntityState.Added) ||
// e.State.HasFlag(Microsoft.EntityFrameworkCore.EntityState.Modified) ||
// e.State.HasFlag(Microsoft.EntityFrameworkCore.EntityState.Deleted)
// select e;
//if (res.Any())
// return true;
//return false;
}
public int ObtieneLongitudCampo(string NombreTablaBase, string NombreCampo)
{
return this.ObtieneMaximaLongitudCampo("bdGrupoSanchoToro.db", NombreTablaBase, NombreCampo);
}
}
}

View File

@@ -0,0 +1,245 @@
{
"CodeGenerationMode": 4,
"ContextClassName": "GrupoSanchoToroContext",
"ContextNamespace": null,
"FilterSchemas": false,
"IncludeConnectionString": false,
"ModelNamespace": null,
"OutputContextPath": "dbcontext",
"OutputPath": "db",
"PreserveCasingWithRegex": true,
"ProjectRootNamespace": "bdGrupoSanchoToro",
"Schemas": null,
"SelectedHandlebarsLanguage": 2,
"SelectedToBeGenerated": 0,
"T4TemplatePath": null,
"Tables": [
{
"Name": "albaranes",
"ObjectType": 0
},
{
"Name": "almacenes",
"ObjectType": 0
},
{
"Name": "articulos",
"ObjectType": 0
},
{
"Name": "autorizacionesgrupos",
"ObjectType": 0
},
{
"Name": "autorizacionesusuarios",
"ObjectType": 0
},
{
"Name": "bancos",
"ObjectType": 0
},
{
"Name": "cajas",
"ObjectType": 0
},
{
"Name": "codigospostales",
"ObjectType": 0
},
{
"Name": "conciliacionesbancarias",
"ObjectType": 0
},
{
"Name": "correos",
"ObjectType": 0
},
{
"Name": "cuentascorreo",
"ObjectType": 0
},
{
"Name": "detallepresupuesto",
"ObjectType": 0
},
{
"Name": "detallesalbaranes",
"ObjectType": 0
},
{
"Name": "detallesfacturas",
"ObjectType": 0
},
{
"Name": "detallesfacturasrecibidas",
"ObjectType": 0
},
{
"Name": "documentosfacturas",
"ObjectType": 0
},
{
"Name": "documentosfacturasrecibidas",
"ObjectType": 0
},
{
"Name": "documentospresupuestos",
"ObjectType": 0
},
{
"Name": "empresas",
"ObjectType": 0
},
{
"Name": "entidades",
"ObjectType": 0
},
{
"Name": "enumeraciones",
"ObjectType": 0
},
{
"Name": "eventos",
"ObjectType": 0
},
{
"Name": "expedientesentidades",
"ObjectType": 0
},
{
"Name": "extractosbancarios",
"ObjectType": 0
},
{
"Name": "facturas",
"ObjectType": 0
},
{
"Name": "facturasrecibidas",
"ObjectType": 0
},
{
"Name": "ficheros",
"ObjectType": 0
},
{
"Name": "ficherosadjuntos",
"ObjectType": 0
},
{
"Name": "ficherosconfiguracion",
"ObjectType": 0
},
{
"Name": "fiestas",
"ObjectType": 0
},
{
"Name": "formulas",
"ObjectType": 0
},
{
"Name": "gruposenumeraciones",
"ObjectType": 0
},
{
"Name": "gruposusuarios",
"ObjectType": 0
},
{
"Name": "logs",
"ObjectType": 0
},
{
"Name": "menus",
"ObjectType": 0
},
{
"Name": "movimientosbancarios",
"ObjectType": 0
},
{
"Name": "movimientoscaja",
"ObjectType": 0
},
{
"Name": "municipios",
"ObjectType": 0
},
{
"Name": "permisos",
"ObjectType": 0
},
{
"Name": "plantillas",
"ObjectType": 0
},
{
"Name": "presupuestos",
"ObjectType": 0
},
{
"Name": "procesos",
"ObjectType": 0
},
{
"Name": "productos",
"ObjectType": 0
},
{
"Name": "provincias",
"ObjectType": 0
},
{
"Name": "seriesfacturas",
"ObjectType": 0
},
{
"Name": "stocks",
"ObjectType": 0
},
{
"Name": "tablas",
"ObjectType": 0
},
{
"Name": "trabajador",
"ObjectType": 0
},
{
"Name": "usuarios",
"ObjectType": 0
},
{
"Name": "v_albaranesextendidos",
"ObjectType": 3
}
],
"UiHint": null,
"UncountableWords": null,
"UseAsyncStoredProcedureCalls": true,
"UseBoolPropertiesWithoutDefaultSql": true,
"UseDatabaseNames": true,
"UseDatabaseNamesForRoutines": true,
"UseDateOnlyTimeOnly": false,
"UseDbContextSplitting": false,
"UseDecimalDataAnnotationForSprocResult": true,
"UseFluentApiOnly": true,
"UseHandleBars": false,
"UseHierarchyId": false,
"UseInflector": false,
"UseInternalAccessModifiersForSprocsAndFunctions": false,
"UseLegacyPluralizer": false,
"UseManyToManyEntity": false,
"UseNoDefaultConstructor": false,
"UseNoNavigations": false,
"UseNoObjectFilter": false,
"UseNodaTime": false,
"UseNullableReferences": true,
"UsePrefixNavigationNaming": false,
"UseSchemaFolders": false,
"UseSchemaNamespaces": false,
"UseSpatial": false,
"UseT4": true,
"UseT4Split": false
}

View File

@@ -0,0 +1,73 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
namespace bdGrupoSanchoToro.db
{
public partial class almacenes:INotifyPropertyChanged
{
public string DescripcionTipo
{
get
{
return ((TipoAlmacenEnum)this.Tipo).ToString().Replace("_", " ");
}
}
public string Poblacion
{
get
{
return municipios.ObtienePoblacion(this.CodigoMunicipio);
}
}
public string Provincia
{
get
{
return municipios.ObtieneProvincia(this.CodigoMunicipio);
}
}
public string PoblacionProvincia
{
get
{
try
{
if ((Poblacion ?? "") == (Provincia ?? ""))
{
return Poblacion;
}
else
{
return Poblacion + " (" + Provincia + ")";
}
}
catch (Exception ex)
{
return "** DESCONOCIDO **";
}
}
}
public event PropertyChangedEventHandler? PropertyChanged;
public void RefrescaCamposSoloLectura()
{
this.OnPropertyChanged("Provincia");
this.OnPropertyChanged("Poblacion");
}
protected void OnPropertyChanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
public enum TipoAlmacenEnum : int
{
ALMACEN = 0,
TALLER_REPARACIONES = 1,
UNIDADES_DESCARTADAS = 2
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Data;
using System.Linq;
namespace bdGrupoSanchoToro.db
{
public partial class cajas
{
public double SaldoPendienteCierre
{
get
{
return this.movimientoscaja.Where(x => x.idMovimientoCierre.HasValue == false).Sum(x => x.Importe);
}
}
public double SaldoActual
{
get
{
return Math.Round(Math.Round(this.SaldoAlCierre, 2, MidpointRounding.AwayFromZero) + Math.Round(SaldoPendienteCierre, 2, MidpointRounding.AwayFromZero), 2, MidpointRounding.AwayFromZero);
}
}
public string DescripcionTipo
{
get
{
return ((TipoCajaEnum)this.Tipo).ToString();
}
}
public enum TipoCajaEnum
{
CONTADO = 0,
BANCO = 1
}
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
using System.Linq;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class codigospostales
{
[NotMapped]
public virtual string Provincia
{
get
{
return this.CodigoMunicipioNavigation.CodigoProvinciaNavigation.Nombre;
}
}
[NotMapped]
public virtual string Poblacion
{
get
{
return this.CodigoMunicipioNavigation.Nombre;
}
}
}
}

View File

@@ -0,0 +1,94 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace bdGrupoSanchoToro.db
{
public partial class conciliacionesbancarias
{
[NotMapped]
public double ImporteExtractosConciliados
{
get
{
return this.movimientosbancarios.Sum(x => x.Importe);
}
}
[NotMapped]
public double ImporteApuntesConciliados
{
get
{
return this.movimientoscaja.Sum(x => x.Importe);
}
}
private int? _Anno;
[NotMapped]
public int? Anno
{
get
{
if (_Anno.HasValue)
{
return _Anno;
}
else if (this.FechaInicio == DateOnly.MinValue)
{
return default;
}
else
{
return this.FechaInicio.Year;
}
}
set
{
_Anno = value;
if (_Mes.HasValue)
{
this.FechaInicio = new DateOnly((int)_Anno, (int)_Mes, 1);
this.FechaFin = new DateOnly((int)_Anno, (int)_Mes, DateTime.DaysInMonth((int)_Anno, (int)_Mes));
}
}
}
private int? _Mes;
[NotMapped]
public int? Mes
{
get
{
if (_Mes.HasValue)
{
return _Mes;
}
else if (this.FechaInicio == DateOnly.MinValue)
{
return default;
}
else
{
return this.FechaInicio.Month;
}
}
set
{
_Mes = value;
if (_Anno.HasValue)
{
this.FechaInicio = new DateOnly((int)_Anno, (int)_Mes, 1);
this.FechaFin = new DateOnly((int)_Anno, (int)_Mes, DateTime.DaysInMonth((int)_Anno, (int)_Mes));
}
}
}
}
}

View File

@@ -0,0 +1,127 @@
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Linq;
using System.Net.Mail;
using System.Net.Mime;
using tsEFCore8.Extensiones;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
[NotMapped]
public partial class correos
{
[NotMapped]
public virtual string FicheroAdjunto
{
get
{
if (this.idFicheroAdjunto.HasValue)
{
return this.idFicheroAdjuntoNavigation.NombreFichero;
}
else
{
return "";
}
}
}
public static void GeneraRegistroCorreon(tscGrupoSanchoToro bd, string Asunto, string Cuerpo, bdGrupoSanchoToro.db.cuentascorreo cuenta, string Destinatario, string ConCopia, string ConCopiaOculta, byte[] FicheroAdjunto = null, string NombreFicheroAdjunto = "", int? idAplicacion = default, string CodigoAplicacion = "", int? idEntidad = default)
{
try
{
string sRutaAdjunto = "";
var correo = new correos()
{
Asunto = Asunto,
Cuerpo = Cuerpo,
Destinatario = Destinatario,
Copia = ConCopia,
CopiaOculta = ConCopiaOculta,
DireccionRespuesta = cuenta.Remitente,
FechaCreacion = bd.AhoraMySql(),
idcuenta = cuenta.idCuenta,
Remitente = cuenta.Remitente,
idAplicacion = idAplicacion,
CodigoAplicacion = CodigoAplicacion,
idEntidad = idEntidad
};
if (bdGrupoSanchoToro.db.Utilidades.idUsuario > 0)
correo.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario;
bd.correos.Add(correo);
if (FicheroAdjunto is not null)
{
var fi = new bdGrupoSanchoToro.db.ficheros();
fi.Descripcion = "Fichero Adjunto Correo";
fi.NombreFichero = NombreFicheroAdjunto;
fi.Fichero = FicheroAdjunto;
fi.Fecha = DateTime.Now;
fi.idTipo = bd.enumeraciones.First(x => x.Codigo == "TIPFIC.ADJCOR").idEnumeracion;
correo.idFicheroAdjuntoNavigation = fi;
}
bd.GuardarCambios();
}
catch (Exception ex)
{
Debug.Write(ex.Message);
throw;
}
}
//public static void ProcesaCorreos()
//{
// try
// {
// var bd = tscGrupoSanchoToro.NuevoContexto();
// var EmailEnPruebas = bd.enumeraciones.First(x => x.Codigo == @"CONF.EMAILENPRUEBAS").ValorAlfabeticoLargo;
// var EmailCopiaOculta = bd.enumeraciones.First(x => x.Codigo == @"CONF.EMAILCOPIAOCULTAS").ValorAlfabeticoLargo;
// // Dim EmailCopiaOculta = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILCOPIAOCULTA").ValorAlfabeticoLargo
// var cors = bd.correos.Where(x=>x.FechaAnulacion == null && x.FechaEnvio == null && x.idcuenta !=null).ToList();
// foreach (var c in cors)
// {
// try
// {
// c.Asunto = c.Asunto.Replace(Environment.NewLine, " ");
// bool bIntentar = false;
// if (c.FechaUltimoIntento == null)
// { bIntentar = true; }
// else
// {
// if (DateTime.UtcNow.Subtract(c.FechaUltimoIntento.Value).TotalHours>1 ) bIntentar = true;
// }
// if (bIntentar)
// {
// string sPass = c.idcuentaNavigation.Password;
// if (System.IO.Directory.Exists(@"C:\tecnosis.tfs"))
// {
// c.Destinatario = "manmog@tecnosis.net";
// }
// else
// {
// }
// }
// }
// catch (Exception)
// {
// throw;
// }
// }
// }
// catch (Exception ex)
// {
// Debug.Write(ex.Message);
// throw;
// }
//}
}
}

View File

@@ -0,0 +1,101 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.CompilerServices;
using System.Text;
using tsUtilidades.Extensiones;
using System.Globalization;
namespace bdGrupoSanchoToro.db
{
public partial class detallesfacturas
{
public double Importe
{
get
{
return Math.Round(this.Cantidad * this.Precio, 2, MidpointRounding.AwayFromZero);
}
}
public string Descripcion
{
get
{
return (this.idProductoNavigation.Descripcion + " " + this.Observaciones.NothingAVacio()).Trim();
}
}
private byte[]? _DetalleRTF;
[NotMapped]
public byte[] DetalleRTF
{
get
{
if (_DetalleRTF == null)
{
if (this.idDetalleRTFNavigation != null && this.idDetalleRTFNavigation.Fichero != null)
{
_DetalleRTF = idDetalleRTFNavigation.Fichero;
}
else
{
_DetalleRTF = new byte[0];
}
}
return _DetalleRTF;
}
set
{
_DetalleRTF = value;
}
}
[NotMapped]
public bool DetalleRTFModificado { get; set; }
[NotMapped]
public string DetalleRTFString
{
get
{
if (this.idDetalleRTFNavigation != null && this.idDetalleRTFNavigation.Fichero != null && this.idDetalleRTFNavigation.Fichero.Length>0)
{
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
return encoding.GetString( idDetalleRTFNavigation.Fichero);
}
else
{
return ConvertToRtf(this.Descripcion,9.75);
}
}
}
public static string ConvertToRtf(string inputText, double fontSize)
{
// Validar el tamaño de la fuente
if (fontSize <= 0)
{
throw new ArgumentException("El tamaño de la fuente debe ser mayor que cero.");
}
// Crear el encabezado RTF
StringBuilder rtf = new StringBuilder();
rtf.Append(@"{\rtf1\ansi\deff0");
rtf.Append(@"{\fonttbl{\f0 Arial;}}");
string fs = Math.Round(fontSize * 2,0).ToString(CultureInfo.InvariantCulture);
rtf.Append(@"\fs").Append(fs); // RTF usa la mitad del tamaño de punto
// Agregar el texto
rtf.Append(" ");
rtf.Append(inputText.Replace("\n", @"\par "));
// Cerrar el documento RTF
rtf.Append("}");
return rtf.ToString();
}
}
}

View File

@@ -0,0 +1,28 @@
using PropertyChanged;
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class detallesfacturasrecibidas
{
public double Importe
{
get
{
return Math.Round(this.Cantidad * this.Precio, 4, MidpointRounding.AwayFromZero);
}
}
public string Descripcion
{
get
{
return (this.idProductoNavigation.Descripcion + " " + this.Observaciones.NothingAVacio()).Trim();
}
}
//public byte[]? DetalleRTF { get { } set { } }
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Data;
using System.Linq;
namespace bdGrupoSanchoToro.db
{
public partial class documentosfacturas
{
public string DescripcionTipo
{
get
{
return ((TipoDocumentoFacturaEnum)this.Tipo).ToString();
}
}
public enum TipoDocumentoFacturaEnum
{
FACTURA_IMPRESA = 0,
RECIBO = 1,
ALBARAN =2,
OTROS=99
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Data;
using System.Linq;
namespace bdGrupoSanchoToro.db
{
public partial class documentosfacturasrecibidas
{
public string DescripcionTipo
{
get
{
return ((TipoDocumentoFacturaEnum)this.Tipo).ToString();
}
}
public enum TipoDocumentoFacturaEnum
{
FACTURA_IMPRESA = 0,
RECIBO = 1,
ALBARAN = 2,
OTROS = 99
}
}
}

View File

@@ -0,0 +1,156 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class entidades:INotifyPropertyChanged
{
[NotMapped]
public virtual string RazonSocialNIF
{
get
{
return this.RazonSocial + " (NIF: " + this.NIF + ")";
}
}
[NotMapped]
public virtual string Poblacion
{
get
{
return municipios.ObtienePoblacion(this.CodigoMunicipio);
}
}
[NotMapped]
public virtual string Provincia
{
get
{
return municipios.ObtieneProvincia(this.CodigoMunicipio);
}
}
[NotMapped]
public virtual string PoblacionProvincia
{
get
{
try
{
if ((Poblacion ?? "") == (Provincia ?? ""))
{
return Poblacion;
}
else
{
return Poblacion + " (" + Provincia + ")";
}
}
catch (Exception )
{
return "** DESCONOCIDO **";
}
}
}
[NotMapped]
public virtual string DireccionCompleta
{
get
{
try
{
return CodigoPostal + " " + PoblacionProvincia;
}
catch (Exception )
{
return "** DESCONOCIDO **";
}
}
}
public static List<entidades> ObtieneClientesActuales(tscGrupoSanchoToro bd)
{
return bd.entidades.Where(x=> x.EsCliente && x.FechaBaja.HasValue==false).ToList();
}
public event PropertyChangedEventHandler? PropertyChanged;
//public double? PendientePago
//{
// get
// {
// try
// {
// if (this.idEntidad == 0)
// {
// return default;
// }
// else
// {
// tscGrupoSanchoToro bd = (tscGrupoSanchoToro)this.ObtieneContexto();
// if (bd is not null)
// {
// double mcs = bd.movimientoscaja.Where(x => x.idFactura.HasValue == false).Select(x => x.Importe).ToList().Sum(x => x);
// double facs = bd.facturas.Where(x => x.idCliente == this.idEntidad).Select(x => x.TotalFactura).ToList().Sum(x => x);
// double pagos = bd.movimientoscaja.Where(x => x.idFactura.HasValue && x.facturas.idCliente == this.idEntidad).Select(x => x.Importe).ToList().Sum(x => x);
// double ImpPen = Math.Round(facs - mcs - pagos, 2, MidpointRounding.AwayFromZero);
// if (ImpPen > 0d)
// {
// return ImpPen;
// }
// else
// {
// return default;
// }
// }
// else
// {
// return default;
// }
// }
// }
// catch (Exception ex)
// {
// return default;
// }
// }
//}
protected void OnPropertyChanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
public void RefrescaCamposSoloLectura()
{
this.OnPropertyChanged("Provincia");
this.OnPropertyChanged("Poblacion");
this.OnPropertyChanged("PendientePago");
}
public string Advertencias
{
get
{
string sAdvertencias = "";
foreach (var ad in this.expedientesentidades.Where(x => x.EsAdvertencia).ToList())
sAdvertencias += " -- " + ad.Descripcion;
if (!string.IsNullOrEmpty(sAdvertencias))
sAdvertencias = sAdvertencias.Substring(4);
return sAdvertencias;
}
}
}
}

View File

@@ -0,0 +1,31 @@
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class eventos
{
public string DireccionCompleta
{
get
{
if (this.CodigoMunicipioNavigation is not null)
{
if ((this.CodigoMunicipioNavigation.Nombre ?? "") != (this.CodigoMunicipioNavigation.provincias.Nombre ?? ""))
{
return this.Direccion + " " + this.CodigoPostal + " " + this.CodigoMunicipioNavigation.Nombre + " (" + this.CodigoMunicipioNavigation.provincias.Nombre + ")";
}
else
{
return this.Direccion + " " + this.CodigoPostal + " " + this.CodigoMunicipioNavigation.Nombre;
}
}
else
{
return this.Direccion.NothingAVacio();
}
}
}
}
}

View File

@@ -0,0 +1,319 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using Newtonsoft.Json;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class facturas
{
[NotMapped]
public virtual string RazonSocialEmpresa
{
get
{
if (this.idSerieFacturaNavigation == null)
{
return "";
}
else
{
return this.idSerieFacturaNavigation.idEmpresaNavigation.RazonSocial;
}
}
}
[NotMapped]
public virtual string DomicilioEmpresa
{
get
{
if (this.idSerieFacturaNavigation == null)
{
return "";
}
else
{
return this.idSerieFacturaNavigation.idEmpresaNavigation.Domicilio;
}
}
}
[NotMapped]
public virtual string PoblacionEmpresa
{
get
{
if (this.idSerieFacturaNavigation == null)
{
return "";
}
else
{
return this.idSerieFacturaNavigation.idEmpresaNavigation.Poblacion;
}
}
}
[NotMapped]
public virtual string CIFEmpresa
{
get
{
if (this.idSerieFacturaNavigation == null)
{
return "";
}
else
{
return this.idSerieFacturaNavigation.idEmpresaNavigation.CIF;
}
}
}
[NotMapped]
public virtual int? idSerieFactura_Nulable
{
get
{
if (this.idSerieFactura == 0)
{
return default;
}
else
{
return this.idSerieFactura;
}
}
set
{
if (value.HasValue)
{
this.idSerieFactura = value.Value;
}
// this.OnPropertyChanged("idSerieFactura_Nulable");
}
}
[NotMapped]
public virtual int? idCliente_Nulable
{
get
{
if (this.idCliente == 0)
{
return default;
}
else
{
return this.idCliente;
}
}
set
{
if (value.HasValue)
{
this.idCliente = value.Value;
}
// this.OnPropertyChanged("idCliente_Nulable");
}
}
//[NotMapped]
//public virtual double ImportePagado
//{
// get
// {
// if (this.movimientoscaja.Any())
// {
// return this.movimientoscaja.Sum(x => x.Importe);
// }
// else
// {
// return 0d;
// }
// }
//}
//[NotMapped]
//public virtual DateTime? FechaPago
//{
// get
// {
// if (ImportePendiente == 0d & this.movimientoscaja.Any())
// {
// return this.movimientoscaja.OrderByDescending(x => x.Fecha).First().Fecha;
// }
// else
// {
// return default;
// }
// }
//}
[NotMapped]
public virtual double ImportePendiente
{
get
{
return Math.Round(this.TotalFactura - ImportePagado, 2, MidpointRounding.AwayFromZero);
}
}
//public event PropertyChangedEventHandler? PropertyChanged;
//protected void OnPropertyChanged([CallerMemberName] string name = null)
//{
// PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
//}
public void EstableceNumeroFactura(bdGrupoSanchoToro.dbcontext.GrupoSanchoToroContext bd)
{
seriesfacturas sf = this.idSerieFacturaNavigation;
var ts = (bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum)sf.Tipo;
if (ts != bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE)
{
string serie = sf.Serie;
if (ts == seriesfacturas.TipoSerieFacturaEnum.AUTOMÁTICA_CON_AÑO) serie += (this.FechaFactura.Year % 100).ToString();
serie += "/";
string sNumeroFactura;
var bdtmp = tscGrupoSanchoToro.NuevoContexto();
var uf = bdtmp.facturas.Where(x => x.idSerieFactura == sf.idSerieFactura && x.NumeroFactura.StartsWith(serie)).OrderByDescending(x => x.NumeroFactura).FirstOrDefault();
int nf = 0;
if (uf != null) nf = int.Parse(uf.NumeroFactura.Split("/")[1]);
do
{
nf += 1;
sNumeroFactura = serie + nf.ToString().PadLeft(sf.NumeroDigitos, '0');
}
while (bdtmp.facturas.Any(X => X.NumeroFactura == sNumeroFactura && X.idSerieFactura == sf.idSerieFactura));
this.NumeroFactura = sNumeroFactura;
}
}
public virtual string ListaNumeroRecibos
{
get
{
string sLista = "";
var mvs = this.movimientoscaja.OrderBy(x => x.Fecha).ThenBy(x => x.idMovimiento).ToList();
foreach (var m in mvs)
sLista += m.NumeroRecibo + Environment.NewLine;
return sLista;
}
}
public virtual string ListaFechaPagoRecibos
{
get
{
string sLista = "";
var mvs = this.movimientoscaja.OrderBy(x => x.Fecha).ThenBy(x => x.idMovimiento).ToList();
foreach (var m in mvs)
sLista += m.Fecha.ToString("dd/MM/yyyy") + Environment.NewLine;
return sLista;
}
}
public virtual string ListaFormaPago
{
get
{
string sLista = "";
var mvs = this.movimientoscaja.OrderBy(x => x.Fecha).ThenBy(x => x.idMovimiento).ToList();
foreach (var m in mvs)
sLista += m.idCajaNavigation.Descripcion + Environment.NewLine;
return sLista;
}
}
public string ListaImporteRecibos
{
get
{
string sLista = "";
var mvs = this.movimientoscaja.OrderBy(x => x.Fecha).ThenBy(x => x.idMovimiento).ToList();
foreach (var m in mvs)
sLista += m.Importe.ToString("c2") + Environment.NewLine;
return sLista;
}
}
[NotMapped] public virtual bool Marca_TMP { get; set; }
[NotMapped] public virtual string? NIF_TMP { get; set; }
[NotMapped] public virtual string? Obra_TMP { get; set; }
[NotMapped] public virtual string? RazonSocial_TMP { get; set; }
[NotMapped] public virtual string? Email_TMP { get; set; }
[NotMapped] public virtual string? Email2_TMP { get; set; }
[NotMapped] public virtual bool EnviarEmail_TMP { get; set; }
#region Eventos
[NotMapped]
public string ProvinciaEvento
{
get
{
if (this.idEvento == null || this.idEventoNavigation.CodigoMunicipioNavigation == null) return "";
else
return this.idEventoNavigation.CodigoMunicipioNavigation.CodigoProvinciaNavigation.Nombre;
}
}
[NotMapped]
public string PoblacionEvento
{
get
{
if (this.idEvento == null || this.idEventoNavigation.CodigoMunicipioNavigation == null) return "";
else
return this.idEventoNavigation.CodigoMunicipioNavigation.Nombre;
}
}
[NotMapped]
public string DireccionEvento
{
get
{
if (this.idEvento == null) return "";
else
return this.idEventoNavigation.DireccionCompleta;
}
}
#endregion
public static void GuardandoCambios(bdGrupoSanchoToro.dbcontext.GrupoSanchoToroContext bd, string Aplicacion, bool SuperUsuario = false)
{
//try
//{
// var bdtmp = tscGrupoSanchoToro.NuevoContexto();
// var os = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Serialize };
// var fras = bd.ChangeTracker.Entries().Where(x => x.State == Microsoft.EntityFrameworkCore.EntityState.Modified && x.Metadata.GetTableName() == "facturas");
// foreach (var e in fras)
// {
// var f = (facturas)e.Entity;
// var reant = bdtmp.facturas.First(x => x.idFactura == f.idFactura);
// var lr = bdGrupoSanchoToro.db.logs.GeneraLog(bdtmp, "FACTURAS", Aplicacion, reant.idFactura, null, "REGISTRO_COMPLETO", JsonConvert.SerializeObject(reant, os), SuperUsuario);
// foreach (var it in f.detallesfacturas)
// {
// bdGrupoSanchoToro.db.logs.GeneraLog(bdtmp, "DETALLESFACTURAS", Aplicacion, reant.idFactura, lr, "REGISTRO_COMPLETO", JsonConvert.SerializeObject(it, os), SuperUsuario);
// }
// foreach (var it in f.movimientoscaja)
// {
// bdGrupoSanchoToro.db.logs.GeneraLog(bdtmp, "MOVIMIENTOSCAJA", Aplicacion, reant.idFactura, lr, "REGISTRO_COMPLETO", JsonConvert.SerializeObject(it, os), SuperUsuario);
// }
// foreach (var it in f.documentosfacturas)
// {
// bdGrupoSanchoToro.db.logs.GeneraLog(bdtmp, "DOCUMENTOSFACTURAS", Aplicacion, reant.idFactura, lr, "REGISTRO_COMPLETO", JsonConvert.SerializeObject(reant, os), SuperUsuario);
// }
// }
//}
//catch (Exception ex)
//{
// Debug.WriteLine(ex.Message);
//}
}
}
}

View File

@@ -0,0 +1,91 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.CompilerServices;
namespace bdGrupoSanchoToro.db
{
[NotMapped]
public partial class facturasrecibidas:INotifyPropertyChanged
{
[NotMapped]
public virtual int NumeroDocumentos
{
get
{
return this.documentosfacturasrecibidas.Count();
}
}
[NotMapped]
public virtual int? idProveedor_Nulable
{
get
{
if (this.idProveedor == 0)
{
return default;
}
else
{
return this.idProveedor;
}
}
set
{
if (value.HasValue)
{
this.idProveedor = value.Value;
}
this.OnPropertyChanged("idProveedor_Nulable");
}
}
[NotMapped]
public virtual double ImportePendiente
{
get
{
return Math.Round(this.TotalFactura - this.ImportePagado, 2, MidpointRounding.AwayFromZero);
}
}
private string _FicheroAdjuntoTMP;
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string name = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
[NotMapped]
public virtual string FicheroAdjuntoTMP
{
get
{
if (this.idFicheroNavigation is not null)
{
_FicheroAdjuntoTMP = this.idFicheroNavigation.NombreFichero;
return _FicheroAdjuntoTMP;
}
else
{
return "";
}
}
set
{
if (string.IsNullOrEmpty(value))
{
if (this.idFicheroNavigation is not null)
{
this.idFicheroNavigation = null;
}
}
_FicheroAdjuntoTMP = value;
this.OnPropertyChanged("FicheroAdjuntoTMP");
}
}
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
namespace bdGrupoSanchoToro.db
{
public partial class fiestas
{
public static List<DateOnly> ListadoFiestas;
}
}

View File

@@ -0,0 +1,13 @@

namespace bdGrupoSanchoToro.db
{
public partial class formulas
{
public enum TipoFormulaEnum : int
{
CÁLCULO_POR_PRODUCTO = 0,
CÁLCULO_POR_BLOQUE = 1
}
}
}

View File

@@ -0,0 +1,26 @@
namespace bdGrupoSanchoToro.db
{
public partial class logs
{
public static int GeneraLog(tscGrupoSanchoToro bd, string Tabla , string aplicacion, int id, int? idrelacionado, string Tipo, string Log, bool SuperUsuario)
{
var nl = new logs();
nl.Aplicacion = aplicacion;
nl.Tabla = Tabla;
nl.Log = Log;
nl.id = id;
nl.idRelacionado = idrelacionado;
nl.ip = bd.ip;
nl.FechaHora= tsEFCore8.Extensiones.DbContextExtensions.AhoraMySql(bd);
nl.Tipo = Tipo;
nl.Usuario = bdGrupoSanchoToro.db.Utilidades.Usuario;
nl.idTimeStamp = (double)DateTime.Now.Ticks;
nl.VersionPrograma = bdGrupoSanchoToro.db.Utilidades.VersionPrograma;
nl.SuperUsuario = SuperUsuario;
bd.logs.Add(nl);
bd.SaveChanges();
return nl.idLog;
}
}
}

View File

@@ -0,0 +1,66 @@

using System.ComponentModel.DataAnnotations.Schema;
namespace bdGrupoSanchoToro.db
{
public partial class movimientosbancarios
{
private bool? _Conciliado;
[NotMapped]
public virtual bool Conciliado
{
get
{
if (_Conciliado.HasValue)
{
return (bool)_Conciliado;
}
else if (ConciliacionActual_TMP is not null)
{
if (ConciliacionActual_TMP.idConciliacion is var arg1 && this.idConciliacion is { } arg2 && arg1 != arg2)
{
return false;
}
else
{
return this.idConciliacion.HasValue;
}
}
else
{
return this.idConciliacion.HasValue;
}
}
set
{
_Conciliado = value;
if (value)
{
this.idConciliacionNavigation = ConciliacionActual_TMP;
}
else
{
this.idConciliacion = default(int?);
}
}
}
[NotMapped] public virtual conciliacionesbancarias? ConciliacionActual_TMP { get; set; }
public string ConciliadoEn
{
get
{
if ((bool)(ConciliacionActual_TMP is not null && this.idConciliacion.HasValue && (ConciliacionActual_TMP.idConciliacion is var arg3 && this.idConciliacion is { } arg4 ? arg4 != arg3 : (bool?)null).GetValueOrDefault()))
{
return "Nº Conc.: " + this.idConciliacion + " (" + this.idConciliacionNavigation.Anno.ToString() + "-" + this.idConciliacionNavigation.Mes.ToString() + ")";
}
else
{
return "";
}
}
}
}
}

View File

@@ -0,0 +1,492 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class movimientoscaja:INotifyPropertyChanged
{
public string FacturaYFecha
{
get
{
if (this.idFacturaNavigation is not null)
{
return this.idFacturaNavigation.NumeroFactura + " (" + this.idFacturaNavigation.FechaFactura.ToString("dd-MM-yyyy") + ")";
}
else
{
return "";
}
}
}
public DateTime? FechaCierre
{
get
{
if (this.idMovimientoCierreNavigation is not null)
{
return this.idMovimientoCierreNavigation.Fecha;
}
else
{
return default;
}
}
}
public string Impresion
{
get
{
switch ((TipoMovimientoEnum)this.Tipo)
{
case TipoMovimientoEnum.RECIBO_CLIENTE:
{
return "Imprimir Recibo";
}
case TipoMovimientoEnum.CIERRE_CAJA:
{
return "Imprimir Cierre";
}
default:
{
return "";
}
}
}
}
public string Clase
{
get
{
switch ((TipoMovimientoEnum)this.Tipo)
{
case TipoMovimientoEnum.RECIBO_CLIENTE:
{
if (this.idFacturaNavigation is null)
{
return "*DESCONOCIDO*";
}
else if (this.idFacturaNavigation.TotalIVA != 0d)
{
return "A";
}
else
{
return "B";
}
}
case TipoMovimientoEnum.FIANZA:
{
return "A";
}
case TipoMovimientoEnum.RECIBO_PROVEEDOR:
{
return "A";
}
case TipoMovimientoEnum.OTROS_GASTOS_O_INGRESOS:
{
return "B";
}
case TipoMovimientoEnum.CIERRE_CAJA:
{
return "CIERRE CAJA";
}
case TipoMovimientoEnum.REGULARIZACION_CAJA:
{
return "REGULARIZACION_CAJA"; // TipoMovimientoEnum.TRASPASO_DE_OTRA_CAJA
}
default:
{
return "TRASPASOS";
}
}
}
}
[NotMapped]
public virtual double ImporteNegativo
{
get
{
return this.Importe * (double)-1;
}
set
{
this.Importe = value * -1;
}
}
[NotMapped]
public string RazonSocial
{
get
{
if (this.idFactura.HasValue)
{
return this.idFacturaNavigation.idClienteNavigation.RazonSocial;
}
else if (this.idFacturaRecibida.HasValue)
{
return this.idFacturaRecibidaNavigation.idProveedorNavigation.RazonSocial;
}
else
{
return "";
}
}
}
[NotMapped]
public virtual int? idEntidad
{
get
{
if (this.idFactura.HasValue)
{
return this.idFacturaNavigation.idCliente;
}
else if (this.idFacturaRecibida.HasValue)
{
return this.idFacturaRecibidaNavigation.idProveedor;
}
else
{
return default;
}
}
}
[NotMapped]
public virtual string ReferenciaDocumento
{
get
{
if (this.idFactura.HasValue)
{
return !string.IsNullOrEmpty(this.idFacturaNavigation.NumeroFactura.NothingAVacio()) ? this.idFacturaNavigation.NumeroFactura : this.idFacturaNavigation.idFactura.ToString();
}
else if (this.idFacturaRecibida.HasValue)
{
return this.idFacturaRecibidaNavigation.NumeroFactura;
}
else
{
return "";
}
}
}
[NotMapped]
public virtual DateOnly? FechaDocumento
{
get
{
if (this.idFactura.HasValue)
{
return this.idFacturaNavigation.FechaFactura;
}
else if (this.idFacturaRecibida.HasValue)
{
return this.idFacturaRecibidaNavigation.FechaFactura;
}
else
{
return default;
}
}
}
[NotMapped]
public virtual string DescripcionTipoMovimiento
{
get
{
TipoMovimientoEnum tip = (TipoMovimientoEnum)this.Tipo;
return tip.ToString().Replace("_", " ");
}
}
[NotMapped]
public virtual int? idCaja_Nulable
{
get
{
if (this.idCaja == 0)
{
return default;
}
else
{
return this.idCaja;
}
}
set
{
if (value.HasValue)
{
this.idCaja = value.Value;
}
this.OnPropertyChanged("idCaja_Nulable");
}
}
[NotMapped]
public virtual ICollection<movimientoscaja> MovimientosDelCierre
{
get
{
return this.InverseidMovimientoCierreNavigation;
}
}
[NotMapped]
public virtual string ClienteOProveedor
{
get
{
switch ((TipoMovimientoEnum)this.Tipo)
{
case TipoMovimientoEnum.RECIBO_CLIENTE:
{
return this.idFacturaNavigation.idClienteNavigation.RazonSocial;
}
case TipoMovimientoEnum.RECIBO_PROVEEDOR:
{
return this.idFacturaRecibidaNavigation.idProveedorNavigation.RazonSocial;
}
default:
{
return "";
}
}
}
}
[NotMapped]
public virtual string Descripcion
{
get
{
switch ((TipoMovimientoEnum)this.Tipo)
{
case TipoMovimientoEnum.RECIBO_CLIENTE:
{
return "Recibo a " + this.idFacturaNavigation.idClienteNavigation.RazonSocial + " Nº " + this.NumeroRecibo;
}
case TipoMovimientoEnum.RECIBO_PROVEEDOR:
{
return "Pago a " + this.idFacturaRecibidaNavigation.idProveedorNavigation.RazonSocial + " Fra: " + this.idFacturaRecibidaNavigation.NumeroFactura;
}
case TipoMovimientoEnum.OTROS_GASTOS_O_INGRESOS:
{
if (this.Importe > 0d)
{
return "Ingreso: " + this.Observaciones;
}
else
{
return "Gasto: " + this.Observaciones;
}
}
case TipoMovimientoEnum.REGULARIZACION_CAJA:
{
return "Regularización de Caja"; // TipoMovimientoEnum.TRASPASO_DE_OTRA_CAJA
}
default:
{
return this.Observaciones;
}
}
}
}
[NotMapped]
public virtual double ImporteCerrado
{
get
{
return this.InverseidMovimientoCierreNavigation.Sum(x => x.Importe);
}
}
[NotMapped]
public virtual double SaldoDespuesCierre
{
get
{
return this.SaldoAntesCierre + ImporteCerrado;
}
}
[NotMapped]
public virtual double ImporteEntradasMovimientosCerrados
{
get
{
return this.InverseidMovimientoCierreNavigation.Where(x => x.Importe > 0d).Sum(x => x.Importe);
}
}
[NotMapped]
public virtual double ImporteSalidasMovimientosCerrados
{
get
{
return this.InverseidMovimientoCierreNavigation.Where(x => x.Importe < 0d).Sum(x => x.Importe) * -1;
}
}
[NotMapped]
public virtual string NumeroReciboTMP
{
get
{
if (this.idMovimiento == 0)
{
return "« AUTOMÁTICO »";
}
else if (string.IsNullOrEmpty(this.NumeroRecibo.NothingAVacio()))
{
return this.idMovimiento.ToString();
}
else
{
return this.NumeroRecibo;
}
}
}
public void EstableceNumeroRecibo()
{
if (string.IsNullOrEmpty(this.NumeroRecibo.NothingAVacio()))
{
var ur = this.idFacturaNavigation.movimientoscaja.ToList().Where(x => x.NumeroRecibo.NothingAVacio().Contains(".")).OrderByDescending(x => x.NumeroRecibo).FirstOrDefault();
int NuevoRec = 1;
if (ur is not null)
NuevoRec = Conversions.ToInteger(ur.NumeroRecibo.Split('.')[1]) + 1;
this.NumeroRecibo = this.idFacturaNavigation.NumeroFactura + "." + NuevoRec.ToString().PadLeft(3, '0');
}
}
[NotMapped]
public virtual DateTime? FechaConciliacion
{
get
{
if (this.idConciliacionNavigation is not null)
{
return this.Fecha;
}
else
{
return default;
}
}
}
private bool? _Conciliado;
[ NotMapped]public virtual bool Conciliado
{
get
{
if (_Conciliado.HasValue)
{
return (bool)_Conciliado;
}
else if (ConciliacionActual_TMP is not null)
{
if (ConciliacionActual_TMP.idConciliacion is var arg1 && this.idConciliacion is { } arg2 && arg1 != arg2)
{
return false;
}
else
{
return this.idConciliacion.HasValue;
}
}
else
{
return this.idConciliacion.HasValue;
}
}
set
{
_Conciliado = value;
if (value)
{
this.idConciliacionNavigation = ConciliacionActual_TMP;
}
else
{
this.idConciliacion = default(int?);
}
}
}
[NotMapped] public virtual conciliacionesbancarias ConciliacionActual_TMP { get; set; }
// Public ReadOnly Property ConciliadoEn As String
// Get
// If ConciliacionActual_TMP IsNot Nothing AndAlso Me.idConciliacion.HasValue AndAlso Me.idConciliacion <> ConciliacionActual_TMP.idConciliacion Then
// Return "Nº Conc.: " & Me.idConciliacion & " (" & Me.conciliacionesbancarias.Año.ToString & "-" & Me.conciliacionesbancarias.Mes.ToString & ")"
// Else
// Return ""
// End If
// End Get
// End Property
private string _FicheroAdjuntoTMP;
public event PropertyChangedEventHandler? PropertyChanged;
[NotMapped] public virtual string FicheroAdjuntoTMP
{
get
{
if (this.idFicheroNavigation is not null)
{
_FicheroAdjuntoTMP = this.idFicheroNavigation.NombreFichero;
return _FicheroAdjuntoTMP;
}
else
{
return "";
}
}
set
{
if (string.IsNullOrEmpty(value))
{
if (this.idFicheroNavigation is not null)
{
this.idFicheroNavigation = null;
}
}
_FicheroAdjuntoTMP = value;
this.OnPropertyChanged("FicheroAdjuntoTMP");
}
}
protected void OnPropertyChanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
public enum TipoMovimientoEnum
{
RECIBO_CLIENTE = 0,
FIANZA = 1,
RECIBO_PROVEEDOR = 2,
TRASPASO_CAJA = 3,
OTROS_GASTOS_O_INGRESOS = 4,
REGULARIZACION_CAJA = 8,
CIERRE_CAJA = 9
}
}

View File

@@ -0,0 +1,252 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class municipios
{
public provincias? provincias
{
get
{
return this.CodigoProvinciaNavigation;
}
}
public static List<municipios> ListaPoblaciones { get; set; }
public string PoblacionYProvincia
{
get
{
try
{
if ((this.Nombre ?? "") == (this.provincias.Nombre ?? ""))
{
return this.Nombre;
}
else
{
return this.Nombre + " (" + this.provincias.Nombre + ")";
}
}
catch (Exception ex)
{
return "";
}
}
}
public static string ObtienePoblacion(string CodigoPoblacion)
{
if (ListaPoblaciones is null)
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
ListaPoblaciones = bd.municipios.Include(x=> x.CodigoProvinciaNavigation).ToList();
}
if (ListaPoblaciones.Any(x => (x.CodigoMunicipio ?? "") == (CodigoPoblacion ?? "")))
{
return ListaPoblaciones.First(x => (x.CodigoMunicipio ?? "") == (CodigoPoblacion ?? "")).Nombre;
}
else
{
return "";
}
}
public static string ObtieneProvincia(string CodigoPoblacion)
{
if (ListaPoblaciones is null)
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
ListaPoblaciones = bd.municipios.Include(x => x.CodigoProvinciaNavigation).ToList();
}
if (ListaPoblaciones.Any(x => (x.CodigoMunicipio ?? "") == (CodigoPoblacion ?? "")))
{
return ListaPoblaciones.First(x => (x.CodigoMunicipio ?? "") == (CodigoPoblacion ?? "")).provincias.Nombre;
}
else
{
return "";
}
}
public static List<municipios> ObtieneListaPoblaciones()
{
if (ListaPoblaciones is null)
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
ListaPoblaciones = bd.municipios.Include(x => x.CodigoProvinciaNavigation).OrderBy(x => x.Nombre).ToList();
}
return ListaPoblaciones;
}
public static string ObtieneCodigoMunicipioMasCoincidente( tscGrupoSanchoToro bd, string CodigoPostal, string Poblacion)
{
try
{
if (Poblacion.NothingAVacio() == "")
return "";
else
{
var municipios = bd.codigospostales.Where(x => x.CodigoPostal == CodigoPostal & x.CodigoMunicipioNavigation.Nombre == Poblacion).ToList();
if (municipios.Count == 1)
return municipios[0].CodigoMunicipio;
else if (CodigoPostal.Length == 5)
{
string codigoprovincia = CodigoPostal.Substring(0, 2);
municipios = bd.municipios.Where(x => x.CodigoProvincia == codigoprovincia).SelectMany(x => x.codigospostales).ToList();
int IndiceMasCoincidente = 0;
int Puntuacion = 0;
if (municipios.Count == 0)
return "";
else
for (var i = 0; i <= municipios.Count - 1; i++)
{
// Dim Porcentaje As Double = 0
int puntuaciontmp = ComparaPalabras(municipios[i].CodigoMunicipioNavigation.Nombre, Poblacion);
if (i == 0 || Puntuacion < puntuaciontmp)
{
IndiceMasCoincidente = i;
Puntuacion = puntuaciontmp;
}
}
if (Puntuacion == 100)
{
CrearNuevoCodigoPostal(CodigoPostal, municipios[IndiceMasCoincidente].CodigoMunicipio);
return municipios[IndiceMasCoincidente].CodigoMunicipio;
}
else
return CrearNuevoMunicipio(CodigoPostal, Poblacion);
}
else
return "";
}
}
catch (Exception EX)
{
throw new Exception(EX.Message, EX);
}
}
public static string ObtieneCodigoMunicipioMasCoincidente(tscGrupoSanchoToro bd,List<codigospostales> CodigosPostales, List<municipios> LMunicipios, string CodigoPostal, string Poblacion)
{
try
{
List<codigospostales> municipios = bd.codigospostales.Where(x => x.CodigoPostal == CodigoPostal).ToList();
if (municipios.Count == 1)
return municipios[0].CodigoMunicipio;
else
{
if (municipios.Count == 0 && CodigoPostal.Length == 5)
{
var codigoprovincia = CodigoPostal.Substring(0, 2);
municipios = LMunicipios.Where(x => x.CodigoProvincia == codigoprovincia).SelectMany(x => x.codigospostales).ToList();
}
if (bd.codigospostales.Any(x => x.CodigoPostal == CodigoPostal & x.CodigoMunicipioNavigation.Nombre == Poblacion))
return CodigosPostales.First(x => x.CodigoPostal == CodigoPostal & x.CodigoMunicipioNavigation.Nombre == Poblacion).CodigoMunicipio;
else
{
int IndiceMasCoincidente = 0;
int Puntuacion = 0;
if (municipios.Count == 0)
return "";
else
for (var i = 0; i <= municipios.Count - 1; i++)
{
var puntuaciontmp = ComparaPalabras(municipios[i].CodigoMunicipioNavigation.Nombre, Poblacion);
if (i == 0 || Puntuacion < puntuaciontmp)
{
IndiceMasCoincidente = i;
Puntuacion = puntuaciontmp;
}
}
if (Puntuacion > 49)
return municipios[IndiceMasCoincidente].CodigoMunicipio;
else
return CrearNuevoMunicipio(CodigoPostal, Poblacion);
}
}
}
catch (Exception EX)
{
throw new Exception(EX.Message, EX);
}
}
private static string CrearNuevoMunicipio(string CodigoPostal, string Municipio)
{
if (Municipio.NothingAVacio() == "")
return "";
else
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
// municipios nm = new municipios();
string codpro = CodigoPostal.Substring(0, 2);
municipios ultmun = bd.municipios.Where(x => x.CodigoProvincia == codpro).OrderByDescending(x => x.CodigoMunicipio).First();
char Letra;
int Numero = 0;
if ("0123456789".Contains(ultmun.CodigoMunicipio.Substring(2, 1)))
{
Letra = 'A';
Numero = 0;
}
else
{
Letra = char.Parse(ultmun.CodigoMunicipio.Substring(2, 1));
Numero = int.Parse(ultmun.CodigoMunicipio.Substring(3)) + 1;
if (Numero > 99)
{
Letra = Strings.ChrW(Strings.AscW(Letra) + 1);
Numero = 0;
}
}
string Nombre = Municipio;
string CodigoMunicipio = codpro + Letra + Numero.ToString().PadLeft(2, char.Parse("0"));
int rmun = bd.Database.ExecuteSqlRaw("INSERT INTO municipios (`CodigoMunicipio`, `CodigoProvincia`, `Nombre`) VALUES ('" + codpro + "','" + CodigoMunicipio + "','" + Nombre + "')");
int rcp = bd.Database.ExecuteSqlRaw("INSERT INTO codigospostales (`CodigoMunicipio`, `CodigoPostal`) VALUES ('" + CodigoMunicipio + "','" + CodigoPostal +"')");
return CodigoMunicipio;
}
}
private static void CrearNuevoCodigoPostal(string CodigoPostal, string CodigoMunicipio)
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
if (bd.codigospostales.Any(x => x.CodigoMunicipio == CodigoMunicipio & x.CodigoPostal == CodigoPostal) == false)
{
int rcp = bd.Database.ExecuteSqlRaw("INSERT INTO codigospostales (`CodigoMunicipio`, `CodigoPostal`, `Nombre`) VALUES ('" + CodigoMunicipio + "','" + CodigoPostal + "')");
}
}
private static int ComparaPalabras(string Cadena1, string Cadena2)
{
try
{
Cadena1 = Cadena1.ToLower().Replace("á", "a").Replace("é", "e").Replace("í", "i").Replace("ó", "o").Replace("ú", "u").Replace("Ñ", "ñ").Replace("(", " ").Replace(")", " ").Replace("\"", "").Replace("-", " ").Replace(",",string.Empty).Trim();
Cadena2 = Cadena2.ToLower().Replace("á", "a").Replace("é", "e").Replace("í", "i").Replace("ó", "o").Replace("ú", "u").Replace("Ñ", "ñ").Replace("(", " ").Replace(")", " ").Replace("\"", "").Replace("-", " ").Replace(",", string.Empty).Trim();
var Cadenas1 = Cadena1.Split(" ").Where(X => X != "");
var Cadenas2 = Cadena2.Split(" ").Where(X => X != "");
int Coincidente = 0;
foreach (var c in Cadenas1)
{
if (Cadenas2.Contains(c))
Coincidente += 1;
}
foreach (var c in Cadenas2)
{
if (Cadenas1.Contains(c))
Coincidente += 1;
}
return (Coincidente * 100 / (int)(Cadenas1.Count() + Cadenas2.Count()));
}
// Return Coincidente
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Linq;
using System.Runtime.CompilerServices;
namespace bdGrupoSanchoToro.db
{
public partial class productos
{
[NotMapped]
public bool Descatalogado
{
get
{
return this.FechaBaja.HasValue;
}
set
{
if (value)
{
if (this.FechaBaja.HasValue == false)
this.FechaBaja = DateTime.Now;
}
else
{
this.FechaBaja = default(DateTime?);
}
}
}
[NotMapped]
public string DescripcionTipo
{
get
{
return ((TipoProductoEnum)this.Tipo).ToString().Replace("_", " ");
}
}
public enum TipoProductoEnum
{
PRODUCTO = 0,
SERVICIO = 1
}
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Data;
using System.Linq;
namespace bdGrupoSanchoToro.db
{
public partial class seriesfacturas
{
public string DescripcionTipo
{
get
{
return ((TipoSerieFacturaEnum)this.Tipo).ToString().Replace("_", " ");
}
}
public enum TipoSerieFacturaEnum
{
AUTOMÁTICA_CON_AÑO = 0,
AUTOMÁTICA_SIN_AÑO = 1,
EMITIDA_POR_CLIENTE = 2,
}
}
}

View File

@@ -0,0 +1,31 @@

namespace bdGrupoSanchoToro.db
{
public partial class stocks
{
public string Almacen
{
get
{
return this.idAlmacenNavigation.Descripcion;
}
}
public string TipoAlmacen
{
get
{
return this.idAlmacenNavigation.DescripcionTipo;
}
}
public string Producto
{
get
{
return this.idProductoNavigation.Descripcion;
}
}
}
}

View File

@@ -0,0 +1 @@
dotnet ef dbcontext optimize --context tscGrupoSanchoToro --output-dir CompiledModels --verbose