Agregar archivos de proyecto.
This commit is contained in:
9
MieSystem/Models/ErrorViewModel.cs
Normal file
9
MieSystem/Models/ErrorViewModel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace MieSystem.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
55
MieSystem/Models/Expediente.cs
Normal file
55
MieSystem/Models/Expediente.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace MieSystem.Models
|
||||
{
|
||||
public class Expediente
|
||||
{
|
||||
[Column("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("nombre")]
|
||||
public string Nombre { get; set; }
|
||||
|
||||
[Column("apellidos")]
|
||||
public string Apellidos { get; set; }
|
||||
|
||||
[Column("fecha_nacimiento")]
|
||||
public DateTime FechaNacimiento { get; set; }
|
||||
|
||||
[Column("nombre_padre")]
|
||||
public string NombrePadre { get; set; }
|
||||
|
||||
[Column("nombre_madre")]
|
||||
public string NombreMadre { get; set; }
|
||||
|
||||
[Column("nombre_responsable")]
|
||||
public string NombreResponsable { get; set; }
|
||||
|
||||
[Column("parentesco_responsable")]
|
||||
public string ParentescoResponsable { get; set; }
|
||||
|
||||
[Column("sexo")]
|
||||
public string Sexo { get; set; }
|
||||
|
||||
[Column("direccion")]
|
||||
public string Direccion { get; set; }
|
||||
|
||||
[Column("telefono")]
|
||||
public string Telefono { get; set; }
|
||||
|
||||
[Column("observaciones")]
|
||||
public string Observaciones { get; set; }
|
||||
|
||||
[Column("foto_url")]
|
||||
public string FotoUrl { get; set; }
|
||||
|
||||
[Column("fecha_creacion")]
|
||||
public DateTime FechaCreacion { get; set; }
|
||||
|
||||
[Column("fecha_actualizacion")]
|
||||
public DateTime FechaActualizacion { get; set; }
|
||||
|
||||
[Column("activo")]
|
||||
public bool Activo { get; set; }
|
||||
}
|
||||
}
|
||||
82
MieSystem/Models/ExpedienteViewModel.cs
Normal file
82
MieSystem/Models/ExpedienteViewModel.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MieSystem.Models
|
||||
{
|
||||
public class ExpedienteViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "El nombre es requerido")]
|
||||
[StringLength(100, ErrorMessage = "El nombre no puede exceder 100 caracteres")]
|
||||
[Display(Name = "Nombre")]
|
||||
public string Nombre { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Los apellidos son requeridos")]
|
||||
[StringLength(100, ErrorMessage = "Los apellidos no pueden exceder 100 caracteres")]
|
||||
[Display(Name = "Apellidos")]
|
||||
public string Apellidos { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "La fecha de nacimiento es requerida")]
|
||||
[DataType(DataType.Date)]
|
||||
[Display(Name = "Fecha de Nacimiento")]
|
||||
public DateTime FechaNacimiento { get; set; }
|
||||
|
||||
[Display(Name = "Nombre del Padre")]
|
||||
[StringLength(100, ErrorMessage = "El nombre no puede exceder 100 caracteres")]
|
||||
public string NombrePadre { get; set; }
|
||||
|
||||
[Display(Name = "Nombre de la Madre")]
|
||||
[StringLength(100, ErrorMessage = "El nombre no puede exceder 100 caracteres")]
|
||||
public string NombreMadre { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "El nombre del responsable es requerido")]
|
||||
[StringLength(100, ErrorMessage = "El nombre no puede exceder 100 caracteres")]
|
||||
[Display(Name = "Nombre del Responsable")]
|
||||
public string NombreResponsable { get; set; }
|
||||
|
||||
[Display(Name = "Parentesco del Responsable")]
|
||||
public string ParentescoResponsable { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "El sexo es requerido")]
|
||||
[Display(Name = "Sexo")]
|
||||
public string Sexo { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "La dirección es requerida")]
|
||||
[StringLength(200, ErrorMessage = "La dirección no puede exceder 200 caracteres")]
|
||||
[Display(Name = "Dirección")]
|
||||
public string Direccion { get; set; }
|
||||
|
||||
[Display(Name = "Teléfono")]
|
||||
[Phone(ErrorMessage = "Formato de teléfono inválido")]
|
||||
public string Telefono { get; set; }
|
||||
|
||||
[Display(Name = "Observaciones")]
|
||||
[StringLength(500, ErrorMessage = "Las observaciones no pueden exceder 500 caracteres")]
|
||||
public string Observaciones { get; set; }
|
||||
|
||||
[Display(Name = "Foto")]
|
||||
[DataType(DataType.Upload)]
|
||||
public IFormFile Foto { get; set; }
|
||||
|
||||
public string FotoUrl { get; set; }
|
||||
|
||||
[Display(Name = "Edad")]
|
||||
public int Edad
|
||||
{
|
||||
get
|
||||
{
|
||||
if (FechaNacimiento == default) return 0;
|
||||
|
||||
var today = DateTime.Today;
|
||||
var age = today.Year - FechaNacimiento.Year;
|
||||
if (FechaNacimiento.Date > today.AddYears(-age)) age--;
|
||||
return age;
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = "Nombre Completo")]
|
||||
public string NombreCompleto => $"{Nombre} {Apellidos}";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user