Actualzar dev #6

Merged
fede merged 19 commits from main into dev 2024-11-05 00:37:42 -03:00
28 changed files with 600 additions and 2854 deletions
Showing only changes of commit 13ea698572 - Show all commits

View File

@@ -1,484 +0,0 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace Entidades;
public partial class AlquilaFacilContext : DbContext
{
public AlquilaFacilContext()
{
}
public AlquilaFacilContext(DbContextOptions<AlquilaFacilContext> options)
: base(options)
{
}
public virtual DbSet<Canon> Canons { get; set; }
public virtual DbSet<Contrato> Contratos { get; set; }
public virtual DbSet<Defecto> Defectos { get; set; }
public virtual DbSet<Garante> Garantia { get; set; }
public virtual DbSet<Grupo> Grupos { get; set; }
public virtual DbSet<Inquilino> Inquilinos { get; set; }
public virtual DbSet<Propiedad> Propiedades { get; set; }
public virtual DbSet<Propietario> Propietarios { get; set; }
public virtual DbSet<Recibo> Recibos { get; set; }
public virtual DbSet<Rol> Rols { get; set; }
public virtual DbSet<Servicio> Servicios { get; set; }
public virtual DbSet<ServicioPropiedade> ServicioPropiedades { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
//#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 https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseSqlServer("Server=fedesrv.ddns.net,1433;Database=AlquilaFacil;User Id=AlquilaFacil;Password=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Trusted_Connection=False;Encrypt=False;Connection Timeout=5;\n");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Canon>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__CANON__3214EC27DAD9CBBD");
entity.ToTable("CANON");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Idrecibo).HasColumnName("IDRECIBO");
entity.Property(e => e.Mes).HasColumnName("MES");
entity.Property(e => e.Monto)
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
entity.Property(e => e.Pagado).HasColumnName("PAGADO");
entity.HasOne(d => d.IdreciboNavigation).WithMany(p => p.Canons)
.HasForeignKey(d => d.Idrecibo)
.HasConstraintName("FK__CANON__IDRECIBO__540C7B00");
});
modelBuilder.Entity<Contrato>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__CONTRATO__3214EC27314E1A88");
entity.ToTable("CONTRATO");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Dniinquilino).HasColumnName("DNIINQUILINO");
entity.Property(e => e.Dnipropietario).HasColumnName("DNIPROPIETARIO");
entity.Property(e => e.Duracionmeses).HasColumnName("DURACIONMESES");
entity.Property(e => e.Fechainicio)
.HasColumnType("datetime")
.HasColumnName("FECHAINICIO");
entity.Property(e => e.Idpropiedad).HasColumnName("IDPROPIEDAD");
entity.Property(e => e.Indiceactualizacion)
.HasColumnType("decimal(12, 2)")
.HasColumnName("INDICEACTUALIZACION");
entity.Property(e => e.Monto)
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
entity.HasOne(d => d.DniinquilinoNavigation).WithMany(p => p.Contratos)
.HasForeignKey(d => d.Dniinquilino)
.HasConstraintName("FK__CONTRATO__DNIINQ__01142BA1");
entity.HasOne(d => d.DnipropietarioNavigation).WithMany(p => p.Contratos)
.HasForeignKey(d => d.Dnipropietario)
.HasConstraintName("FK__CONTRATO__DNIPRO__02084FDA");
entity.HasOne(d => d.IdpropiedadNavigation).WithMany(p => p.Contratos)
.HasForeignKey(d => d.Idpropiedad)
.HasConstraintName("FK__CONTRATO__IDPROP__02FC7413");
entity.HasMany(d => d.Dnigarantia).WithMany(p => p.Idcontratos)
.UsingEntity<Dictionary<string, object>>(
"ContratoGarantium",
r => r.HasOne<Garante>().WithMany()
.HasForeignKey("Dnigarantia")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__CONTRATO___DNIGA__282DF8C2"),
l => l.HasOne<Contrato>().WithMany()
.HasForeignKey("Idcontrato")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__CONTRATO___IDCON__2739D489"),
j =>
{
j.HasKey("Idcontrato", "Dnigarantia").HasName("PK__CONTRATO__08D9A618A2AF4EE5");
j.ToTable("CONTRATO_GARANTIA");
j.IndexerProperty<int>("Idcontrato").HasColumnName("IDCONTRATO");
j.IndexerProperty<long>("Dnigarantia").HasColumnName("DNIGARANTIA");
});
entity.HasMany(d => d.Idcanons).WithMany(p => p.Idcontratos)
.UsingEntity<Dictionary<string, object>>(
"ContratoCanon",
r => r.HasOne<Canon>().WithMany()
.HasForeignKey("Idcanon")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__CONTRATO___IDCAN__3493CFA7"),
l => l.HasOne<Contrato>().WithMany()
.HasForeignKey("Idcontrato")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__CONTRATO___IDCON__339FAB6E"),
j =>
{
j.HasKey("Idcontrato", "Idcanon").HasName("PK__CONTRATO__EAB1D189E5C1886B");
j.ToTable("CONTRATO_CANON");
j.IndexerProperty<int>("Idcontrato").HasColumnName("IDCONTRATO");
j.IndexerProperty<int>("Idcanon").HasColumnName("IDCANON");
});
entity.HasMany(d => d.Iddefectos).WithMany(p => p.Idcontratos)
.UsingEntity<Dictionary<string, object>>(
"ContratoDefecto",
r => r.HasOne<Defecto>().WithMany()
.HasForeignKey("Iddefecto")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__CONTRATO___IDDEF__2BFE89A6"),
l => l.HasOne<Contrato>().WithMany()
.HasForeignKey("Idcontrato")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__CONTRATO___IDCON__2B0A656D"),
j =>
{
j.HasKey("Idcontrato", "Iddefecto").HasName("PK__CONTRATO__3A449B2F445D3682");
j.ToTable("CONTRATO_DEFECTO");
j.IndexerProperty<int>("Idcontrato").HasColumnName("IDCONTRATO");
j.IndexerProperty<int>("Iddefecto").HasColumnName("IDDEFECTO");
});
});
modelBuilder.Entity<Defecto>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__DEFECTO__3214EC27E043B726");
entity.ToTable("DEFECTO");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Costo)
.HasColumnType("decimal(12, 2)")
.HasColumnName("COSTO");
entity.Property(e => e.Descripcion)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("DESCRIPCION");
entity.Property(e => e.Estaarreglado).HasColumnName("ESTAARREGLADO");
entity.Property(e => e.Pagainquilino).HasColumnName("PAGAINQUILINO");
});
modelBuilder.Entity<Garante>(entity =>
{
entity.HasKey(e => e.Dni).HasName("PK__GARANTIA__C035B8DC8E6BAB11");
entity.ToTable("GARANTIA");
entity.HasIndex(e => e.Email, "UQ__GARANTIA__161CF724C0013CA1").IsUnique();
entity.HasIndex(e => e.Celular, "UQ__GARANTIA__6758673E51796017").IsUnique();
entity.HasIndex(e => e.Cuil, "UQ__GARANTIA__F46C15900DA7BBE1").IsUnique();
entity.Property(e => e.Dni).HasColumnName("DNI")
.ValueGeneratedNever();
entity.Property(e => e.Apellido)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("APELLIDO");
entity.Property(e => e.Celular)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("CELULAR");
entity.Property(e => e.Contrasena)
.HasMaxLength(64)
.HasColumnName("CONTRASENA");
entity.Property(e => e.Cuil).HasColumnName("CUIL");
entity.Property(e => e.Domicilio)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("DOMICILIO");
entity.Property(e => e.Domiciliolaboral)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("DOMICILIOLABORAL");
entity.Property(e => e.Email)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("EMAIL");
entity.Property(e => e.Lugartrabajo)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("LUGARTRABAJO");
entity.Property(e => e.Nombre)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("NOMBRE");
});
modelBuilder.Entity<Grupo>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__GRUPO__3214EC2778FB625D");
entity.ToTable("GRUPO");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Nombre)
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnName("NOMBRE");
entity.HasMany(d => d.Dnigarantia).WithMany(p => p.Idgrupos)
.UsingEntity<Dictionary<string, object>>(
"GrupoGarantium",
r => r.HasOne<Garante>().WithMany()
.HasForeignKey("Dnigarantia")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_GAR__DNIGA__46B27FE2"),
l => l.HasOne<Grupo>().WithMany()
.HasForeignKey("Idgrupo")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_GAR__IDGRU__45BE5BA9"),
j =>
{
j.HasKey("Idgrupo", "Dnigarantia").HasName("PK__GRUPO_GA__F9F1F0A3A5F02DDF");
j.ToTable("GRUPO_GARANTIA");
j.IndexerProperty<int>("Idgrupo").HasColumnName("IDGRUPO");
j.IndexerProperty<long>("Dnigarantia").HasColumnName("DNIGARANTIA");
});
entity.HasMany(d => d.Dniinquilinos).WithMany(p => p.Idgrupos)
.UsingEntity<Dictionary<string, object>>(
"GrupoInquilino",
r => r.HasOne<Inquilino>().WithMany()
.HasForeignKey("Dniinquilino")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_INQ__DNIIN__40058253"),
l => l.HasOne<Grupo>().WithMany()
.HasForeignKey("Idgrupo")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_INQ__IDGRU__3F115E1A"),
j =>
{
j.HasKey("Idgrupo", "Dniinquilino").HasName("PK__GRUPO_IN__FC8CB8C5DC668E46");
j.ToTable("GRUPO_INQUILINO");
j.IndexerProperty<int>("Idgrupo").HasColumnName("IDGRUPO");
j.IndexerProperty<long>("Dniinquilino").HasColumnName("DNIINQUILINO");
});
entity.HasMany(d => d.Dnipropietarios).WithMany(p => p.Idgrupos)
.UsingEntity<Dictionary<string, object>>(
"GrupoPropietario",
r => r.HasOne<Propietario>().WithMany()
.HasForeignKey("Dnipropietario")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_PRO__DNIPR__4A8310C6"),
l => l.HasOne<Grupo>().WithMany()
.HasForeignKey("Idgrupo")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_PRO__IDGRU__498EEC8D"),
j =>
{
j.HasKey("Idgrupo", "Dnipropietario").HasName("PK__GRUPO_PR__D5806AB6196637D1");
j.ToTable("GRUPO_PROPIETARIO");
j.IndexerProperty<int>("Idgrupo").HasColumnName("IDGRUPO");
j.IndexerProperty<long>("Dnipropietario").HasColumnName("DNIPROPIETARIO");
});
entity.HasMany(d => d.Idrols).WithMany(p => p.Idgrupos)
.UsingEntity<Dictionary<string, object>>(
"GrupoRol",
r => r.HasOne<Rol>().WithMany()
.HasForeignKey("Idrol")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_ROL__IDROL__3C34F16F"),
l => l.HasOne<Grupo>().WithMany()
.HasForeignKey("Idgrupo")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__GRUPO_ROL__IDGRU__3B40CD36"),
j =>
{
j.HasKey("Idgrupo", "Idrol").HasName("PK__GRUPO_RO__5035D4A88EFB1AF1");
j.ToTable("GRUPO_ROL");
j.IndexerProperty<int>("Idgrupo").HasColumnName("IDGRUPO");
j.IndexerProperty<int>("Idrol").HasColumnName("IDROL");
});
});
modelBuilder.Entity<Inquilino>(entity =>
{
entity.HasKey(e => e.Dni).HasName("PK__INQUILIN__C035B8DC051D254F");
entity.ToTable("INQUILINO");
entity.HasIndex(e => e.Email, "UQ__INQUILIN__161CF724192A8FBF").IsUnique();
entity.HasIndex(e => e.Celular, "UQ__INQUILIN__6758673EB3CC90D6").IsUnique();
entity.HasIndex(e => e.Cuil, "UQ__INQUILIN__F46C1590EF9A325E").IsUnique();
entity.Property(e => e.Dni).HasColumnName("DNI")
.ValueGeneratedNever();
entity.Property(e => e.Apellido)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("APELLIDO");
entity.Property(e => e.Celular)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("CELULAR");
entity.Property(e => e.Contrasena)
.HasMaxLength(64)
.HasColumnName("CONTRASENA");
entity.Property(e => e.Cuil).HasColumnName("CUIL");
entity.Property(e => e.Domicilio)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("DOMICILIO");
entity.Property(e => e.Email)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("EMAIL");
entity.Property(e => e.Nombre)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("NOMBRE");
});
modelBuilder.Entity<Propiedad>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__PROPIEDA__3214EC2739D8661A");
entity.ToTable("PROPIEDADES");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Canthabitaciones).HasColumnName("CANTHABITACIONES");
entity.Property(e => e.Dni).HasColumnName("DNI");
entity.Property(e => e.Letra)
.HasMaxLength(2)
.IsUnicode(false)
.HasColumnName("LETRA");
entity.Property(e => e.Piso).HasColumnName("PISO");
entity.Property(e => e.Tienecocina).HasColumnName("TIENECOCINA");
entity.Property(e => e.Ubicacion)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("UBICACION");
entity.HasOne(d => d.DniNavigation).WithMany(p => p.Propiedades)
.HasForeignKey(d => d.Dni)
.HasConstraintName("FK__PROPIEDADES__DNI__44FF419A");
});
modelBuilder.Entity<Propietario>(entity =>
{
entity.HasKey(e => e.Dni).HasName("PK__PROPIETA__C035B8DC136518F4");
entity.ToTable("PROPIETARIO");
entity.HasIndex(e => e.Email, "UQ__PROPIETA__161CF7246E3AA1B6").IsUnique();
entity.HasIndex(e => e.Celular, "UQ__PROPIETA__6758673E211BCB21").IsUnique();
entity.HasIndex(e => e.Cuil, "UQ__PROPIETA__F46C15901A8D2463").IsUnique();
entity.Property(e => e.Dni).HasColumnName("DNI")
.ValueGeneratedNever();
entity.Property(e => e.Apellido)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("APELLIDO");
entity.Property(e => e.Celular)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("CELULAR");
entity.Property(e => e.Contrasena)
.HasMaxLength(64)
.HasColumnName("CONTRASENA");
entity.Property(e => e.Cuil).HasColumnName("CUIL");
entity.Property(e => e.Domicilio)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("DOMICILIO");
entity.Property(e => e.Email)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("EMAIL");
entity.Property(e => e.Nombre)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("NOMBRE");
});
modelBuilder.Entity<Recibo>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__RECIBO__3214EC277135BC90");
entity.ToTable("RECIBO");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Mes).HasColumnName("MES");
entity.Property(e => e.Monto)
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
});
modelBuilder.Entity<Rol>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__ROL__3214EC27DE6A34BE");
entity.ToTable("ROL");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Descipcion)
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnName("DESCIPCION");
});
modelBuilder.Entity<Servicio>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__SERVICIO__3214EC27468ADAA2");
entity.ToTable("SERVICIO");
entity.HasIndex(e => e.Descripcion, "UQ__SERVICIO__794449EF1A4F44FF").IsUnique();
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Descripcion)
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnName("DESCRIPCION");
});
modelBuilder.Entity<ServicioPropiedade>(entity =>
{
entity
.HasNoKey()
.ToTable("SERVICIO_PROPIEDADES");
entity.Property(e => e.Idpropiedad).HasColumnName("IDPROPIEDAD");
entity.Property(e => e.Idservicio).HasColumnName("IDSERVICIO");
entity.HasOne(d => d.IdpropiedadNavigation).WithMany()
.HasForeignKey(d => d.Idpropiedad)
.HasConstraintName("FK__SERVICIO___IDPRO__49C3F6B7");
entity.HasOne(d => d.IdservicioNavigation).WithMany()
.HasForeignKey(d => d.Idservicio)
.HasConstraintName("FK__SERVICIO___IDSER__4AB81AF0");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@@ -0,0 +1,375 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace Entidades;
public partial class AlquilaFacilContext : DbContext
{
public AlquilaFacilContext()
{
}
public AlquilaFacilContext(DbContextOptions<AlquilaFacilContext> options)
: base(options)
{
}
public virtual DbSet<Canon> Canons { get; set; }
public virtual DbSet<Cliente> Clientes { get; set; }
public virtual DbSet<Contrato> Contratos { get; set; }
public virtual DbSet<Defecto> Defectos { get; set; }
public virtual DbSet<Estadodefecto> Estadodefectos { get; set; }
public virtual DbSet<Estadoventum> Estadoventa { get; set; }
public virtual DbSet<Garante> Garantes { get; set; }
public virtual DbSet<Grupo> Grupos { get; set; }
public virtual DbSet<Permiso> Permisos { get; set; }
public virtual DbSet<Propiedade> Propiedades { get; set; }
public virtual DbSet<Recibo> Recibos { get; set; }
public virtual DbSet<Usuario> Usuarios { get; set; }
public virtual DbSet<Venta> Ventas { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#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 https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseMySQL("Server=fedesrv.ddns.net;Port=30006;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Canon>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.ToTable("Canon");
entity.HasIndex(e => e.idrecibo, "FK_CAN_REC");
entity.Property(e => e.id).HasColumnType("bigint(20)");
entity.Property(e => e.fecha).HasColumnType("date");
entity.Property(e => e.idrecibo).HasColumnType("bigint(20)");
entity.Property(e => e.monto).HasPrecision(12);
entity.Property(e => e.pagado).HasColumnType("bit(1)");
entity.HasOne(d => d.idreciboNavigation).WithMany(p => p.Canons)
.HasForeignKey(d => d.idrecibo)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CAN_REC");
});
modelBuilder.Entity<Cliente>(entity =>
{
entity.HasKey(e => e.dni).HasName("PRIMARY");
entity.HasIndex(e => e.idusuario, "FK_PROP_USU");
entity.Property(e => e.dni).HasColumnType("bigint(20)");
entity.Property(e => e.apellido).HasMaxLength(20);
entity.Property(e => e.celular).HasMaxLength(40);
entity.Property(e => e.domicilio).HasMaxLength(40);
entity.Property(e => e.idusuario).HasColumnType("int(11)");
entity.Property(e => e.nombre).HasMaxLength(20);
entity.HasOne(d => d.idusuarioNavigation).WithMany(p => p.Clientes)
.HasForeignKey(d => d.idusuario)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_PROP_USU");
});
modelBuilder.Entity<Contrato>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.HasIndex(e => e.dniinquilino, "FK_CON_INQ");
entity.HasIndex(e => e.idpropiedad, "FK_CON_PROP");
entity.HasIndex(e => e.dnipropietario, "FK_CON_PROPI");
entity.HasIndex(e => e.idventa, "FK_CON_VEN");
entity.Property(e => e.id).HasColumnType("bigint(20)");
entity.Property(e => e.cantgarantemin).HasColumnType("int(11)");
entity.Property(e => e.dniinquilino).HasColumnType("bigint(20)");
entity.Property(e => e.dnipropietario).HasColumnType("bigint(20)");
entity.Property(e => e.fechainicio).HasColumnType("date");
entity.Property(e => e.idpropiedad).HasColumnType("int(11)");
entity.Property(e => e.idventa).HasColumnType("bigint(20)");
entity.Property(e => e.indiceactualizacion).HasPrecision(8);
entity.Property(e => e.monto).HasPrecision(12);
entity.Property(e => e.tieneopcionventa).HasColumnType("bit(1)");
entity.HasOne(d => d.dniinquilinoNavigation).WithMany(p => p.ContratodniinquilinoNavigations)
.HasForeignKey(d => d.dniinquilino)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CON_INQ");
entity.HasOne(d => d.dnipropietarioNavigation).WithMany(p => p.ContratodnipropietarioNavigations)
.HasForeignKey(d => d.dnipropietario)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CON_PROPI");
entity.HasOne(d => d.idpropiedadNavigation).WithMany(p => p.Contratos)
.HasForeignKey(d => d.idpropiedad)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CON_PROP");
entity.HasOne(d => d.idventaNavigation).WithMany(p => p.Contratos)
.HasForeignKey(d => d.idventa)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CON_VEN");
entity.HasMany(d => d.idcanons).WithMany(p => p.idcontratos)
.UsingEntity<Dictionary<string, object>>(
"contrato_canon",
r => r.HasOne<Canon>().WithMany()
.HasForeignKey("idcanon")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CONCAN_CAN"),
l => l.HasOne<Contrato>().WithMany()
.HasForeignKey("idcontrato")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CONCAN_CON"),
j =>
{
j.HasKey("idcontrato", "idcanon").HasName("PRIMARY");
j.ToTable("contrato_canon");
j.HasIndex(new[] { "idcanon" }, "FK_CONCAN_CAN");
j.IndexerProperty<long>("idcontrato").HasColumnType("bigint(20)");
j.IndexerProperty<long>("idcanon").HasColumnType("bigint(20)");
});
});
modelBuilder.Entity<Defecto>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.ToTable("Defecto");
entity.HasIndex(e => e.idcontrato, "FK_DEF_CON");
entity.HasIndex(e => e.idestado, "FK_DEF_EST");
entity.Property(e => e.id).HasColumnType("bigint(20)");
entity.Property(e => e.costo).HasPrecision(12);
entity.Property(e => e.descripcion).HasMaxLength(40);
entity.Property(e => e.idcontrato).HasColumnType("bigint(20)");
entity.Property(e => e.idestado).HasColumnType("int(11)");
entity.Property(e => e.pagainquilino).HasColumnType("bit(1)");
entity.HasOne(d => d.idcontratoNavigation).WithMany(p => p.Defectos)
.HasForeignKey(d => d.idcontrato)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_DEF_CON");
entity.HasOne(d => d.idestadoNavigation).WithMany(p => p.Defectos)
.HasForeignKey(d => d.idestado)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_DEF_EST");
});
modelBuilder.Entity<Estadodefecto>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.ToTable("Estadodefecto");
entity.Property(e => e.id).HasColumnType("int(11)");
entity.Property(e => e.descipcion).HasMaxLength(20);
});
modelBuilder.Entity<Estadoventum>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.Property(e => e.id).HasColumnType("int(11)");
entity.Property(e => e.descripcion).HasMaxLength(15);
});
modelBuilder.Entity<Garante>(entity =>
{
entity.HasKey(e => e.dni).HasName("PRIMARY");
entity.Property(e => e.dni).HasColumnType("bigint(20)");
entity.Property(e => e.apellido).HasMaxLength(20);
entity.Property(e => e.celular).HasMaxLength(40);
entity.Property(e => e.domicilio).HasMaxLength(40);
entity.Property(e => e.domiciliolaboral).HasMaxLength(40);
entity.Property(e => e.nombre).HasMaxLength(20);
entity.HasMany(d => d.idcontratos).WithMany(p => p.dnigarantes)
.UsingEntity<Dictionary<string, object>>(
"contrato_garante",
r => r.HasOne<Contrato>().WithMany()
.HasForeignKey("idcontrato")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CONGAR_CON"),
l => l.HasOne<Garante>().WithMany()
.HasForeignKey("dnigarante")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_CONGAR_GAR"),
j =>
{
j.HasKey("dnigarante", "idcontrato").HasName("PRIMARY");
j.ToTable("contrato_garantes");
j.HasIndex(new[] { "idcontrato" }, "FK_CONGAR_CON");
j.IndexerProperty<long>("dnigarante").HasColumnType("bigint(20)");
j.IndexerProperty<long>("idcontrato").HasColumnType("bigint(20)");
});
});
modelBuilder.Entity<Grupo>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.Property(e => e.id).HasColumnType("int(11)");
entity.Property(e => e.nombre).HasMaxLength(12);
});
modelBuilder.Entity<Permiso>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.Property(e => e.id).HasColumnType("int(11)");
entity.Property(e => e.descripcion).HasMaxLength(15);
entity.HasMany(d => d.idgrupos).WithMany(p => p.idpermisos)
.UsingEntity<Dictionary<string, object>>(
"grupo_Permiso",
r => r.HasOne<Grupo>().WithMany()
.HasForeignKey("idgrupo")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_GRU2"),
l => l.HasOne<Permiso>().WithMany()
.HasForeignKey("idpermiso")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_PER2"),
j =>
{
j.HasKey("idpermiso", "idgrupo").HasName("PRIMARY");
j.ToTable("grupo_Permisos");
j.HasIndex(new[] { "idgrupo" }, "FK_GRU2");
j.IndexerProperty<int>("idpermiso").HasColumnType("int(11)");
j.IndexerProperty<int>("idgrupo").HasColumnType("int(11)");
});
});
modelBuilder.Entity<Propiedade>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.HasIndex(e => e.dnipropietario, "FK_PROP_PROPI");
entity.Property(e => e.id).HasColumnType("int(11)");
entity.Property(e => e.canthabitaciones).HasColumnType("int(11)");
entity.Property(e => e.dnipropietario).HasColumnType("bigint(20)");
entity.Property(e => e.letra)
.HasMaxLength(1)
.IsFixedLength();
entity.Property(e => e.piso).HasColumnType("int(11)");
entity.Property(e => e.ubicacion).HasMaxLength(40);
entity.HasOne(d => d.dnipropietarioNavigation).WithMany(p => p.Propiedades)
.HasForeignKey(d => d.dnipropietario)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_PROP_PROPI");
});
modelBuilder.Entity<Recibo>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.ToTable("Recibo");
entity.Property(e => e.id).HasColumnType("bigint(20)");
entity.Property(e => e.fecha).HasColumnType("date");
entity.Property(e => e.monto).HasPrecision(12);
});
modelBuilder.Entity<Usuario>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.Property(e => e.id).HasColumnType("int(11)");
entity.Property(e => e.contraseña).HasMaxLength(128);
entity.Property(e => e.email).HasMaxLength(50);
entity.Property(e => e.token).HasColumnType("json");
entity.HasMany(d => d.idgrupos).WithMany(p => p.idusuarios)
.UsingEntity<Dictionary<string, object>>(
"usuario_Grupo",
r => r.HasOne<Grupo>().WithMany()
.HasForeignKey("idgrupo")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_GRU"),
l => l.HasOne<Usuario>().WithMany()
.HasForeignKey("idusuario")
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_USU"),
j =>
{
j.HasKey("idusuario", "idgrupo").HasName("PRIMARY");
j.ToTable("usuario_Grupos");
j.HasIndex(new[] { "idgrupo" }, "FK_GRU");
j.IndexerProperty<int>("idusuario").HasColumnType("int(11)");
j.IndexerProperty<int>("idgrupo").HasColumnType("int(11)");
});
});
modelBuilder.Entity<Venta>(entity =>
{
entity.HasKey(e => e.id).HasName("PRIMARY");
entity.HasIndex(e => e.idestado, "FK_VEN_EST");
entity.HasIndex(e => e.idprop_old, "FK_VEN_PROL");
entity.HasIndex(e => e.idprop_new, "FK_VEN_PRON");
entity.HasIndex(e => e.idpropiedad, "FK_VEN_PROP");
entity.Property(e => e.id).HasColumnType("bigint(20)");
entity.Property(e => e.fechafinal).HasColumnType("date");
entity.Property(e => e.fechainicio).HasColumnType("date");
entity.Property(e => e.idestado).HasColumnType("int(11)");
entity.Property(e => e.idprop_new).HasColumnType("bigint(20)");
entity.Property(e => e.idprop_old).HasColumnType("bigint(20)");
entity.Property(e => e.idpropiedad).HasColumnType("int(11)");
entity.Property(e => e.monto).HasPrecision(12);
entity.HasOne(d => d.idestadoNavigation).WithMany(p => p.Venta)
.HasForeignKey(d => d.idestado)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_VEN_EST");
entity.HasOne(d => d.idprop_newNavigation).WithMany(p => p.Ventaidprop_newNavigations)
.HasForeignKey(d => d.idprop_new)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_VEN_PRON");
entity.HasOne(d => d.idprop_oldNavigation).WithMany(p => p.Ventaidprop_oldNavigations)
.HasForeignKey(d => d.idprop_old)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_VEN_PROL");
entity.HasOne(d => d.idpropiedadNavigation).WithMany(p => p.Venta)
.HasForeignKey(d => d.idpropiedad)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_VEN_PROP");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@@ -5,17 +5,17 @@ namespace Entidades;
public partial class Canon
{
public int Id { get; set; }
public long id { get; set; }
public int Mes { get; set; }
public DateTime fecha { get; set; }
public decimal Monto { get; set; }
public decimal monto { get; set; }
public bool Pagado { get; set; }
public long? idrecibo { get; set; }
public int? Idrecibo { get; set; }
public ulong pagado { get; set; }
public virtual Recibo? IdreciboNavigation { get; set; }
public virtual Recibo? idreciboNavigation { get; set; }
public virtual ICollection<Contrato> Idcontratos { get; set; } = new List<Contrato>();
public virtual ICollection<Contrato> idcontratos { get; set; } = new List<Contrato>();
}

31
Entidades/Cliente.cs Normal file
View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Cliente
{
public long dni { get; set; }
public string nombre { get; set; } = null!;
public string apellido { get; set; } = null!;
public string domicilio { get; set; } = null!;
public string celular { get; set; } = null!;
public int? idusuario { get; set; }
public virtual ICollection<Contrato> ContratodniinquilinoNavigations { get; set; } = new List<Contrato>();
public virtual ICollection<Contrato> ContratodnipropietarioNavigations { get; set; } = new List<Contrato>();
public virtual ICollection<Propiedade> Propiedades { get; set; } = new List<Propiedade>();
public virtual ICollection<Venta> Ventaidprop_newNavigations { get; set; } = new List<Venta>();
public virtual ICollection<Venta> Ventaidprop_oldNavigations { get; set; } = new List<Venta>();
public virtual Usuario? idusuarioNavigation { get; set; }
}

View File

@@ -5,31 +5,37 @@ namespace Entidades;
public partial class Contrato
{
public int Id { get; set; }
public long id { get; set; }
public DateTime Fechainicio { get; set; }
public DateTime fechainicio { get; set; }
public decimal Indiceactualizacion { get; set; }
public decimal indiceactualizacion { get; set; }
public decimal Monto { get; set; }
public decimal monto { get; set; }
public int Duracionmeses { get; set; }
public long? dniinquilino { get; set; }
public long? Dniinquilino { get; set; }
public long? dnipropietario { get; set; }
public long? Dnipropietario { get; set; }
public int? idpropiedad { get; set; }
public int? Idpropiedad { get; set; }
public int cantgarantemin { get; set; }
public virtual Inquilino? DniinquilinoNavigation { get; set; }
public ulong tieneopcionventa { get; set; }
public virtual Propietario? DnipropietarioNavigation { get; set; }
public long? idventa { get; set; }
public virtual Propiedad? IdpropiedadNavigation { get; set; }
public virtual ICollection<Defecto> Defectos { get; set; } = new List<Defecto>();
public virtual ICollection<Garante> Dnigarantia { get; set; } = new List<Garante>();
public virtual Cliente? dniinquilinoNavigation { get; set; }
public virtual ICollection<Canon> Idcanons { get; set; } = new List<Canon>();
public virtual Cliente? dnipropietarioNavigation { get; set; }
public virtual ICollection<Defecto> Iddefectos { get; set; } = new List<Defecto>();
public virtual Propiedade? idpropiedadNavigation { get; set; }
public virtual Venta? idventaNavigation { get; set; }
public virtual ICollection<Garante> dnigarantes { get; set; } = new List<Garante>();
public virtual ICollection<Canon> idcanons { get; set; } = new List<Canon>();
}

View File

@@ -5,15 +5,19 @@ namespace Entidades;
public partial class Defecto
{
public int Id { get; set; }
public long id { get; set; }
public string Descripcion { get; set; } = null!;
public string descripcion { get; set; } = null!;
public bool Estaarreglado { get; set; }
public decimal costo { get; set; }
public decimal Costo { get; set; }
public int? idestado { get; set; }
public bool Pagainquilino { get; set; }
public long? idcontrato { get; set; }
public virtual ICollection<Contrato> Idcontratos { get; set; } = new List<Contrato>();
public ulong pagainquilino { get; set; }
public virtual Contrato? idcontratoNavigation { get; set; }
public virtual Estadodefecto? idestadoNavigation { get; set; }
}

View File

@@ -1,6 +1,7 @@
namespace Entidades.Dto;
public class TokenDto{
public string Email { get; set; } = null!;
public string Token {get; set;} = String.Empty;
public string Redirect { get; set; } = String.Empty;
}

View File

@@ -12,6 +12,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.8" />
<PackageReference Include="MySql.EntityFrameworkCore" Version="8.0.8" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Estadodefecto
{
public int id { get; set; }
public string descipcion { get; set; } = null!;
public virtual ICollection<Defecto> Defectos { get; set; } = new List<Defecto>();
}

13
Entidades/Estadoventum.cs Normal file
View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Estadoventum
{
public int id { get; set; }
public string? descripcion { get; set; }
public virtual ICollection<Venta> Venta { get; set; } = new List<Venta>();
}

View File

@@ -3,13 +3,19 @@ using System.Collections.Generic;
namespace Entidades;
public partial class Garante : Usuario
public partial class Garante
{
public string Lugartrabajo { get; set; } = null!;
public long dni { get; set; }
public string Domiciliolaboral { get; set; } = null!;
public string nombre { get; set; } = null!;
public virtual ICollection<Contrato> Idcontratos { get; set; } = new List<Contrato>();
public string apellido { get; set; } = null!;
public virtual ICollection<Grupo> Idgrupos { get; set; } = new List<Grupo>();
public string domicilio { get; set; } = null!;
public string celular { get; set; } = null!;
public string domiciliolaboral { get; set; } = null!;
public virtual ICollection<Contrato> idcontratos { get; set; } = new List<Contrato>();
}

View File

@@ -5,15 +5,11 @@ namespace Entidades;
public partial class Grupo
{
public int Id { get; set; }
public int id { get; set; }
public string Nombre { get; set; } = null!;
public string nombre { get; set; } = null!;
public virtual ICollection<Garante> Dnigarantia { get; set; } = new List<Garante>();
public virtual ICollection<Permiso> idpermisos { get; set; } = new List<Permiso>();
public virtual ICollection<Inquilino> Dniinquilinos { get; set; } = new List<Inquilino>();
public virtual ICollection<Propietario> Dnipropietarios { get; set; } = new List<Propietario>();
public virtual ICollection<Rol> Idrols { get; set; } = new List<Rol>();
public virtual ICollection<Usuario> idusuarios { get; set; } = new List<Usuario>();
}

View File

@@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Inquilino: Usuario
{
public virtual ICollection<Contrato> Contratos { get; set; } = new List<Contrato>();
public virtual ICollection<Grupo> Idgrupos { get; set; } = new List<Grupo>();
}

View File

@@ -1,824 +0,0 @@
// <auto-generated />
using System;
using Entidades;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Entidades.Migrations
{
[DbContext(typeof(AlquilaFacilContext))]
[Migration("20240910000411_Ahora_saque_el_identity")]
partial class Ahora_saque_el_identity
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ContratoCanon", b =>
{
b.Property<int>("Idcontrato")
.HasColumnType("int")
.HasColumnName("IDCONTRATO");
b.Property<int>("Idcanon")
.HasColumnType("int")
.HasColumnName("IDCANON");
b.HasKey("Idcontrato", "Idcanon")
.HasName("PK__CONTRATO__EAB1D189E5C1886B");
b.HasIndex("Idcanon");
b.ToTable("CONTRATO_CANON", (string)null);
});
modelBuilder.Entity("ContratoDefecto", b =>
{
b.Property<int>("Idcontrato")
.HasColumnType("int")
.HasColumnName("IDCONTRATO");
b.Property<int>("Iddefecto")
.HasColumnType("int")
.HasColumnName("IDDEFECTO");
b.HasKey("Idcontrato", "Iddefecto")
.HasName("PK__CONTRATO__3A449B2F445D3682");
b.HasIndex("Iddefecto");
b.ToTable("CONTRATO_DEFECTO", (string)null);
});
modelBuilder.Entity("ContratoGarantium", b =>
{
b.Property<int>("Idcontrato")
.HasColumnType("int")
.HasColumnName("IDCONTRATO");
b.Property<long>("Dnigarantia")
.HasColumnType("bigint")
.HasColumnName("DNIGARANTIA");
b.HasKey("Idcontrato", "Dnigarantia")
.HasName("PK__CONTRATO__08D9A618A2AF4EE5");
b.HasIndex("Dnigarantia");
b.ToTable("CONTRATO_GARANTIA", (string)null);
});
modelBuilder.Entity("Entidades.Canon", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("Idrecibo")
.HasColumnType("int")
.HasColumnName("IDRECIBO");
b.Property<int>("Mes")
.HasColumnType("int")
.HasColumnName("MES");
b.Property<decimal>("Monto")
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
b.Property<bool>("Pagado")
.HasColumnType("bit")
.HasColumnName("PAGADO");
b.HasKey("Id")
.HasName("PK__CANON__3214EC27DAD9CBBD");
b.HasIndex("Idrecibo");
b.ToTable("CANON", (string)null);
});
modelBuilder.Entity("Entidades.Contrato", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<long?>("Dniinquilino")
.HasColumnType("bigint")
.HasColumnName("DNIINQUILINO");
b.Property<long?>("Dnipropietario")
.HasColumnType("bigint")
.HasColumnName("DNIPROPIETARIO");
b.Property<int>("Duracionmeses")
.HasColumnType("int")
.HasColumnName("DURACIONMESES");
b.Property<DateTime>("Fechainicio")
.HasColumnType("datetime")
.HasColumnName("FECHAINICIO");
b.Property<int?>("Idpropiedad")
.HasColumnType("int")
.HasColumnName("IDPROPIEDAD");
b.Property<decimal>("Indiceactualizacion")
.HasColumnType("decimal(12, 2)")
.HasColumnName("INDICEACTUALIZACION");
b.Property<decimal>("Monto")
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
b.HasKey("Id")
.HasName("PK__CONTRATO__3214EC27314E1A88");
b.HasIndex("Dniinquilino");
b.HasIndex("Dnipropietario");
b.HasIndex("Idpropiedad");
b.ToTable("CONTRATO", (string)null);
});
modelBuilder.Entity("Entidades.Defecto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<decimal>("Costo")
.HasColumnType("decimal(12, 2)")
.HasColumnName("COSTO");
b.Property<string>("Descripcion")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DESCRIPCION");
b.Property<bool>("Estaarreglado")
.HasColumnType("bit")
.HasColumnName("ESTAARREGLADO");
b.Property<bool>("Pagainquilino")
.HasColumnType("bit")
.HasColumnName("PAGAINQUILINO");
b.HasKey("Id")
.HasName("PK__DEFECTO__3214EC27E043B726");
b.ToTable("DEFECTO", (string)null);
});
modelBuilder.Entity("Entidades.Garante", b =>
{
b.Property<long>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Apellido")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("APELLIDO");
b.Property<string>("Celular")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("CELULAR");
b.Property<byte[]>("Contrasena")
.HasMaxLength(64)
.HasColumnType("varbinary(64)")
.HasColumnName("CONTRASENA");
b.Property<long>("Cuil")
.HasColumnType("bigint")
.HasColumnName("CUIL");
b.Property<string>("Domicilio")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIO");
b.Property<string>("Domiciliolaboral")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIOLABORAL");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("EMAIL");
b.Property<string>("Lugartrabajo")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("LUGARTRABAJO");
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("NOMBRE");
b.HasKey("Dni")
.HasName("PK__GARANTIA__C035B8DC8E6BAB11");
b.HasIndex(new[] { "Email" }, "UQ__GARANTIA__161CF724C0013CA1")
.IsUnique();
b.HasIndex(new[] { "Celular" }, "UQ__GARANTIA__6758673E51796017")
.IsUnique();
b.HasIndex(new[] { "Cuil" }, "UQ__GARANTIA__F46C15900DA7BBE1")
.IsUnique();
b.ToTable("GARANTIA", (string)null);
});
modelBuilder.Entity("Entidades.Grupo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("varchar(20)")
.HasColumnName("NOMBRE");
b.HasKey("Id")
.HasName("PK__GRUPO__3214EC2778FB625D");
b.ToTable("GRUPO", (string)null);
});
modelBuilder.Entity("Entidades.Inquilino", b =>
{
b.Property<long>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Apellido")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("APELLIDO");
b.Property<string>("Celular")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("CELULAR");
b.Property<byte[]>("Contrasena")
.HasMaxLength(64)
.HasColumnType("varbinary(64)")
.HasColumnName("CONTRASENA");
b.Property<long>("Cuil")
.HasColumnType("bigint")
.HasColumnName("CUIL");
b.Property<string>("Domicilio")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIO");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("EMAIL");
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("NOMBRE");
b.HasKey("Dni")
.HasName("PK__INQUILIN__C035B8DC051D254F");
b.HasIndex(new[] { "Email" }, "UQ__INQUILIN__161CF724192A8FBF")
.IsUnique();
b.HasIndex(new[] { "Celular" }, "UQ__INQUILIN__6758673EB3CC90D6")
.IsUnique();
b.HasIndex(new[] { "Cuil" }, "UQ__INQUILIN__F46C1590EF9A325E")
.IsUnique();
b.ToTable("INQUILINO", (string)null);
});
modelBuilder.Entity("Entidades.Propiedad", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("Canthabitaciones")
.HasColumnType("int")
.HasColumnName("CANTHABITACIONES");
b.Property<long?>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Letra")
.HasMaxLength(2)
.IsUnicode(false)
.HasColumnType("varchar(2)")
.HasColumnName("LETRA");
b.Property<int?>("Piso")
.HasColumnType("int")
.HasColumnName("PISO");
b.Property<bool?>("Tienecocina")
.HasColumnType("bit")
.HasColumnName("TIENECOCINA");
b.Property<string>("Ubicacion")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("UBICACION");
b.HasKey("Id")
.HasName("PK__PROPIEDA__3214EC2739D8661A");
b.HasIndex("Dni");
b.ToTable("PROPIEDADES", (string)null);
});
modelBuilder.Entity("Entidades.Propietario", b =>
{
b.Property<long>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Apellido")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("APELLIDO");
b.Property<string>("Celular")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("CELULAR");
b.Property<byte[]>("Contrasena")
.HasMaxLength(64)
.HasColumnType("varbinary(64)")
.HasColumnName("CONTRASENA");
b.Property<long>("Cuil")
.HasColumnType("bigint")
.HasColumnName("CUIL");
b.Property<string>("Domicilio")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIO");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("EMAIL");
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("NOMBRE");
b.HasKey("Dni")
.HasName("PK__PROPIETA__C035B8DC136518F4");
b.HasIndex(new[] { "Email" }, "UQ__PROPIETA__161CF7246E3AA1B6")
.IsUnique();
b.HasIndex(new[] { "Celular" }, "UQ__PROPIETA__6758673E211BCB21")
.IsUnique();
b.HasIndex(new[] { "Cuil" }, "UQ__PROPIETA__F46C15901A8D2463")
.IsUnique();
b.ToTable("PROPIETARIO", (string)null);
});
modelBuilder.Entity("Entidades.Recibo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Mes")
.HasColumnType("int")
.HasColumnName("MES");
b.Property<decimal>("Monto")
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
b.HasKey("Id")
.HasName("PK__RECIBO__3214EC277135BC90");
b.ToTable("RECIBO", (string)null);
});
modelBuilder.Entity("Entidades.Rol", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Descipcion")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("varchar(20)")
.HasColumnName("DESCIPCION");
b.HasKey("Id")
.HasName("PK__ROL__3214EC27DE6A34BE");
b.ToTable("ROL", (string)null);
});
modelBuilder.Entity("Entidades.Servicio", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Descripcion")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DESCRIPCION");
b.HasKey("Id")
.HasName("PK__SERVICIO__3214EC27468ADAA2");
b.HasIndex(new[] { "Descripcion" }, "UQ__SERVICIO__794449EF1A4F44FF")
.IsUnique();
b.ToTable("SERVICIO", (string)null);
});
modelBuilder.Entity("Entidades.ServicioPropiedade", b =>
{
b.Property<int?>("Idpropiedad")
.HasColumnType("int")
.HasColumnName("IDPROPIEDAD");
b.Property<int?>("Idservicio")
.HasColumnType("int")
.HasColumnName("IDSERVICIO");
b.HasIndex("Idpropiedad");
b.HasIndex("Idservicio");
b.ToTable("SERVICIO_PROPIEDADES", (string)null);
});
modelBuilder.Entity("GrupoGarantium", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<long>("Dnigarantia")
.HasColumnType("bigint")
.HasColumnName("DNIGARANTIA");
b.HasKey("Idgrupo", "Dnigarantia")
.HasName("PK__GRUPO_GA__F9F1F0A3A5F02DDF");
b.HasIndex("Dnigarantia");
b.ToTable("GRUPO_GARANTIA", (string)null);
});
modelBuilder.Entity("GrupoInquilino", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<long>("Dniinquilino")
.HasColumnType("bigint")
.HasColumnName("DNIINQUILINO");
b.HasKey("Idgrupo", "Dniinquilino")
.HasName("PK__GRUPO_IN__FC8CB8C5DC668E46");
b.HasIndex("Dniinquilino");
b.ToTable("GRUPO_INQUILINO", (string)null);
});
modelBuilder.Entity("GrupoPropietario", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<long>("Dnipropietario")
.HasColumnType("bigint")
.HasColumnName("DNIPROPIETARIO");
b.HasKey("Idgrupo", "Dnipropietario")
.HasName("PK__GRUPO_PR__D5806AB6196637D1");
b.HasIndex("Dnipropietario");
b.ToTable("GRUPO_PROPIETARIO", (string)null);
});
modelBuilder.Entity("GrupoRol", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<int>("Idrol")
.HasColumnType("int")
.HasColumnName("IDROL");
b.HasKey("Idgrupo", "Idrol")
.HasName("PK__GRUPO_RO__5035D4A88EFB1AF1");
b.HasIndex("Idrol");
b.ToTable("GRUPO_ROL", (string)null);
});
modelBuilder.Entity("ContratoCanon", b =>
{
b.HasOne("Entidades.Canon", null)
.WithMany()
.HasForeignKey("Idcanon")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCAN__3493CFA7");
b.HasOne("Entidades.Contrato", null)
.WithMany()
.HasForeignKey("Idcontrato")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCON__339FAB6E");
});
modelBuilder.Entity("ContratoDefecto", b =>
{
b.HasOne("Entidades.Contrato", null)
.WithMany()
.HasForeignKey("Idcontrato")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCON__2B0A656D");
b.HasOne("Entidades.Defecto", null)
.WithMany()
.HasForeignKey("Iddefecto")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDDEF__2BFE89A6");
});
modelBuilder.Entity("ContratoGarantium", b =>
{
b.HasOne("Entidades.Garante", null)
.WithMany()
.HasForeignKey("Dnigarantia")
.IsRequired()
.HasConstraintName("FK__CONTRATO___DNIGA__282DF8C2");
b.HasOne("Entidades.Contrato", null)
.WithMany()
.HasForeignKey("Idcontrato")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCON__2739D489");
});
modelBuilder.Entity("Entidades.Canon", b =>
{
b.HasOne("Entidades.Recibo", "IdreciboNavigation")
.WithMany("Canons")
.HasForeignKey("Idrecibo")
.HasConstraintName("FK__CANON__IDRECIBO__540C7B00");
b.Navigation("IdreciboNavigation");
});
modelBuilder.Entity("Entidades.Contrato", b =>
{
b.HasOne("Entidades.Inquilino", "DniinquilinoNavigation")
.WithMany("Contratos")
.HasForeignKey("Dniinquilino")
.HasConstraintName("FK__CONTRATO__DNIINQ__01142BA1");
b.HasOne("Entidades.Propietario", "DnipropietarioNavigation")
.WithMany("Contratos")
.HasForeignKey("Dnipropietario")
.HasConstraintName("FK__CONTRATO__DNIPRO__02084FDA");
b.HasOne("Entidades.Propiedad", "IdpropiedadNavigation")
.WithMany("Contratos")
.HasForeignKey("Idpropiedad")
.HasConstraintName("FK__CONTRATO__IDPROP__02FC7413");
b.Navigation("DniinquilinoNavigation");
b.Navigation("DnipropietarioNavigation");
b.Navigation("IdpropiedadNavigation");
});
modelBuilder.Entity("Entidades.Propiedad", b =>
{
b.HasOne("Entidades.Propietario", "DniNavigation")
.WithMany("Propiedades")
.HasForeignKey("Dni")
.HasConstraintName("FK__PROPIEDADES__DNI__44FF419A");
b.Navigation("DniNavigation");
});
modelBuilder.Entity("Entidades.ServicioPropiedade", b =>
{
b.HasOne("Entidades.Propiedad", "IdpropiedadNavigation")
.WithMany()
.HasForeignKey("Idpropiedad")
.HasConstraintName("FK__SERVICIO___IDPRO__49C3F6B7");
b.HasOne("Entidades.Servicio", "IdservicioNavigation")
.WithMany()
.HasForeignKey("Idservicio")
.HasConstraintName("FK__SERVICIO___IDSER__4AB81AF0");
b.Navigation("IdpropiedadNavigation");
b.Navigation("IdservicioNavigation");
});
modelBuilder.Entity("GrupoGarantium", b =>
{
b.HasOne("Entidades.Garante", null)
.WithMany()
.HasForeignKey("Dnigarantia")
.IsRequired()
.HasConstraintName("FK__GRUPO_GAR__DNIGA__46B27FE2");
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_GAR__IDGRU__45BE5BA9");
});
modelBuilder.Entity("GrupoInquilino", b =>
{
b.HasOne("Entidades.Inquilino", null)
.WithMany()
.HasForeignKey("Dniinquilino")
.IsRequired()
.HasConstraintName("FK__GRUPO_INQ__DNIIN__40058253");
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_INQ__IDGRU__3F115E1A");
});
modelBuilder.Entity("GrupoPropietario", b =>
{
b.HasOne("Entidades.Propietario", null)
.WithMany()
.HasForeignKey("Dnipropietario")
.IsRequired()
.HasConstraintName("FK__GRUPO_PRO__DNIPR__4A8310C6");
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_PRO__IDGRU__498EEC8D");
});
modelBuilder.Entity("GrupoRol", b =>
{
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_ROL__IDGRU__3B40CD36");
b.HasOne("Entidades.Rol", null)
.WithMany()
.HasForeignKey("Idrol")
.IsRequired()
.HasConstraintName("FK__GRUPO_ROL__IDROL__3C34F16F");
});
modelBuilder.Entity("Entidades.Inquilino", b =>
{
b.Navigation("Contratos");
});
modelBuilder.Entity("Entidades.Propiedad", b =>
{
b.Navigation("Contratos");
});
modelBuilder.Entity("Entidades.Propietario", b =>
{
b.Navigation("Contratos");
b.Navigation("Propiedades");
});
modelBuilder.Entity("Entidades.Recibo", b =>
{
b.Navigation("Canons");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,584 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Entidades.Migrations
{
/// <inheritdoc />
public partial class Ahora_saque_el_identity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DEFECTO",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DESCRIPCION = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
ESTAARREGLADO = table.Column<bool>(type: "bit", nullable: false),
COSTO = table.Column<decimal>(type: "decimal(12,2)", nullable: false),
PAGAINQUILINO = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__DEFECTO__3214EC27E043B726", x => x.ID);
});
migrationBuilder.CreateTable(
name: "GARANTIA",
columns: table => new
{
DNI = table.Column<long>(type: "bigint", nullable: false),
LUGARTRABAJO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
DOMICILIOLABORAL = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CUIL = table.Column<long>(type: "bigint", nullable: false),
NOMBRE = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
APELLIDO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
EMAIL = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CELULAR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
DOMICILIO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CONTRASENA = table.Column<byte[]>(type: "varbinary(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK__GARANTIA__C035B8DC8E6BAB11", x => x.DNI);
});
migrationBuilder.CreateTable(
name: "GRUPO",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NOMBRE = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__GRUPO__3214EC2778FB625D", x => x.ID);
});
migrationBuilder.CreateTable(
name: "INQUILINO",
columns: table => new
{
DNI = table.Column<long>(type: "bigint", nullable: false),
CUIL = table.Column<long>(type: "bigint", nullable: false),
NOMBRE = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
APELLIDO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
EMAIL = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CELULAR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
DOMICILIO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CONTRASENA = table.Column<byte[]>(type: "varbinary(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK__INQUILIN__C035B8DC051D254F", x => x.DNI);
});
migrationBuilder.CreateTable(
name: "PROPIETARIO",
columns: table => new
{
DNI = table.Column<long>(type: "bigint", nullable: false),
CUIL = table.Column<long>(type: "bigint", nullable: false),
NOMBRE = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
APELLIDO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
EMAIL = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CELULAR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
DOMICILIO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CONTRASENA = table.Column<byte[]>(type: "varbinary(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK__PROPIETA__C035B8DC136518F4", x => x.DNI);
});
migrationBuilder.CreateTable(
name: "RECIBO",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
MES = table.Column<int>(type: "int", nullable: false),
MONTO = table.Column<decimal>(type: "decimal(12,2)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__RECIBO__3214EC277135BC90", x => x.ID);
});
migrationBuilder.CreateTable(
name: "ROL",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DESCIPCION = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__ROL__3214EC27DE6A34BE", x => x.ID);
});
migrationBuilder.CreateTable(
name: "SERVICIO",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DESCRIPCION = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__SERVICIO__3214EC27468ADAA2", x => x.ID);
});
migrationBuilder.CreateTable(
name: "GRUPO_GARANTIA",
columns: table => new
{
IDGRUPO = table.Column<int>(type: "int", nullable: false),
DNIGARANTIA = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__GRUPO_GA__F9F1F0A3A5F02DDF", x => new { x.IDGRUPO, x.DNIGARANTIA });
table.ForeignKey(
name: "FK__GRUPO_GAR__DNIGA__46B27FE2",
column: x => x.DNIGARANTIA,
principalTable: "GARANTIA",
principalColumn: "DNI");
table.ForeignKey(
name: "FK__GRUPO_GAR__IDGRU__45BE5BA9",
column: x => x.IDGRUPO,
principalTable: "GRUPO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "GRUPO_INQUILINO",
columns: table => new
{
IDGRUPO = table.Column<int>(type: "int", nullable: false),
DNIINQUILINO = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__GRUPO_IN__FC8CB8C5DC668E46", x => new { x.IDGRUPO, x.DNIINQUILINO });
table.ForeignKey(
name: "FK__GRUPO_INQ__DNIIN__40058253",
column: x => x.DNIINQUILINO,
principalTable: "INQUILINO",
principalColumn: "DNI");
table.ForeignKey(
name: "FK__GRUPO_INQ__IDGRU__3F115E1A",
column: x => x.IDGRUPO,
principalTable: "GRUPO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "GRUPO_PROPIETARIO",
columns: table => new
{
IDGRUPO = table.Column<int>(type: "int", nullable: false),
DNIPROPIETARIO = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__GRUPO_PR__D5806AB6196637D1", x => new { x.IDGRUPO, x.DNIPROPIETARIO });
table.ForeignKey(
name: "FK__GRUPO_PRO__DNIPR__4A8310C6",
column: x => x.DNIPROPIETARIO,
principalTable: "PROPIETARIO",
principalColumn: "DNI");
table.ForeignKey(
name: "FK__GRUPO_PRO__IDGRU__498EEC8D",
column: x => x.IDGRUPO,
principalTable: "GRUPO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "PROPIEDADES",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DNI = table.Column<long>(type: "bigint", nullable: true),
UBICACION = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
CANTHABITACIONES = table.Column<int>(type: "int", nullable: true),
TIENECOCINA = table.Column<bool>(type: "bit", nullable: true),
PISO = table.Column<int>(type: "int", nullable: true),
LETRA = table.Column<string>(type: "varchar(2)", unicode: false, maxLength: 2, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK__PROPIEDA__3214EC2739D8661A", x => x.ID);
table.ForeignKey(
name: "FK__PROPIEDADES__DNI__44FF419A",
column: x => x.DNI,
principalTable: "PROPIETARIO",
principalColumn: "DNI");
});
migrationBuilder.CreateTable(
name: "CANON",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
MES = table.Column<int>(type: "int", nullable: false),
MONTO = table.Column<decimal>(type: "decimal(12,2)", nullable: false),
PAGADO = table.Column<bool>(type: "bit", nullable: false),
IDRECIBO = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK__CANON__3214EC27DAD9CBBD", x => x.ID);
table.ForeignKey(
name: "FK__CANON__IDRECIBO__540C7B00",
column: x => x.IDRECIBO,
principalTable: "RECIBO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "GRUPO_ROL",
columns: table => new
{
IDGRUPO = table.Column<int>(type: "int", nullable: false),
IDROL = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__GRUPO_RO__5035D4A88EFB1AF1", x => new { x.IDGRUPO, x.IDROL });
table.ForeignKey(
name: "FK__GRUPO_ROL__IDGRU__3B40CD36",
column: x => x.IDGRUPO,
principalTable: "GRUPO",
principalColumn: "ID");
table.ForeignKey(
name: "FK__GRUPO_ROL__IDROL__3C34F16F",
column: x => x.IDROL,
principalTable: "ROL",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "CONTRATO",
columns: table => new
{
ID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FECHAINICIO = table.Column<DateTime>(type: "datetime", nullable: false),
INDICEACTUALIZACION = table.Column<decimal>(type: "decimal(12,2)", nullable: false),
MONTO = table.Column<decimal>(type: "decimal(12,2)", nullable: false),
DURACIONMESES = table.Column<int>(type: "int", nullable: false),
DNIINQUILINO = table.Column<long>(type: "bigint", nullable: true),
DNIPROPIETARIO = table.Column<long>(type: "bigint", nullable: true),
IDPROPIEDAD = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK__CONTRATO__3214EC27314E1A88", x => x.ID);
table.ForeignKey(
name: "FK__CONTRATO__DNIINQ__01142BA1",
column: x => x.DNIINQUILINO,
principalTable: "INQUILINO",
principalColumn: "DNI");
table.ForeignKey(
name: "FK__CONTRATO__DNIPRO__02084FDA",
column: x => x.DNIPROPIETARIO,
principalTable: "PROPIETARIO",
principalColumn: "DNI");
table.ForeignKey(
name: "FK__CONTRATO__IDPROP__02FC7413",
column: x => x.IDPROPIEDAD,
principalTable: "PROPIEDADES",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "SERVICIO_PROPIEDADES",
columns: table => new
{
IDPROPIEDAD = table.Column<int>(type: "int", nullable: true),
IDSERVICIO = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.ForeignKey(
name: "FK__SERVICIO___IDPRO__49C3F6B7",
column: x => x.IDPROPIEDAD,
principalTable: "PROPIEDADES",
principalColumn: "ID");
table.ForeignKey(
name: "FK__SERVICIO___IDSER__4AB81AF0",
column: x => x.IDSERVICIO,
principalTable: "SERVICIO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "CONTRATO_CANON",
columns: table => new
{
IDCONTRATO = table.Column<int>(type: "int", nullable: false),
IDCANON = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__CONTRATO__EAB1D189E5C1886B", x => new { x.IDCONTRATO, x.IDCANON });
table.ForeignKey(
name: "FK__CONTRATO___IDCAN__3493CFA7",
column: x => x.IDCANON,
principalTable: "CANON",
principalColumn: "ID");
table.ForeignKey(
name: "FK__CONTRATO___IDCON__339FAB6E",
column: x => x.IDCONTRATO,
principalTable: "CONTRATO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "CONTRATO_DEFECTO",
columns: table => new
{
IDCONTRATO = table.Column<int>(type: "int", nullable: false),
IDDEFECTO = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__CONTRATO__3A449B2F445D3682", x => new { x.IDCONTRATO, x.IDDEFECTO });
table.ForeignKey(
name: "FK__CONTRATO___IDCON__2B0A656D",
column: x => x.IDCONTRATO,
principalTable: "CONTRATO",
principalColumn: "ID");
table.ForeignKey(
name: "FK__CONTRATO___IDDEF__2BFE89A6",
column: x => x.IDDEFECTO,
principalTable: "DEFECTO",
principalColumn: "ID");
});
migrationBuilder.CreateTable(
name: "CONTRATO_GARANTIA",
columns: table => new
{
IDCONTRATO = table.Column<int>(type: "int", nullable: false),
DNIGARANTIA = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK__CONTRATO__08D9A618A2AF4EE5", x => new { x.IDCONTRATO, x.DNIGARANTIA });
table.ForeignKey(
name: "FK__CONTRATO___DNIGA__282DF8C2",
column: x => x.DNIGARANTIA,
principalTable: "GARANTIA",
principalColumn: "DNI");
table.ForeignKey(
name: "FK__CONTRATO___IDCON__2739D489",
column: x => x.IDCONTRATO,
principalTable: "CONTRATO",
principalColumn: "ID");
});
migrationBuilder.CreateIndex(
name: "IX_CANON_IDRECIBO",
table: "CANON",
column: "IDRECIBO");
migrationBuilder.CreateIndex(
name: "IX_CONTRATO_DNIINQUILINO",
table: "CONTRATO",
column: "DNIINQUILINO");
migrationBuilder.CreateIndex(
name: "IX_CONTRATO_DNIPROPIETARIO",
table: "CONTRATO",
column: "DNIPROPIETARIO");
migrationBuilder.CreateIndex(
name: "IX_CONTRATO_IDPROPIEDAD",
table: "CONTRATO",
column: "IDPROPIEDAD");
migrationBuilder.CreateIndex(
name: "IX_CONTRATO_CANON_IDCANON",
table: "CONTRATO_CANON",
column: "IDCANON");
migrationBuilder.CreateIndex(
name: "IX_CONTRATO_DEFECTO_IDDEFECTO",
table: "CONTRATO_DEFECTO",
column: "IDDEFECTO");
migrationBuilder.CreateIndex(
name: "IX_CONTRATO_GARANTIA_DNIGARANTIA",
table: "CONTRATO_GARANTIA",
column: "DNIGARANTIA");
migrationBuilder.CreateIndex(
name: "UQ__GARANTIA__161CF724C0013CA1",
table: "GARANTIA",
column: "EMAIL",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__GARANTIA__6758673E51796017",
table: "GARANTIA",
column: "CELULAR",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__GARANTIA__F46C15900DA7BBE1",
table: "GARANTIA",
column: "CUIL",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_GRUPO_GARANTIA_DNIGARANTIA",
table: "GRUPO_GARANTIA",
column: "DNIGARANTIA");
migrationBuilder.CreateIndex(
name: "IX_GRUPO_INQUILINO_DNIINQUILINO",
table: "GRUPO_INQUILINO",
column: "DNIINQUILINO");
migrationBuilder.CreateIndex(
name: "IX_GRUPO_PROPIETARIO_DNIPROPIETARIO",
table: "GRUPO_PROPIETARIO",
column: "DNIPROPIETARIO");
migrationBuilder.CreateIndex(
name: "IX_GRUPO_ROL_IDROL",
table: "GRUPO_ROL",
column: "IDROL");
migrationBuilder.CreateIndex(
name: "UQ__INQUILIN__161CF724192A8FBF",
table: "INQUILINO",
column: "EMAIL",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__INQUILIN__6758673EB3CC90D6",
table: "INQUILINO",
column: "CELULAR",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__INQUILIN__F46C1590EF9A325E",
table: "INQUILINO",
column: "CUIL",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_PROPIEDADES_DNI",
table: "PROPIEDADES",
column: "DNI");
migrationBuilder.CreateIndex(
name: "UQ__PROPIETA__161CF7246E3AA1B6",
table: "PROPIETARIO",
column: "EMAIL",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__PROPIETA__6758673E211BCB21",
table: "PROPIETARIO",
column: "CELULAR",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__PROPIETA__F46C15901A8D2463",
table: "PROPIETARIO",
column: "CUIL",
unique: true);
migrationBuilder.CreateIndex(
name: "UQ__SERVICIO__794449EF1A4F44FF",
table: "SERVICIO",
column: "DESCRIPCION",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_SERVICIO_PROPIEDADES_IDPROPIEDAD",
table: "SERVICIO_PROPIEDADES",
column: "IDPROPIEDAD");
migrationBuilder.CreateIndex(
name: "IX_SERVICIO_PROPIEDADES_IDSERVICIO",
table: "SERVICIO_PROPIEDADES",
column: "IDSERVICIO");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CONTRATO_CANON");
migrationBuilder.DropTable(
name: "CONTRATO_DEFECTO");
migrationBuilder.DropTable(
name: "CONTRATO_GARANTIA");
migrationBuilder.DropTable(
name: "GRUPO_GARANTIA");
migrationBuilder.DropTable(
name: "GRUPO_INQUILINO");
migrationBuilder.DropTable(
name: "GRUPO_PROPIETARIO");
migrationBuilder.DropTable(
name: "GRUPO_ROL");
migrationBuilder.DropTable(
name: "SERVICIO_PROPIEDADES");
migrationBuilder.DropTable(
name: "CANON");
migrationBuilder.DropTable(
name: "DEFECTO");
migrationBuilder.DropTable(
name: "CONTRATO");
migrationBuilder.DropTable(
name: "GARANTIA");
migrationBuilder.DropTable(
name: "GRUPO");
migrationBuilder.DropTable(
name: "ROL");
migrationBuilder.DropTable(
name: "SERVICIO");
migrationBuilder.DropTable(
name: "RECIBO");
migrationBuilder.DropTable(
name: "INQUILINO");
migrationBuilder.DropTable(
name: "PROPIEDADES");
migrationBuilder.DropTable(
name: "PROPIETARIO");
}
}
}

View File

@@ -1,821 +0,0 @@
// <auto-generated />
using System;
using Entidades;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Entidades.Migrations
{
[DbContext(typeof(AlquilaFacilContext))]
partial class AlquilaFacilContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ContratoCanon", b =>
{
b.Property<int>("Idcontrato")
.HasColumnType("int")
.HasColumnName("IDCONTRATO");
b.Property<int>("Idcanon")
.HasColumnType("int")
.HasColumnName("IDCANON");
b.HasKey("Idcontrato", "Idcanon")
.HasName("PK__CONTRATO__EAB1D189E5C1886B");
b.HasIndex("Idcanon");
b.ToTable("CONTRATO_CANON", (string)null);
});
modelBuilder.Entity("ContratoDefecto", b =>
{
b.Property<int>("Idcontrato")
.HasColumnType("int")
.HasColumnName("IDCONTRATO");
b.Property<int>("Iddefecto")
.HasColumnType("int")
.HasColumnName("IDDEFECTO");
b.HasKey("Idcontrato", "Iddefecto")
.HasName("PK__CONTRATO__3A449B2F445D3682");
b.HasIndex("Iddefecto");
b.ToTable("CONTRATO_DEFECTO", (string)null);
});
modelBuilder.Entity("ContratoGarantium", b =>
{
b.Property<int>("Idcontrato")
.HasColumnType("int")
.HasColumnName("IDCONTRATO");
b.Property<long>("Dnigarantia")
.HasColumnType("bigint")
.HasColumnName("DNIGARANTIA");
b.HasKey("Idcontrato", "Dnigarantia")
.HasName("PK__CONTRATO__08D9A618A2AF4EE5");
b.HasIndex("Dnigarantia");
b.ToTable("CONTRATO_GARANTIA", (string)null);
});
modelBuilder.Entity("Entidades.Canon", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("Idrecibo")
.HasColumnType("int")
.HasColumnName("IDRECIBO");
b.Property<int>("Mes")
.HasColumnType("int")
.HasColumnName("MES");
b.Property<decimal>("Monto")
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
b.Property<bool>("Pagado")
.HasColumnType("bit")
.HasColumnName("PAGADO");
b.HasKey("Id")
.HasName("PK__CANON__3214EC27DAD9CBBD");
b.HasIndex("Idrecibo");
b.ToTable("CANON", (string)null);
});
modelBuilder.Entity("Entidades.Contrato", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<long?>("Dniinquilino")
.HasColumnType("bigint")
.HasColumnName("DNIINQUILINO");
b.Property<long?>("Dnipropietario")
.HasColumnType("bigint")
.HasColumnName("DNIPROPIETARIO");
b.Property<int>("Duracionmeses")
.HasColumnType("int")
.HasColumnName("DURACIONMESES");
b.Property<DateTime>("Fechainicio")
.HasColumnType("datetime")
.HasColumnName("FECHAINICIO");
b.Property<int?>("Idpropiedad")
.HasColumnType("int")
.HasColumnName("IDPROPIEDAD");
b.Property<decimal>("Indiceactualizacion")
.HasColumnType("decimal(12, 2)")
.HasColumnName("INDICEACTUALIZACION");
b.Property<decimal>("Monto")
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
b.HasKey("Id")
.HasName("PK__CONTRATO__3214EC27314E1A88");
b.HasIndex("Dniinquilino");
b.HasIndex("Dnipropietario");
b.HasIndex("Idpropiedad");
b.ToTable("CONTRATO", (string)null);
});
modelBuilder.Entity("Entidades.Defecto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<decimal>("Costo")
.HasColumnType("decimal(12, 2)")
.HasColumnName("COSTO");
b.Property<string>("Descripcion")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DESCRIPCION");
b.Property<bool>("Estaarreglado")
.HasColumnType("bit")
.HasColumnName("ESTAARREGLADO");
b.Property<bool>("Pagainquilino")
.HasColumnType("bit")
.HasColumnName("PAGAINQUILINO");
b.HasKey("Id")
.HasName("PK__DEFECTO__3214EC27E043B726");
b.ToTable("DEFECTO", (string)null);
});
modelBuilder.Entity("Entidades.Garante", b =>
{
b.Property<long>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Apellido")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("APELLIDO");
b.Property<string>("Celular")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("CELULAR");
b.Property<byte[]>("Contrasena")
.HasMaxLength(64)
.HasColumnType("varbinary(64)")
.HasColumnName("CONTRASENA");
b.Property<long>("Cuil")
.HasColumnType("bigint")
.HasColumnName("CUIL");
b.Property<string>("Domicilio")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIO");
b.Property<string>("Domiciliolaboral")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIOLABORAL");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("EMAIL");
b.Property<string>("Lugartrabajo")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("LUGARTRABAJO");
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("NOMBRE");
b.HasKey("Dni")
.HasName("PK__GARANTIA__C035B8DC8E6BAB11");
b.HasIndex(new[] { "Email" }, "UQ__GARANTIA__161CF724C0013CA1")
.IsUnique();
b.HasIndex(new[] { "Celular" }, "UQ__GARANTIA__6758673E51796017")
.IsUnique();
b.HasIndex(new[] { "Cuil" }, "UQ__GARANTIA__F46C15900DA7BBE1")
.IsUnique();
b.ToTable("GARANTIA", (string)null);
});
modelBuilder.Entity("Entidades.Grupo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("varchar(20)")
.HasColumnName("NOMBRE");
b.HasKey("Id")
.HasName("PK__GRUPO__3214EC2778FB625D");
b.ToTable("GRUPO", (string)null);
});
modelBuilder.Entity("Entidades.Inquilino", b =>
{
b.Property<long>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Apellido")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("APELLIDO");
b.Property<string>("Celular")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("CELULAR");
b.Property<byte[]>("Contrasena")
.HasMaxLength(64)
.HasColumnType("varbinary(64)")
.HasColumnName("CONTRASENA");
b.Property<long>("Cuil")
.HasColumnType("bigint")
.HasColumnName("CUIL");
b.Property<string>("Domicilio")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIO");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("EMAIL");
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("NOMBRE");
b.HasKey("Dni")
.HasName("PK__INQUILIN__C035B8DC051D254F");
b.HasIndex(new[] { "Email" }, "UQ__INQUILIN__161CF724192A8FBF")
.IsUnique();
b.HasIndex(new[] { "Celular" }, "UQ__INQUILIN__6758673EB3CC90D6")
.IsUnique();
b.HasIndex(new[] { "Cuil" }, "UQ__INQUILIN__F46C1590EF9A325E")
.IsUnique();
b.ToTable("INQUILINO", (string)null);
});
modelBuilder.Entity("Entidades.Propiedad", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("Canthabitaciones")
.HasColumnType("int")
.HasColumnName("CANTHABITACIONES");
b.Property<long?>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Letra")
.HasMaxLength(2)
.IsUnicode(false)
.HasColumnType("varchar(2)")
.HasColumnName("LETRA");
b.Property<int?>("Piso")
.HasColumnType("int")
.HasColumnName("PISO");
b.Property<bool?>("Tienecocina")
.HasColumnType("bit")
.HasColumnName("TIENECOCINA");
b.Property<string>("Ubicacion")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("UBICACION");
b.HasKey("Id")
.HasName("PK__PROPIEDA__3214EC2739D8661A");
b.HasIndex("Dni");
b.ToTable("PROPIEDADES", (string)null);
});
modelBuilder.Entity("Entidades.Propietario", b =>
{
b.Property<long>("Dni")
.HasColumnType("bigint")
.HasColumnName("DNI");
b.Property<string>("Apellido")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("APELLIDO");
b.Property<string>("Celular")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("CELULAR");
b.Property<byte[]>("Contrasena")
.HasMaxLength(64)
.HasColumnType("varbinary(64)")
.HasColumnName("CONTRASENA");
b.Property<long>("Cuil")
.HasColumnType("bigint")
.HasColumnName("CUIL");
b.Property<string>("Domicilio")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DOMICILIO");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("EMAIL");
b.Property<string>("Nombre")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("NOMBRE");
b.HasKey("Dni")
.HasName("PK__PROPIETA__C035B8DC136518F4");
b.HasIndex(new[] { "Email" }, "UQ__PROPIETA__161CF7246E3AA1B6")
.IsUnique();
b.HasIndex(new[] { "Celular" }, "UQ__PROPIETA__6758673E211BCB21")
.IsUnique();
b.HasIndex(new[] { "Cuil" }, "UQ__PROPIETA__F46C15901A8D2463")
.IsUnique();
b.ToTable("PROPIETARIO", (string)null);
});
modelBuilder.Entity("Entidades.Recibo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Mes")
.HasColumnType("int")
.HasColumnName("MES");
b.Property<decimal>("Monto")
.HasColumnType("decimal(12, 2)")
.HasColumnName("MONTO");
b.HasKey("Id")
.HasName("PK__RECIBO__3214EC277135BC90");
b.ToTable("RECIBO", (string)null);
});
modelBuilder.Entity("Entidades.Rol", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Descipcion")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("varchar(20)")
.HasColumnName("DESCIPCION");
b.HasKey("Id")
.HasName("PK__ROL__3214EC27DE6A34BE");
b.ToTable("ROL", (string)null);
});
modelBuilder.Entity("Entidades.Servicio", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("ID");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Descripcion")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("varchar(50)")
.HasColumnName("DESCRIPCION");
b.HasKey("Id")
.HasName("PK__SERVICIO__3214EC27468ADAA2");
b.HasIndex(new[] { "Descripcion" }, "UQ__SERVICIO__794449EF1A4F44FF")
.IsUnique();
b.ToTable("SERVICIO", (string)null);
});
modelBuilder.Entity("Entidades.ServicioPropiedade", b =>
{
b.Property<int?>("Idpropiedad")
.HasColumnType("int")
.HasColumnName("IDPROPIEDAD");
b.Property<int?>("Idservicio")
.HasColumnType("int")
.HasColumnName("IDSERVICIO");
b.HasIndex("Idpropiedad");
b.HasIndex("Idservicio");
b.ToTable("SERVICIO_PROPIEDADES", (string)null);
});
modelBuilder.Entity("GrupoGarantium", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<long>("Dnigarantia")
.HasColumnType("bigint")
.HasColumnName("DNIGARANTIA");
b.HasKey("Idgrupo", "Dnigarantia")
.HasName("PK__GRUPO_GA__F9F1F0A3A5F02DDF");
b.HasIndex("Dnigarantia");
b.ToTable("GRUPO_GARANTIA", (string)null);
});
modelBuilder.Entity("GrupoInquilino", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<long>("Dniinquilino")
.HasColumnType("bigint")
.HasColumnName("DNIINQUILINO");
b.HasKey("Idgrupo", "Dniinquilino")
.HasName("PK__GRUPO_IN__FC8CB8C5DC668E46");
b.HasIndex("Dniinquilino");
b.ToTable("GRUPO_INQUILINO", (string)null);
});
modelBuilder.Entity("GrupoPropietario", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<long>("Dnipropietario")
.HasColumnType("bigint")
.HasColumnName("DNIPROPIETARIO");
b.HasKey("Idgrupo", "Dnipropietario")
.HasName("PK__GRUPO_PR__D5806AB6196637D1");
b.HasIndex("Dnipropietario");
b.ToTable("GRUPO_PROPIETARIO", (string)null);
});
modelBuilder.Entity("GrupoRol", b =>
{
b.Property<int>("Idgrupo")
.HasColumnType("int")
.HasColumnName("IDGRUPO");
b.Property<int>("Idrol")
.HasColumnType("int")
.HasColumnName("IDROL");
b.HasKey("Idgrupo", "Idrol")
.HasName("PK__GRUPO_RO__5035D4A88EFB1AF1");
b.HasIndex("Idrol");
b.ToTable("GRUPO_ROL", (string)null);
});
modelBuilder.Entity("ContratoCanon", b =>
{
b.HasOne("Entidades.Canon", null)
.WithMany()
.HasForeignKey("Idcanon")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCAN__3493CFA7");
b.HasOne("Entidades.Contrato", null)
.WithMany()
.HasForeignKey("Idcontrato")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCON__339FAB6E");
});
modelBuilder.Entity("ContratoDefecto", b =>
{
b.HasOne("Entidades.Contrato", null)
.WithMany()
.HasForeignKey("Idcontrato")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCON__2B0A656D");
b.HasOne("Entidades.Defecto", null)
.WithMany()
.HasForeignKey("Iddefecto")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDDEF__2BFE89A6");
});
modelBuilder.Entity("ContratoGarantium", b =>
{
b.HasOne("Entidades.Garante", null)
.WithMany()
.HasForeignKey("Dnigarantia")
.IsRequired()
.HasConstraintName("FK__CONTRATO___DNIGA__282DF8C2");
b.HasOne("Entidades.Contrato", null)
.WithMany()
.HasForeignKey("Idcontrato")
.IsRequired()
.HasConstraintName("FK__CONTRATO___IDCON__2739D489");
});
modelBuilder.Entity("Entidades.Canon", b =>
{
b.HasOne("Entidades.Recibo", "IdreciboNavigation")
.WithMany("Canons")
.HasForeignKey("Idrecibo")
.HasConstraintName("FK__CANON__IDRECIBO__540C7B00");
b.Navigation("IdreciboNavigation");
});
modelBuilder.Entity("Entidades.Contrato", b =>
{
b.HasOne("Entidades.Inquilino", "DniinquilinoNavigation")
.WithMany("Contratos")
.HasForeignKey("Dniinquilino")
.HasConstraintName("FK__CONTRATO__DNIINQ__01142BA1");
b.HasOne("Entidades.Propietario", "DnipropietarioNavigation")
.WithMany("Contratos")
.HasForeignKey("Dnipropietario")
.HasConstraintName("FK__CONTRATO__DNIPRO__02084FDA");
b.HasOne("Entidades.Propiedad", "IdpropiedadNavigation")
.WithMany("Contratos")
.HasForeignKey("Idpropiedad")
.HasConstraintName("FK__CONTRATO__IDPROP__02FC7413");
b.Navigation("DniinquilinoNavigation");
b.Navigation("DnipropietarioNavigation");
b.Navigation("IdpropiedadNavigation");
});
modelBuilder.Entity("Entidades.Propiedad", b =>
{
b.HasOne("Entidades.Propietario", "DniNavigation")
.WithMany("Propiedades")
.HasForeignKey("Dni")
.HasConstraintName("FK__PROPIEDADES__DNI__44FF419A");
b.Navigation("DniNavigation");
});
modelBuilder.Entity("Entidades.ServicioPropiedade", b =>
{
b.HasOne("Entidades.Propiedad", "IdpropiedadNavigation")
.WithMany()
.HasForeignKey("Idpropiedad")
.HasConstraintName("FK__SERVICIO___IDPRO__49C3F6B7");
b.HasOne("Entidades.Servicio", "IdservicioNavigation")
.WithMany()
.HasForeignKey("Idservicio")
.HasConstraintName("FK__SERVICIO___IDSER__4AB81AF0");
b.Navigation("IdpropiedadNavigation");
b.Navigation("IdservicioNavigation");
});
modelBuilder.Entity("GrupoGarantium", b =>
{
b.HasOne("Entidades.Garante", null)
.WithMany()
.HasForeignKey("Dnigarantia")
.IsRequired()
.HasConstraintName("FK__GRUPO_GAR__DNIGA__46B27FE2");
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_GAR__IDGRU__45BE5BA9");
});
modelBuilder.Entity("GrupoInquilino", b =>
{
b.HasOne("Entidades.Inquilino", null)
.WithMany()
.HasForeignKey("Dniinquilino")
.IsRequired()
.HasConstraintName("FK__GRUPO_INQ__DNIIN__40058253");
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_INQ__IDGRU__3F115E1A");
});
modelBuilder.Entity("GrupoPropietario", b =>
{
b.HasOne("Entidades.Propietario", null)
.WithMany()
.HasForeignKey("Dnipropietario")
.IsRequired()
.HasConstraintName("FK__GRUPO_PRO__DNIPR__4A8310C6");
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_PRO__IDGRU__498EEC8D");
});
modelBuilder.Entity("GrupoRol", b =>
{
b.HasOne("Entidades.Grupo", null)
.WithMany()
.HasForeignKey("Idgrupo")
.IsRequired()
.HasConstraintName("FK__GRUPO_ROL__IDGRU__3B40CD36");
b.HasOne("Entidades.Rol", null)
.WithMany()
.HasForeignKey("Idrol")
.IsRequired()
.HasConstraintName("FK__GRUPO_ROL__IDROL__3C34F16F");
});
modelBuilder.Entity("Entidades.Inquilino", b =>
{
b.Navigation("Contratos");
});
modelBuilder.Entity("Entidades.Propiedad", b =>
{
b.Navigation("Contratos");
});
modelBuilder.Entity("Entidades.Propietario", b =>
{
b.Navigation("Contratos");
b.Navigation("Propiedades");
});
modelBuilder.Entity("Entidades.Recibo", b =>
{
b.Navigation("Canons");
});
#pragma warning restore 612, 618
}
}
}

