Mantenimiento de Miembros
This commit is contained in:
106
RS_system/Views/Miembro/Create.cshtml
Normal file
106
RS_system/Views/Miembro/Create.cshtml
Normal file
@@ -0,0 +1,106 @@
|
||||
@model Rs_system.Models.ViewModels.MiembroViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Nuevo Miembro";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Nuevo Miembro</h4>
|
||||
<p class="text-muted mb-0">Registrar un nuevo miembro de la congregación</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i> Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card-custom">
|
||||
<form asp-action="Create" method="post" enctype="multipart/form-data">
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger"></div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Nombres" class="form-label"></label>
|
||||
<input asp-for="Nombres" class="form-control" placeholder="Ingrese los nombres" />
|
||||
<span asp-validation-for="Nombres" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Apellidos" class="form-label"></label>
|
||||
<input asp-for="Apellidos" class="form-control" placeholder="Ingrese los apellidos" />
|
||||
<span asp-validation-for="Apellidos" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FechaNacimiento" class="form-label"></label>
|
||||
<input asp-for="FechaNacimiento" type="date" class="form-control" />
|
||||
<span asp-validation-for="FechaNacimiento" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FechaIngresoCongregacion" class="form-label"></label>
|
||||
<input asp-for="FechaIngresoCongregacion" type="date" class="form-control" />
|
||||
<span asp-validation-for="FechaIngresoCongregacion" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Telefono" class="form-label"></label>
|
||||
<input asp-for="Telefono" class="form-control" placeholder="Ej: 7890-1234" />
|
||||
<span asp-validation-for="Telefono" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="TelefonoEmergencia" class="form-label"></label>
|
||||
<input asp-for="TelefonoEmergencia" class="form-control" placeholder="Ej: 7890-5678" />
|
||||
<span asp-validation-for="TelefonoEmergencia" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label asp-for="Direccion" class="form-label"></label>
|
||||
<textarea asp-for="Direccion" class="form-control" rows="3" placeholder="Ingrese la dirección completa"></textarea>
|
||||
<span asp-validation-for="Direccion" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="GrupoTrabajoId" class="form-label"></label>
|
||||
<select asp-for="GrupoTrabajoId" class="form-select" asp-items="ViewBag.GruposTrabajo">
|
||||
<option value="">Seleccione un grupo de trabajo</option>
|
||||
</select>
|
||||
<span asp-validation-for="GrupoTrabajoId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label d-block"> </label>
|
||||
<div class="form-check">
|
||||
<input asp-for="BautizadoEspirituSanto" class="form-check-input" type="checkbox" />
|
||||
<label asp-for="BautizadoEspirituSanto" class="form-check-label"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<label asp-for="FotoFile" class="form-label"></label>
|
||||
<input asp-for="FotoFile" type="file" class="form-control" accept="image/*" />
|
||||
<span asp-validation-for="FotoFile" class="text-danger"></span>
|
||||
<div class="form-text">Formatos permitidos: JPG, PNG, GIF. Tamaño máximo: 5MB</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input asp-for="Activo" class="form-check-input" type="checkbox" checked />
|
||||
<label asp-for="Activo" class="form-check-label"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a asp-action="Index" class="btn btn-secondary">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom">
|
||||
<i class="bi bi-save me-1"></i> Guardar
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
199
RS_system/Views/Miembro/Details.cshtml
Normal file
199
RS_system/Views/Miembro/Details.cshtml
Normal file
@@ -0,0 +1,199 @@
|
||||
@model Rs_system.Models.ViewModels.MiembroViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Detalles del Miembro";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Detalles del Miembro</h4>
|
||||
<p class="text-muted mb-0">Información completa del miembro</p>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-outline-primary">
|
||||
<i class="bi bi-pencil me-1"></i> Editar
|
||||
</a>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i> Volver
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-custom">
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3 text-center">
|
||||
<h6 class="text-muted mb-2">Foto del Miembro</h6>
|
||||
@if (!string.IsNullOrEmpty(Model.FotoUrl))
|
||||
{
|
||||
<img src="/@Model.FotoUrl" alt="Foto de @Model.NombreCompleto" class="img-fluid rounded" style="max-height: 200px; object-fit: cover;" />
|
||||
<div class="mt-2">
|
||||
<a href="/@Model.FotoUrl" target="_blank" class="btn btn-sm btn-outline-info">
|
||||
<i class="bi bi-eye me-1"></i> Ver foto completa
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex flex-column align-items-center">
|
||||
<i class="bi bi-person-circle text-muted" style="font-size: 6rem;"></i>
|
||||
<span class="text-muted small">No hay foto registrada</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Nombres</h6>
|
||||
<p class="mb-0">@Model.Nombres</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Apellidos</h6>
|
||||
<p class="mb-0">@Model.Apellidos</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-3" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Fecha de Nacimiento</h6>
|
||||
<p class="mb-0">
|
||||
@if (Model.FechaNacimiento.HasValue)
|
||||
{
|
||||
<span>@Model.FechaNacimiento.Value.ToString("dd/MM/yyyy")</span>
|
||||
<span class="text-muted">
|
||||
(@{
|
||||
var edad = DateTime.Today.Year - Model.FechaNacimiento.Value.Year;
|
||||
if (Model.FechaNacimiento.Value.ToDateTime(TimeOnly.MinValue) > DateTime.Today.AddYears(-edad))
|
||||
edad--;
|
||||
}
|
||||
@edad años)
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">No especificado</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Fecha de Ingreso a la Congregación</h6>
|
||||
<p class="mb-0">
|
||||
@if (Model.FechaIngresoCongregacion.HasValue)
|
||||
{
|
||||
<span>@Model.FechaIngresoCongregacion.Value.ToString("dd/MM/yyyy")</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">No especificado</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-3" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Teléfono</h6>
|
||||
<p class="mb-0">
|
||||
@if (!string.IsNullOrEmpty(Model.Telefono))
|
||||
{
|
||||
<i class="bi bi-telephone me-1"></i>
|
||||
<span>@Model.Telefono</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">No especificado</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Teléfono de Emergencia</h6>
|
||||
<p class="mb-0">
|
||||
@if (!string.IsNullOrEmpty(Model.TelefonoEmergencia))
|
||||
{
|
||||
<i class="bi bi-telephone-fill me-1 text-danger"></i>
|
||||
<span>@Model.TelefonoEmergencia</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">No especificado</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-3" />
|
||||
|
||||
<div class="mb-3">
|
||||
<h6 class="text-muted mb-2">Dirección</h6>
|
||||
<p class="mb-0">
|
||||
@if (!string.IsNullOrEmpty(Model.Direccion))
|
||||
{
|
||||
<i class="bi bi-geo-alt me-1"></i>
|
||||
<span>@Model.Direccion</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">No especificado</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<hr class="my-3" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Grupo de Trabajo</h6>
|
||||
<p class="mb-0">
|
||||
@if (!string.IsNullOrEmpty(Model.GrupoTrabajoNombre))
|
||||
{
|
||||
<span class="badge bg-primary">@Model.GrupoTrabajoNombre</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">Sin grupo asignado</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted mb-2">Bautizado en el Espíritu Santo</h6>
|
||||
<p class="mb-0">
|
||||
@if (Model.BautizadoEspirituSanto)
|
||||
{
|
||||
<span class="badge bg-success">
|
||||
<i class="bi bi-check-circle me-1"></i> Sí
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge bg-secondary">
|
||||
<i class="bi bi-x-circle me-1"></i> No
|
||||
</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-3" />
|
||||
|
||||
<div class="mb-3">
|
||||
<h6 class="text-muted mb-2">Estado</h6>
|
||||
<p class="mb-0">
|
||||
@if (Model.Activo)
|
||||
{
|
||||
<span class="badge bg-success">
|
||||
<i class="bi bi-check-circle me-1"></i> Activo
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge bg-warning">
|
||||
<i class="bi bi-pause-circle me-1"></i> Inactivo
|
||||
</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
130
RS_system/Views/Miembro/Edit.cshtml
Normal file
130
RS_system/Views/Miembro/Edit.cshtml
Normal file
@@ -0,0 +1,130 @@
|
||||
@model Rs_system.Models.ViewModels.MiembroViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Editar Miembro";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Editar Miembro</h4>
|
||||
<p class="text-muted mb-0">Actualizar información del miembro</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i> Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger"></div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Nombres" class="form-label"></label>
|
||||
<input asp-for="Nombres" class="form-control" placeholder="Ingrese los nombres" />
|
||||
<span asp-validation-for="Nombres" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Apellidos" class="form-label"></label>
|
||||
<input asp-for="Apellidos" class="form-control" placeholder="Ingrese los apellidos" />
|
||||
<span asp-validation-for="Apellidos" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FechaNacimiento" class="form-label"></label>
|
||||
<input asp-for="FechaNacimiento" type="date" class="form-control" />
|
||||
<span asp-validation-for="FechaNacimiento" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FechaIngresoCongregacion" class="form-label"></label>
|
||||
<input asp-for="FechaIngresoCongregacion" type="date" class="form-control" />
|
||||
<span asp-validation-for="FechaIngresoCongregacion" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Telefono" class="form-label"></label>
|
||||
<input asp-for="Telefono" class="form-control" placeholder="Ej: 7890-1234" />
|
||||
<span asp-validation-for="Telefono" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="TelefonoEmergencia" class="form-label"></label>
|
||||
<input asp-for="TelefonoEmergencia" class="form-control" placeholder="Ej: 7890-5678" />
|
||||
<span asp-validation-for="TelefonoEmergencia" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label asp-for="Direccion" class="form-label"></label>
|
||||
<textarea asp-for="Direccion" class="form-control" rows="3" placeholder="Ingrese la dirección completa"></textarea>
|
||||
<span asp-validation-for="Direccion" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="GrupoTrabajoId" class="form-label"></label>
|
||||
<select asp-for="GrupoTrabajoId" class="form-select" asp-items="ViewBag.GruposTrabajo">
|
||||
<option value="">Seleccione un grupo de trabajo</option>
|
||||
</select>
|
||||
<span asp-validation-for="GrupoTrabajoId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label d-block"> </label>
|
||||
<div class="form-check">
|
||||
<input asp-for="BautizadoEspirituSanto" class="form-check-input" type="checkbox" />
|
||||
<label asp-for="BautizadoEspirituSanto" class="form-check-label"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FotoFile" class="form-label"></label>
|
||||
<input asp-for="FotoFile" type="file" class="form-control" accept="image/*" />
|
||||
<span asp-validation-for="FotoFile" class="text-danger"></span>
|
||||
<div class="form-text">Deje en blanco para mantener la foto actual. Formatos: JPG, PNG, GIF. Máx: 5MB</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Foto Actual</label>
|
||||
@if (!string.IsNullOrEmpty(Model.FotoUrl))
|
||||
{
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<img src="/@Model.FotoUrl" alt="Foto del miembro" class="img-thumbnail" style="max-width: 80px; max-height: 80px; object-fit: cover;" />
|
||||
<div>
|
||||
<small class="text-muted d-block">Foto actual</small>
|
||||
<a href="/@Model.FotoUrl" target="_blank" class="btn btn-sm btn-outline-info">Ver</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted">
|
||||
<i class="bi bi-person-circle" style="font-size: 2rem;"></i>
|
||||
<p class="mb-0 small">No hay foto registrada</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input asp-for="Activo" class="form-check-input" type="checkbox" />
|
||||
<label asp-for="Activo" class="form-check-label"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a asp-action="Index" class="btn btn-secondary">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom">
|
||||
<i class="bi bi-save me-1"></i> Actualizar
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
196
RS_system/Views/Miembro/Index.cshtml
Normal file
196
RS_system/Views/Miembro/Index.cshtml
Normal file
@@ -0,0 +1,196 @@
|
||||
@model IEnumerable<Rs_system.Models.ViewModels.MiembroViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Miembros de la Iglesia";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Miembros en Propiedad</h4>
|
||||
<p class="text-muted mb-0">Gestión de miembros de la congregación</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-plus-lg me-1"></i> Nuevo Miembro
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Summary Cards -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-4">
|
||||
<div class="card-custom text-center">
|
||||
<h6 class="text-muted mb-2">Total Miembros</h6>
|
||||
<h3 class="text-primary mb-0">@Model.Count()</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card-custom text-center">
|
||||
<h6 class="text-muted mb-2">Bautizados en el Espíritu Santo</h6>
|
||||
<h3 class="text-success mb-0">@Model.Count(m => m.BautizadoEspirituSanto)</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card-custom text-center">
|
||||
<h6 class="text-muted mb-2">Grupos de Trabajo</h6>
|
||||
<h3 class="text-info mb-0">@Model.Where(m => m.GrupoTrabajoId.HasValue).GroupBy(m => m.GrupoTrabajoId).Count()</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Members Table -->
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Foto</th>
|
||||
<th>Nombre Completo</th>
|
||||
<th>Fecha de Nacimiento</th>
|
||||
<th>Grupo de Trabajo</th>
|
||||
<th class="text-center">Bautizado E.S.</th>
|
||||
<th>Teléfono</th>
|
||||
<th>Fecha Ingreso</th>
|
||||
<th class="text-center">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!Model.Any())
|
||||
{
|
||||
<tr>
|
||||
<td colspan="8" class="text-center text-muted py-4">
|
||||
<i class="bi bi-people fs-1 d-block mb-2"></i>
|
||||
No hay miembros registrados
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var miembro in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
@if (!string.IsNullOrEmpty(miembro.FotoUrl))
|
||||
{
|
||||
<img src="/@miembro.FotoUrl" alt="@miembro.NombreCompleto" class="img-thumbnail" style="width: 40px; height: 40px; object-fit: cover;" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="bi bi-person-circle text-muted" style="font-size: 2rem;"></i>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<strong>@miembro.NombreCompleto</strong>
|
||||
</td>
|
||||
<td>
|
||||
@if (miembro.FechaNacimiento.HasValue)
|
||||
{
|
||||
<span>@miembro.FechaNacimiento.Value.ToString("dd/MM/yyyy")</span>
|
||||
<br>
|
||||
<small class="text-muted">
|
||||
@{
|
||||
var edad = DateTime.Today.Year - miembro.FechaNacimiento.Value.Year;
|
||||
if (miembro.FechaNacimiento.Value.ToDateTime(TimeOnly.MinValue) > DateTime.Today.AddYears(-edad))
|
||||
edad--;
|
||||
}
|
||||
@edad años
|
||||
</small>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">-</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (!string.IsNullOrEmpty(miembro.GrupoTrabajoNombre))
|
||||
{
|
||||
<span class="badge bg-primary">@miembro.GrupoTrabajoNombre</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">Sin grupo</span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (miembro.BautizadoEspirituSanto)
|
||||
{
|
||||
<i class="bi bi-check-circle-fill text-success" title="Sí"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="bi bi-x-circle text-muted" title="No"></i>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (!string.IsNullOrEmpty(miembro.Telefono))
|
||||
{
|
||||
<span>@miembro.Telefono</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">-</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (miembro.FechaIngresoCongregacion.HasValue)
|
||||
{
|
||||
<span>@miembro.FechaIngresoCongregacion.Value.ToString("dd/MM/yyyy")</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted">-</span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a asp-action="Details" asp-route-id="@miembro.Id" class="btn btn-sm btn-outline-primary" title="Ver detalles">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<a asp-action="Edit" asp-route-id="@miembro.Id" class="btn btn-sm btn-outline-secondary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="confirmDelete(@miembro.Id)" title="Eliminar">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Form -->
|
||||
<form id="deleteForm" asp-action="Delete" method="post" style="display: none;">
|
||||
<input type="hidden" name="id" id="deleteId" />
|
||||
</form>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
function confirmDelete(id) {
|
||||
Swal.fire({
|
||||
title: '¿Eliminar miembro?',
|
||||
text: 'Esta acción no se puede deshacer.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d33',
|
||||
cancelButtonColor: '#6c757d',
|
||||
confirmButtonText: 'Sí, eliminar',
|
||||
cancelButtonText: 'Cancelar'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
document.getElementById('deleteId').value = id;
|
||||
document.getElementById('deleteForm').submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Show success/error messages
|
||||
@if (TempData["SuccessMessage"] != null)
|
||||
{
|
||||
<text>
|
||||
toastr.success('@TempData["SuccessMessage"]');
|
||||
</text>
|
||||
}
|
||||
@if (TempData["ErrorMessage"] != null)
|
||||
{
|
||||
<text>
|
||||
toastr.error('@TempData["ErrorMessage"]');
|
||||
</text>
|
||||
}
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user