2026/07/01-01
This commit is contained in:
@@ -39,7 +39,7 @@ namespace ServicioGrupoSanchoToro
|
||||
string Mensaje = "Servicio GrupoSanchoToro Iniciado. Versi<73>n: " + tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version");
|
||||
try
|
||||
{
|
||||
bdGrupoSanchoToro.Importaciones.ImportarTodo.ImportarPersonal(GeneraLogErrores);
|
||||
bdGrupoSanchoToro.Importaciones.ImportarTodo.Importar(GeneraLogErrores);
|
||||
|
||||
return;
|
||||
|
||||
@@ -96,6 +96,11 @@ namespace ServicioGrupoSanchoToro
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void GeneraLogErrores(Exception ex)
|
||||
{
|
||||
Logs.A<EFBFBD>adeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,145 +1,108 @@
|
||||
using Microsoft.VisualBasic;
|
||||
using bdGrupoSanchoToro.db;
|
||||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bdGrupoSanchoToro.Importaciones
|
||||
{
|
||||
public class ImportaAccesorios
|
||||
public class ImportaGRUASGC
|
||||
{
|
||||
public static void Importar(byte[] Fichero)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bd = tscGrupoSanchoToro.NuevoContexto();
|
||||
var accs = bd.accesorios.ToList();
|
||||
var le = bd.enumeraciones.ToList();
|
||||
|
||||
var prodsela = bd.productoselaborados.ToList();
|
||||
var gruprods = bd.gruposdeproductos.ToList();
|
||||
var lcaag = bd.codigosdeaccesoriosagrupados.ToList();
|
||||
var lusus = bd.usuarios.ToList();
|
||||
|
||||
var dsprueba = new XSD.ALMACENAC();
|
||||
var dsprueba = new XSD.GRUASGC();
|
||||
|
||||
dsprueba.ReadXml(new System.IO.MemoryStream(Fichero));
|
||||
int i = 1;
|
||||
int Ultimalinea = dsprueba.Tables["Datos"].Rows.Count;
|
||||
foreach (XSD.ALMACENAC.DatosRow Proant in dsprueba.Tables["Datos"].Rows)
|
||||
List<modelosgruas> lg = bd.modelosgruas.ToList();
|
||||
var lm = bd.marcasgruas.ToList();
|
||||
var lv = bd.versionesgruas.ToList();
|
||||
var grs = dsprueba.Tables["Datos"].Rows.Cast<XSD.GRUASGC.DatosRow>().ToList().OrderBy(x=> OrdenGRUASGC(x)).ToList();
|
||||
|
||||
foreach (XSD.GRUASGC.DatosRow gr in grs)
|
||||
{
|
||||
try
|
||||
{
|
||||
bdGrupoSanchoToro.db.accesorios Pronue =accs.FirstOrDefault(x => x.CodigoDeAccesorio == Proant.ALCOD.Trim());
|
||||
if (Pronue==null)
|
||||
productos pr;
|
||||
var mar = lm.First(x => x.Marca == gr.CGMAR);
|
||||
bdGrupoSanchoToro.db.modelosgruas n = lg.FirstOrDefault(x => x.idMarcaNavigation.Marca == mar.Marca && x.Modelo == gr.CGMDL);
|
||||
if (n == null)
|
||||
{
|
||||
Pronue = new bdGrupoSanchoToro.db.accesorios();
|
||||
bd.accesorios.Add(Pronue);
|
||||
}
|
||||
Pronue.CodigoDeAccesorio = Proant.ALCOD;
|
||||
Pronue.DescripcionDeAccesorio = Proant.ALDES;
|
||||
Pronue.idGrupoDeProducto = null;
|
||||
if (Proant.ALGPR.Trim()!="")
|
||||
{
|
||||
var grupodeproducto = gruprods.FirstOrDefault(x => x.CodigoGrupoProductos == Proant.ALGPR.Trim());
|
||||
if (grupodeproducto!=null) Pronue.idGrupoDeProducto = grupodeproducto.idGrupoDeProducto;
|
||||
}
|
||||
Pronue.idProductoElaborado = null;
|
||||
if (Proant.ALCPEC.Trim()!="")
|
||||
{
|
||||
var productoelaborado =prodsela.FirstOrDefault(x => x.CodigoDeProductoElaborado == Proant.ALCPEC.Trim());
|
||||
if (productoelaborado!=null) Pronue.idProductoElaborado = productoelaborado.idProductoElaborado;
|
||||
}
|
||||
Pronue.idExpresionDeCantidad = null;
|
||||
if (Proant.ALECAN.Trim()!="")
|
||||
{
|
||||
Pronue.idExpresionDeCantidad = le.First(x => x.Codigo == "ECAN." + Proant.ALECAN.Trim()).idEnumeracion;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pronue.idExpresionDeCantidad = null;
|
||||
}
|
||||
|
||||
var enumeracion = le.First(x => x.Codigo == "TAC." + Proant.ALTIPO.Trim());
|
||||
Pronue.idTipoDeAccesorio = enumeracion.idEnumeracion;
|
||||
|
||||
Pronue.idSubtipoDeAccesorio = le.First(x => x.Codigo.Trim() == "STA." + Proant.ALSTIP.Trim()).idEnumeracion;
|
||||
|
||||
Pronue.idCodigoAgrupado = null;
|
||||
if (Proant.ALCODAG.Trim()!="")
|
||||
{
|
||||
var Codagru = lcaag.FirstOrDefault(x => x.CodigoAgrupado == Proant.ALCODAG.Trim());
|
||||
if (Codagru!=null) Pronue.idCodigoAgrupado = Codagru.idCodigoDeaccesorioAgrupado;
|
||||
}
|
||||
Pronue.RangoPermitido1 = double.Parse(Proant.ALRANGO1, CultureInfo.InvariantCulture);
|
||||
Pronue.RangoPermitido2 = double.Parse(Proant.ALRANGO2, CultureInfo.InvariantCulture);
|
||||
Pronue.Facturable = false;
|
||||
if (Proant.ALFAC.Trim() == "S")
|
||||
{
|
||||
Pronue.Facturable = true;
|
||||
}
|
||||
Pronue.Precio = double.Parse(Proant.ALPRE, CultureInfo.InvariantCulture);
|
||||
Pronue.PrecioDeCosteMedio = double.Parse(Proant.ALPCM, CultureInfo.InvariantCulture);
|
||||
Pronue.Existencia = double.Parse(Proant.ALEXI, CultureInfo.InvariantCulture);
|
||||
Pronue.ExistenciaMinima = double.Parse(Proant.ALEXIM, CultureInfo.InvariantCulture);
|
||||
Pronue.Peso = double.Parse(Proant.ALPESO, CultureInfo.InvariantCulture);
|
||||
Pronue.PrecioDeCosteAplicado = double.Parse(Proant.ALPCOA, CultureInfo.InvariantCulture);
|
||||
Pronue.CuentaDeCompras1 = Proant.ALNCUC1;
|
||||
Pronue.CuentaDeCompras2 = Proant.ALNCUC2;
|
||||
Pronue.CuentaDeCompras3 = Proant.ALNCUC3;
|
||||
Pronue.CuentaDeCompras4 = Proant.ALNCUC4;
|
||||
Pronue.CuentaDeVentas1 = Proant.ALNCUV1;
|
||||
Pronue.CuentaDeVentas2 = Proant.ALNCUV2;
|
||||
Pronue.CuentaDeVentas3 = Proant.ALNCUV3;
|
||||
Pronue.CuentaDeVentas4 = Proant.ALNCUV4;
|
||||
//if (bd.cuentasanaliticas.Any(x => x.CodigoCuenta.Trim() == Proant.ALNCUA.Trim()))
|
||||
//{
|
||||
// var Cuenta = bd.cuentasanaliticas.First(x => x.CodigoCuenta == Proant.ALNCUA.Trim());
|
||||
// Pronue.idCuentaAnalitica = 0; // cuentasanaliticas.idcuentasanaliticas
|
||||
//}
|
||||
Pronue.FechaDeAlta = (DateOnly)tsUtilidades.Extensiones.StringExtensions.FechaStringADateOnly(Proant.ALFAL);
|
||||
Pronue.FechaDeBaja = tsUtilidades.Extensiones.StringExtensions.FechaStringADateOnly(Proant.ALFBA);
|
||||
|
||||
Pronue.idGrupoDeAccesorios = le.First(x => x.Codigo == "GRA." + Proant.ALGRU.Trim()).idEnumeracion;
|
||||
|
||||
Pronue.idNaturalezaDelGasto = le.First(x => x.Codigo == "NGA." + Proant.ALNGA.Trim()).idEnumeracion;
|
||||
Pronue.Subvencion = false;
|
||||
if (Proant.ALSSN.Trim() == "S")
|
||||
{
|
||||
Pronue.Subvencion = true;
|
||||
}
|
||||
Pronue.PorcentajedeSubvencion = double.Parse(Proant.ALSPO, CultureInfo.InvariantCulture);
|
||||
Pronue.ReferenciaDelProveedor = Proant.ALSLA;
|
||||
Pronue.idTipoDeIva = null;
|
||||
if (Proant.ALTIVA.Trim()!="")
|
||||
{
|
||||
Pronue.idTipoDeIva = le.First(x => x.Codigo == "TIVA." + Proant.ALTIVA.Trim()).idEnumeracion;
|
||||
}
|
||||
Pronue.FechaUltimoRecuento = tsUtilidades.Extensiones.StringExtensions.FechaStringADate(Proant.ALFURE);
|
||||
Pronue.ActualizacionExistencias = false;
|
||||
if (double.Parse(Proant.ALNL4) == 1)
|
||||
{
|
||||
Pronue.ActualizacionExistencias = true;
|
||||
}
|
||||
Pronue.idModificadoPor = null;
|
||||
if (Proant.ALUUM.Trim()!="")
|
||||
{
|
||||
var usuario = lusus.FirstOrDefault(x => x.Usuario == Proant.ALUUM.Trim());
|
||||
if(usuario!=null) Pronue.idModificadoPor = usuario.idUsuario;
|
||||
}
|
||||
string minuseg = (double.Parse(Proant.ALHUM, CultureInfo.InvariantCulture) * 100).ToString();
|
||||
var fechahora = tsUtilidades.Extensiones.StringExtensions.FechaHoraStringADateTime(Proant.ALFUM + "." + minuseg.PadLeft(4, '0').Substring(0, 4));
|
||||
Pronue.FechaUltimaModificacion = fechahora;
|
||||
Pronue.Situacion = Proant.ALSIT;
|
||||
Pronue.Observaciones = Proant.ALOBS;
|
||||
i = i + 1;
|
||||
if (i > 1000)
|
||||
{
|
||||
i=0;
|
||||
pr = new productos()
|
||||
{
|
||||
Codigo = "GR-" + gr.CGCOD,
|
||||
Descripcion = "GRÚA " + mar.Marca + " " + gr.CGMDL
|
||||
};
|
||||
bd.productos.Add(pr);
|
||||
n = new bdGrupoSanchoToro.db.modelosgruas();
|
||||
bd.modelosgruas.Add(n);
|
||||
n.idMarcaNavigation = mar;
|
||||
n.idProductoNavigation = pr;
|
||||
n.FechaAlta = DateTime.Now;
|
||||
bd.SaveChanges();
|
||||
bd = tscGrupoSanchoToro.NuevoContexto();
|
||||
}
|
||||
VersionesGruasEnum ver;
|
||||
if (gr.CGVER != "")
|
||||
{
|
||||
|
||||
switch (gr.CGVER)
|
||||
{
|
||||
case "APOYADA":
|
||||
{
|
||||
ver = VersionesGruasEnum.APOYADA;
|
||||
break;
|
||||
}
|
||||
case "EMPOTRADA":
|
||||
{
|
||||
ver = VersionesGruasEnum.EMPOTRADA;
|
||||
break;
|
||||
}
|
||||
case "TRASLACION":
|
||||
case "CON TRASLACION":
|
||||
{
|
||||
ver = VersionesGruasEnum.CON_TRASLACION;
|
||||
break;
|
||||
}
|
||||
case "AUTOMONTANTE":
|
||||
{
|
||||
ver = VersionesGruasEnum.AUTOMONTANTE;
|
||||
break;
|
||||
}
|
||||
case "MONOCOLUMNA":
|
||||
{
|
||||
ver = VersionesGruasEnum.MONOCOLUMNA;
|
||||
break;
|
||||
}
|
||||
case "BICOLUMNA":
|
||||
{
|
||||
ver = VersionesGruasEnum.BICOLUMNA;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ver = VersionesGruasEnum.EMPOTRADA;
|
||||
break;
|
||||
}
|
||||
var vg = lv.FirstOrDefault(x => x.idModeloNavigation.Modelo == gr.CGMDL && x.idModeloNavigation.idMarcaNavigation.Marca == gr.CGMAR && x.Version == (int)ver);
|
||||
if (vg != null)
|
||||
{
|
||||
vg = new versionesgruas()
|
||||
{
|
||||
Version = (int)ver,
|
||||
idModeloNavigation = n
|
||||
};
|
||||
bd.versionesgruas.Add(vg);
|
||||
lv.Add(vg);
|
||||
bd.SaveChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -154,6 +117,24 @@ namespace bdGrupoSanchoToro.Importaciones
|
||||
throw new Exception(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
internal static int OrdenGRUASGC(XSD.GRUASGC.DatosRow row)
|
||||
{
|
||||
if (row.CGTIP=="G")
|
||||
{
|
||||
if (row.CGVER=="")
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace bdGrupoSanchoToro.Importaciones
|
||||
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
|
||||
|
||||
//00
|
||||
// Importa("GRUASGC", bdGrupoSanchoToro.Importaciones.ImportarGRUASGC.Importar, de); //00
|
||||
Importa("GRUASGC", bdGrupoSanchoToro.Importaciones.ImportaGRUASGC.Importar, de); //00
|
||||
//Importa("GRUPRO", bdGrupoSanchoToro.Importaciones.ImportaGrupoProductos.Importar, de); //01
|
||||
//Importa("CAMPAÑAS", bdGrupoSanchoToro.Importaciones.ImportaCampañas.Importar, de); //02
|
||||
//Importa("PRODUCTOS", bdGrupoSanchoToro.Importaciones.ImportaProductos.Importar, de); //03
|
||||
@@ -88,7 +88,7 @@ namespace bdGrupoSanchoToro.Importaciones
|
||||
try
|
||||
{
|
||||
string sCadServidor = (from c in bd.enumeraciones
|
||||
where c.Codigo == "VAR.HP9000"
|
||||
where c.Codigo == "CONF.HP9000"
|
||||
select c).First().ValorAlfabeticoLargo;
|
||||
string Servidor = sCadServidor.Split("@")[0];
|
||||
string Usuario = sCadServidor.Split("@")[1].Split(":")[0];
|
||||
|
||||
1337
bdGrupoSanchoToro/XSD/DAT-GRUASGC.Designer.cs
generated
Normal file
1337
bdGrupoSanchoToro/XSD/DAT-GRUASGC.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
bdGrupoSanchoToro/XSD/DAT-GRUASGC.xsc
Normal file
1
bdGrupoSanchoToro/XSD/DAT-GRUASGC.xsc
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
33
bdGrupoSanchoToro/XSD/DAT-GRUASGC.xsd
Normal file
33
bdGrupoSanchoToro/XSD/DAT-GRUASGC.xsd
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema id="GRUASGC" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xs:element name="GRUASGC" msdata:IsDataSet="true" msdata:Locale="en-US">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="Datos">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CGCOD" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGDES" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGTIP" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGMAR" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGMDL" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGMDG" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGVER" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGEXP" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGFAL" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGFBA" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGFIA" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGFFA" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGNL1" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGNL2" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGNL3" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGNL4" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGSIT" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="CGOBS" type="xs:string" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
1
bdGrupoSanchoToro/XSD/DAT-GRUASGC.xss
Normal file
1
bdGrupoSanchoToro/XSD/DAT-GRUASGC.xss
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -35,4 +35,19 @@
|
||||
<None Include="Importaciones\ImportaGRUASGC.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="XSD\DAT-GRUASGC.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>DAT-GRUASGC.xsd</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="XSD\DAT-GRUASGC.xsd">
|
||||
<Generator>MSDataSetGenerator</Generator>
|
||||
<LastGenOutput>DAT-GRUASGC.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
29
bdGrupoSanchoToro/db/familias.cs
Normal file
29
bdGrupoSanchoToro/db/familias.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace bdGrupoSanchoToro.db;
|
||||
|
||||
[AddINotifyPropertyChangedInterface]
|
||||
public partial class familias
|
||||
{
|
||||
public int idFamilia { get; set; }
|
||||
|
||||
public string? Codigo { get; set; }
|
||||
|
||||
public string? Descripcion { get; set; }
|
||||
|
||||
public int? idUsuario { get; set; }
|
||||
|
||||
public string? CuentaContableVenta { get; set; }
|
||||
|
||||
public string? CuentaContableVentaAlquiler { get; set; }
|
||||
|
||||
public string? CuentaContableCompra { get; set; }
|
||||
|
||||
public string? CuentaContableCompraAlquiler { get; set; }
|
||||
|
||||
public virtual usuarios? idUsuarioNavigation { get; set; }
|
||||
|
||||
public virtual ICollection<productos> productos { get; set; } = new List<productos>();
|
||||
}
|
||||
@@ -25,5 +25,5 @@ public partial class modelosgruas
|
||||
|
||||
public virtual ICollection<tablaplumas> tablaplumas { get; set; } = new List<tablaplumas>();
|
||||
|
||||
public virtual ICollection<versiones> versiones { get; set; } = new List<versiones>();
|
||||
public virtual ICollection<versionesgruas> versionesgruas { get; set; } = new List<versionesgruas>();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ public partial class productos
|
||||
{
|
||||
public int idProducto { get; set; }
|
||||
|
||||
public string Codigo { get; set; } = null!;
|
||||
|
||||
public string? DescripcionAbreviada { get; set; }
|
||||
|
||||
public string Descripcion { get; set; } = null!;
|
||||
@@ -89,6 +91,8 @@ public partial class productos
|
||||
|
||||
public virtual empresas idEmpresaNavigation { get; set; } = null!;
|
||||
|
||||
public virtual familias? idFamiliaNavigation { get; set; }
|
||||
|
||||
public virtual usuarios? idUsuarioCreadorNavigation { get; set; }
|
||||
|
||||
public virtual usuarios? idUsuarioModificadorNavigation { get; set; }
|
||||
|
||||
@@ -19,5 +19,5 @@ public partial class tablaalturas
|
||||
|
||||
public virtual modelosgruas idModeloNavigation { get; set; } = null!;
|
||||
|
||||
public virtual versiones? idVersionNavigation { get; set; }
|
||||
public virtual versionesgruas? idVersionNavigation { get; set; }
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ public partial class usuarios
|
||||
|
||||
public virtual ICollection<facturasrecibidas> facturasrecibidas { get; set; } = new List<facturasrecibidas>();
|
||||
|
||||
public virtual ICollection<familias> familias { get; set; } = new List<familias>();
|
||||
|
||||
public virtual gruposusuarios? idGrupoNavigation { get; set; }
|
||||
|
||||
public virtual enumeraciones? idTemaNavigation { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using PropertyChanged;
|
||||
namespace bdGrupoSanchoToro.db;
|
||||
|
||||
[AddINotifyPropertyChangedInterface]
|
||||
public partial class versiones
|
||||
public partial class versionesgruas
|
||||
{
|
||||
public int idVersion { get; set; }
|
||||
|
||||
@@ -84,6 +84,8 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
|
||||
public virtual DbSet<facturasrecibidas> facturasrecibidas { get; set; }
|
||||
|
||||
public virtual DbSet<familias> familias { get; set; }
|
||||
|
||||
public virtual DbSet<ficheros> ficheros { get; set; }
|
||||
|
||||
public virtual DbSet<ficherosadjuntos> ficherosadjuntos { get; set; }
|
||||
@@ -142,7 +144,7 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
|
||||
public virtual DbSet<v_albaranesextendidos> v_albaranesextendidos { get; set; }
|
||||
|
||||
public virtual DbSet<versiones> versiones { get; set; }
|
||||
public virtual DbSet<versionesgruas> versionesgruas { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -1518,6 +1520,28 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
.HasConstraintName("facturasrecibidas_usuarios");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<familias>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idFamilia).HasName("PRIMARY");
|
||||
|
||||
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.idUsuario, "familias_usuarios_idx");
|
||||
|
||||
entity.Property(e => e.Codigo).HasMaxLength(10);
|
||||
entity.Property(e => e.CuentaContableCompra).HasMaxLength(10);
|
||||
entity.Property(e => e.CuentaContableCompraAlquiler).HasMaxLength(10);
|
||||
entity.Property(e => e.CuentaContableVenta).HasMaxLength(10);
|
||||
entity.Property(e => e.CuentaContableVentaAlquiler).HasMaxLength(10);
|
||||
entity.Property(e => e.Descripcion).HasMaxLength(45);
|
||||
|
||||
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.familias)
|
||||
.HasForeignKey(d => d.idUsuario)
|
||||
.HasConstraintName("familias_usuarios");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ficheros>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idFichero).HasName("PRIMARY");
|
||||
@@ -2051,6 +2075,8 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
{
|
||||
entity.HasKey(e => e.idProducto).HasName("PRIMARY");
|
||||
|
||||
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.idUsuarioCreador, "productos_01_usuarios_idx");
|
||||
@@ -2061,6 +2087,7 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
|
||||
entity.HasIndex(e => e.idFamilia, "productos_familias_idx");
|
||||
|
||||
entity.Property(e => e.Codigo).HasMaxLength(40);
|
||||
entity.Property(e => e.CodigoBarras).HasMaxLength(16);
|
||||
entity.Property(e => e.ControlarEnAlbaran).HasMaxLength(2);
|
||||
entity.Property(e => e.CorrespondenciaPatas).HasMaxLength(45);
|
||||
@@ -2088,6 +2115,10 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
.HasForeignKey(d => d.idEmpresa)
|
||||
.HasConstraintName("productos_empresas");
|
||||
|
||||
entity.HasOne(d => d.idFamiliaNavigation).WithMany(p => p.productos)
|
||||
.HasForeignKey(d => d.idFamilia)
|
||||
.HasConstraintName("productos_familias");
|
||||
|
||||
entity.HasOne(d => d.idUsuarioCreadorNavigation).WithMany(p => p.productosidUsuarioCreadorNavigation)
|
||||
.HasForeignKey(d => d.idUsuarioCreador)
|
||||
.OnDelete(DeleteBehavior.SetNull)
|
||||
@@ -2409,7 +2440,7 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
entity.Property(e => e.idEvento).HasDefaultValueSql("'0'");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<versiones>(entity =>
|
||||
modelBuilder.Entity<versionesgruas>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.idVersion).HasName("PRIMARY");
|
||||
|
||||
@@ -2420,7 +2451,7 @@ public partial class GrupoSanchoToroContext : DbContext
|
||||
entity.Property(e => e.idVersion).ValueGeneratedNever();
|
||||
entity.Property(e => e.Observaciones).HasMaxLength(50);
|
||||
|
||||
entity.HasOne(d => d.idModeloNavigation).WithMany(p => p.versiones)
|
||||
entity.HasOne(d => d.idModeloNavigation).WithMany(p => p.versionesgruas)
|
||||
.HasForeignKey(d => d.idModelo)
|
||||
.HasConstraintName("versiones_modelosgruas");
|
||||
});
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace bdGrupoSanchoToro.dbcontext
|
||||
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 VPN", 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" });
|
||||
@@ -65,21 +66,21 @@ namespace bdGrupoSanchoToro.dbcontext
|
||||
|
||||
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;
|
||||
// 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=" + cn.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
|
||||
|
||||
@@ -159,6 +159,10 @@
|
||||
"Name": "facturasrecibidas",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "familias",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "ficheros",
|
||||
"ObjectType": 0
|
||||
@@ -272,7 +276,7 @@
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "versiones",
|
||||
"Name": "versionesgruas",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
|
||||
@@ -32,14 +32,14 @@ namespace bdGrupoSanchoToro.db
|
||||
}
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
public string DescripcionTipo
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((TipoProductoEnum)this.Tipo).ToString().Replace("_", " ");
|
||||
}
|
||||
}
|
||||
// [NotMapped]
|
||||
//public string DescripcionTipo
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return ((TipoProductoEnum)this.Tipo).ToString().Replace("_", " ");
|
||||
// }
|
||||
//}
|
||||
|
||||
public enum TipoProductoEnum
|
||||
{
|
||||
|
||||
22
bdGrupoSanchoToro/extensiones/versionesgruas.cs
Normal file
22
bdGrupoSanchoToro/extensiones/versionesgruas.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bdGrupoSanchoToro.db
|
||||
{
|
||||
public partial class versionesgruas
|
||||
{
|
||||
|
||||
}
|
||||
public enum VersionesGruasEnum
|
||||
{
|
||||
APOYADA = 1,
|
||||
AUTOMONTANTE = 2,
|
||||
BICOLUMNA = 3,
|
||||
EMPOTRADA = 4,
|
||||
MONOCOLUMNA = 5,
|
||||
CON_TRASLACION = 6
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user