13
Entidades/Permiso.cs Normal file
View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Permiso
{
public int id { get; set; }
public string? descripcion { get; set; }
public virtual ICollection<Grupo> idgrupos { get; set; } = new List<Grupo>();
}

View File

@@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Propiedad
{
public int Id { get; set; }
public long? Dni { get; set; }
public string Ubicacion { get; set; } = null!;
public int? Canthabitaciones { get; set; }
public bool? Tienecocina { get; set; }
public int? Piso { get; set; }
public string? Letra { get; set; }
public virtual ICollection<Contrato> Contratos { get; set; } = new List<Contrato>();
public virtual Propietario? DniNavigation { get; set; }
}

25
Entidades/Propiedade.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Propiedade
{
public int id { get; set; }
public string ubicacion { get; set; } = null!;
public int canthabitaciones { get; set; }
public int? piso { get; set; }
public string? letra { get; set; }
public long? dnipropietario { get; set; }
public virtual ICollection<Contrato> Contratos { get; set; } = new List<Contrato>();
public virtual ICollection<Venta> Venta { get; set; } = new List<Venta>();
public virtual Cliente? dnipropietarioNavigation { get; set; }
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Propietario : Usuario
{
public virtual ICollection<Contrato> Contratos { get; set; } = new List<Contrato>();
public virtual ICollection<Propiedad> Propiedades { get; set; } = new List<Propiedad>();
public virtual ICollection<Grupo> Idgrupos { get; set; } = new List<Grupo>();
}

View File

@@ -5,11 +5,11 @@ namespace Entidades;
public partial class Recibo
{
public int Id { get; set; }
public long id { get; set; }
public int Mes { get; set; }
public DateTime fecha { get; set; }
public decimal Monto { get; set; }
public decimal monto { get; set; }
public virtual ICollection<Canon> Canons { get; set; } = new List<Canon>();
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Rol
{
public int Id { get; set; }
public string Descipcion { get; set; } = null!;
public virtual ICollection<Grupo> Idgrupos { get; set; } = new List<Grupo>();
}

View File

@@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Servicio
{
public int Id { get; set; }
public string Descripcion { get; set; } = null!;
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class ServicioPropiedade
{
public int? Idpropiedad { get; set; }
public int? Idservicio { get; set; }
public virtual Propiedad? IdpropiedadNavigation { get; set; }
public virtual Servicio? IdservicioNavigation { get; set; }
}

View File

@@ -1,11 +1,19 @@
public class Usuario
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Usuario
{
public long Dni { get; set; }
public long Cuil { get; set; }
public string Nombre { get; set; } = null!;
public string Apellido { get; set; } = null!;
public string Email { get; set; } = null!;
public string Celular { get; set; } = null!;
public string Domicilio { get; set; } = null!;
public byte[]? Contrasena { get; set; }
}
public int id { get; set; }
public string email { get; set; } = null!;
public byte[] contraseña { get; set; } = null!;
public string token { get; set; } = null!;
public virtual ICollection<Cliente> Clientes { get; set; } = new List<Cliente>();
public virtual ICollection<Grupo> idgrupos { get; set; } = new List<Grupo>();
}

33
Entidades/Venta.cs Normal file
View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Venta
{
public long id { get; set; }
public decimal monto { get; set; }
public long? idprop_old { get; set; }
public long? idprop_new { get; set; }
public int? idestado { get; set; }
public int? idpropiedad { get; set; }
public DateTime fechainicio { get; set; }
public DateTime? fechafinal { get; set; }
public virtual ICollection<Contrato> Contratos { get; set; } = new List<Contrato>();
public virtual Estadoventum? idestadoNavigation { get; set; }
public virtual Cliente? idprop_newNavigation { get; set; }
public virtual Cliente? idprop_oldNavigation { get; set; }
public virtual Propiedade? idpropiedadNavigation { get; set; }
}

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Verifica si hay archivos .cs en el directorio
if ls *.cs 1> /dev/null 2>&1; then
# Bucle para procesar cada archivo .cs
for file in *.cs; do
# Genera el nombre en PascalCase: convierte todo a minúscula primero, luego la primera letra de cada palabra a mayúscula y elimina los guiones bajos
new_name=$(echo "$file" | tr '[:upper:]' '[:lower:]' | sed -E "s/(^|_)([a-z])/\U\2/g" | sed "s/_//g")
# Renombra el archivo
mv "$file" "$new_name"
done
echo "Renombrado completado."
else
echo "No se encontraron archivos .cs en el directorio."
fi

6
Entidades/makefile Normal file
View File

@@ -0,0 +1,6 @@
run:
dotnet ef dbcontext scaffold "Server=fedesrv.ddns.net;Port=30006;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none" MySql.EntityFrameworkCore -o . --use-database-names
./convert_to_pascalcase.sh
clean:
rm *.cs