diff --git a/Data/Model/Alumno.cs b/Data/Model/Alumno.cs index 5b1dad6..98d7c1a 100644 --- a/Data/Model/Alumno.cs +++ b/Data/Model/Alumno.cs @@ -65,7 +65,7 @@ public class Alumno [StringLength(100, ErrorMessage = "El campo Correo debe tener como máximo 100 caracteres.")] [EmailAddress(ErrorMessage = "El campo Correo debe ser una dirección de correo válida.")] - public string Correo { get; set; } = string.Empty; + public string? Correo { get; set; } = string.Empty; [StringLength(150, ErrorMessage = "El campo Dirección debe tener como máximo 150 caracteres.")] public string Direccion { get; set; } = string.Empty; diff --git a/Data/Seed/SeedAlumnosTutores.cs b/Data/Seed/SeedAlumnosTutores.cs index 393017d..009547b 100644 --- a/Data/Seed/SeedAlumnosTutores.cs +++ b/Data/Seed/SeedAlumnosTutores.cs @@ -1,4 +1,4 @@ -/*namespace OyeIap.Server.Data.Seed; +namespace OyeIap.Server.Data.Seed; internal class SeedAlumnosTutores : Seed { private readonly string[] _nombres = new[] { @@ -202,5 +202,4 @@ private string GetTutorFirstLastName(Alumno alumno, Parentesco parentesco, ref b private static bool IsParent(Parentesco parentesco) => parentesco == Parentesco.Padre || parentesco == Parentesco.Madre; -} -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/Data/Seed/SeedInstituciones.cs b/Data/Seed/SeedInstituciones.cs index 18a252a..fc5751b 100644 --- a/Data/Seed/SeedInstituciones.cs +++ b/Data/Seed/SeedInstituciones.cs @@ -1,4 +1,4 @@ -/*namespace OyeIap.Server.Data.Seed; +namespace OyeIap.Server.Data.Seed; internal class SeedInstituciones : Seed { private readonly string[] _nombres = [ @@ -106,5 +106,4 @@ public async Task SeedDatabaseWithInstitucionCountOfAsync(ApplicationDbContext c currentCycle = 0; } } -} -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/DatabaseUtility.cs b/DatabaseUtility.cs index 55aa0b5..a073d82 100644 --- a/DatabaseUtility.cs +++ b/DatabaseUtility.cs @@ -25,8 +25,8 @@ public static async Task EnsureDbCreatedAndSeedWithCountOfAsync(DbContextOptions { var seedInstituciones = new SeedInstituciones(); var seedAlumnos = new SeedAlumnosTutores(); - await seedInstituciones.SeedDatabaseWithInstitucionCountOfAsync(context, 10); - await seedAlumnos.SeedDatabaseWithAlumnoCountOfAsync(context, 10); + await seedInstituciones.SeedDatabaseWithInstitucionCountOfAsync(context, 0); + await seedAlumnos.SeedDatabaseWithAlumnoCountOfAsync(context, 0); await transaction.CommitAsync(); } diff --git a/Pages/AlumnosTable.razor b/Pages/AlumnosTable.razor index 18e4114..3266367 100644 --- a/Pages/AlumnosTable.razor +++ b/Pages/AlumnosTable.razor @@ -61,7 +61,7 @@
-  Fecha de Ingreso +  Fecha de Ingreso
diff --git a/Pages/ViewAlumno.razor b/Pages/ViewAlumno.razor index 44864dd..e38a864 100644 --- a/Pages/ViewAlumno.razor +++ b/Pages/ViewAlumno.razor @@ -35,10 +35,13 @@ else Detalles de alumno Activo: @(Alumno.Activo ? "Si" : "No") - Fecha Ingreso: @Alumno.FechaIngreso - @if (Alumno.FechaEgreso.HasValue) + @if (Alumno.FechaIngreso != DateOnly.MinValue) { - Fecha Egreso: @Alumno.FechaEgreso.Value.ToString("dd-MM-yyyy") + Fecha Ingreso: @Alumno.FechaIngreso.ToString("dd-MM-yyyy") + } + @if (Alumno.Activo == false && Alumno.FechaEgreso != DateOnly.MinValue) + { + Fecha Egreso: @Alumno.FechaEgreso.ToString("dd-MM-yyyy") } @@ -46,19 +49,19 @@ else Datos sobre el Alumno El alumno usa aparato? @(Alumno.Aparato ? "Si" : "No") - @if (Alumno.Aparato && Alumno.FechaAparato is DateOnly fechaAparato) + @if (Alumno.Aparato && Alumno.FechaAparato is DateOnly fechaAparato && fechaAparato != DateOnly.MinValue) { Fecha de Aparato: @fechaAparato.ToString("dd-MM-yyyy") - @if(Alumno.Aparato && Alumno.FechaProgramacion is DateOnly fechaProgramacion) + @if (Alumno.Aparato && Alumno.FechaProgramacion is DateOnly fechaProgramacion && fechaProgramacion != DateOnly.MinValue) { Fecha de Porgramacion: @fechaProgramacion.ToString("dd-MM-yyyy") } } El alumno tiene implante? @(Alumno.Implante ? "Si" : "No") - @if (Alumno.Aparato && Alumno.FechaImplante is DateOnly fechaImplante) - { + @if (Alumno.Implante && Alumno.FechaImplante is DateOnly fechaImplante && fechaImplante != DateOnly.MinValue) + { Fecha de Implante: @fechaImplante.ToString("dd-MM-yyyy") - @if (Alumno.Aparato && Alumno.FechaConexion is DateOnly fechaConexion) + @if (Alumno.Implante && Alumno.FechaConexion is DateOnly fechaConexion && fechaConexion != DateOnly.MinValue) { Fecha de Conexion: @fechaConexion.ToString("dd-MM-yyyy") } diff --git a/Pages/ViewInstitucion.razor b/Pages/ViewInstitucion.razor index 01b25c8..042a3a6 100644 --- a/Pages/ViewInstitucion.razor +++ b/Pages/ViewInstitucion.razor @@ -52,7 +52,7 @@ else Patrocinio - @if (Institucion.PatrocinioActivo && Institucion.Donacion is decimal donacion) + @if (Institucion.PatrocinioActivo && Institucion.Donacion is decimal donacion && donacion != 0) { Donacion: @donacion.ToString("") @if (Institucion.PatrocinioActivo && Institucion.DetallesAyuda is string detalles) diff --git a/Shared/ConcurrencyField.razor b/Shared/ConcurrencyField.razor index 40e0ad1..1593349 100644 --- a/Shared/ConcurrencyField.razor +++ b/Shared/ConcurrencyField.razor @@ -8,7 +8,7 @@ } else { - (same) + } }