first commit
This commit is contained in:
18
RS_system/Views/Account/AccessDenied.cshtml
Normal file
18
RS_system/Views/Account/AccessDenied.cshtml
Normal file
@@ -0,0 +1,18 @@
|
||||
@{
|
||||
ViewData["Title"] = "Acceso Denegado";
|
||||
}
|
||||
|
||||
<div class="container text-center py-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h1 class="display-1 fw-bold text-danger">403</h1>
|
||||
<h2 class="mb-4">Acceso Denegado</h2>
|
||||
<p class="text-muted mb-4">
|
||||
No tienes permisos para acceder a esta página.
|
||||
</p>
|
||||
<a asp-controller="Home" asp-action="Index" class="btn btn-primary">
|
||||
Volver al Inicio
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
79
RS_system/Views/Account/Login.cshtml
Normal file
79
RS_system/Views/Account/Login.cshtml
Normal file
@@ -0,0 +1,79 @@
|
||||
@model Rs_system.Models.ViewModels.LoginViewModel
|
||||
@inject Rs_system.Services.IConfiguracionService ConfigService
|
||||
@{
|
||||
ViewData["Title"] = "Iniciar Sesión";
|
||||
Layout = null;
|
||||
var nameShort = await ConfigService.GetValorOrDefaultAsync("NAME__CHURCH_SHORT", "FarmMan");
|
||||
var name = await ConfigService.GetValorOrDefaultAsync("NAME_CHURCH", "FarmMan");
|
||||
var logoUrl = await ConfigService.GetValorOrDefaultAsync("LOGO_FOUNDATION", "/assets/home.png");
|
||||
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>@ViewData["Title"] - @nameShort</title>
|
||||
<link rel="stylesheet" href="~/css/inter.css" asp-append-version="true" />
|
||||
<link href="~/css/css2.css?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="~/css/farmman-login.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/all.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="farmman-login-container">
|
||||
<div class="farmman-login-card">
|
||||
<div class="farmman-split-screen">
|
||||
<!-- Left Column: Image -->
|
||||
<div class="farmman-left-column"></div>
|
||||
|
||||
<!-- Right Column: Login Form -->
|
||||
<div class="farmman-right-column">
|
||||
<div class="farmman-logo-header">
|
||||
<div class="farmman-logo-icon">
|
||||
<i class="fa-solid fa-church"></i>
|
||||
</div>
|
||||
<div class="farmman-logo-text">@name</div>
|
||||
</div>
|
||||
|
||||
<h1 class="farmman-welcome-title">Hola,<br>Bienvenido</h1>
|
||||
<p class="farmman-welcome-subtitle">Inicia sesión en @nameShort</p>
|
||||
|
||||
@if (TempData["SuccessMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<i class="bi bi-check-circle-fill me-2"></i>
|
||||
@TempData["SuccessMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<form asp-action="Login" method="post">
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger mb-3"></div>
|
||||
|
||||
<div class="farmman-form-group">
|
||||
<input asp-for="NombreUsuario" class="farmman-form-control" placeholder="Usuario" autofocus autocomplete="username"/>
|
||||
<span asp-validation-for="NombreUsuario" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="farmman-form-group">
|
||||
<input asp-for="Contrasena" class="farmman-form-control" placeholder="Contraseña" autocomplete="current-password"/>
|
||||
<span asp-validation-for="Contrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="farmman-login-btn">
|
||||
Iniciar Sesión
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
138
RS_system/Views/Account/Register.cshtml
Normal file
138
RS_system/Views/Account/Register.cshtml
Normal file
@@ -0,0 +1,138 @@
|
||||
@model Rs_system.Models.ViewModels.RegisterViewModel
|
||||
@inject Rs_system.Services.IConfiguracionService ConfigService
|
||||
@{
|
||||
ViewData["Title"] = "Crear Cuenta";
|
||||
Layout = null;
|
||||
var nameShort = await ConfigService.GetValorOrDefaultAsync("NAME_FOUNDATION_SHORT", "Rs_system");
|
||||
var logoUrl = await ConfigService.GetValorOrDefaultAsync("LOGO_FOUNDATION", "/assets/home.png");
|
||||
var nameFoundation = await ConfigService.GetValorOrDefaultAsync("NAME_FOUNDATION", "Rs_system");
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>@ViewData["Title"] - @nameShort</title>
|
||||
<link href="~/css/css2.css?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="~/css/auth.css" asp-append-version="true"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="auth-container">
|
||||
<div class="auth-background">
|
||||
<div class="auth-gradient"></div>
|
||||
<div class="auth-pattern"></div>
|
||||
</div>
|
||||
|
||||
<div class="auth-card auth-card-register animate-fade-in">
|
||||
<div class="auth-header">
|
||||
<div class="auth-logo">
|
||||
<img src="@logoUrl" alt="Logo" class="img-fluid mb-3" style="max-height: 80px; width: auto; object-fit: contain;" />
|
||||
</div>
|
||||
<h1 class="auth-title">Crear Cuenta</h1>
|
||||
<p class="auth-subtitle">Únete a @nameShort - @nameFoundation</p>
|
||||
</div>
|
||||
|
||||
<form asp-action="Register" method="post" class="auth-form">
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger mb-3"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input asp-for="Nombres" class="form-control" id="nombres" placeholder="Nombres" autofocus/>
|
||||
<label for="nombres">Nombres</label>
|
||||
<span asp-validation-for="Nombres" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input asp-for="Apellidos" class="form-control" id="apellidos" placeholder="Apellidos"/>
|
||||
<label for="apellidos">Apellidos</label>
|
||||
<span asp-validation-for="Apellidos" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input asp-for="NombreUsuario" class="form-control" id="username" placeholder="Nombre de Usuario" autocomplete="username"/>
|
||||
<label for="username">
|
||||
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
||||
<circle cx="12" cy="7" r="4"/>
|
||||
</svg>
|
||||
Nombre de Usuario
|
||||
</label>
|
||||
<span asp-validation-for="NombreUsuario" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input asp-for="Email" class="form-control" id="email" placeholder="Correo Electrónico" type="email" autocomplete="email"/>
|
||||
<label for="email">
|
||||
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
|
||||
<polyline points="22,6 12,13 2,6"/>
|
||||
</svg>
|
||||
Correo Electrónico
|
||||
</label>
|
||||
<span asp-validation-for="Email" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input asp-for="Contrasena" class="form-control" id="password" placeholder="Contraseña" autocomplete="new-password"/>
|
||||
<label for="password">
|
||||
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
|
||||
<path d="M7 11V7a5 5 0 0 1 10 0v4"/>
|
||||
</svg>
|
||||
Contraseña
|
||||
</label>
|
||||
<span asp-validation-for="Contrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input asp-for="ConfirmarContrasena" class="form-control" id="confirmPassword" placeholder="Confirmar Contraseña" autocomplete="new-password"/>
|
||||
<label for="confirmPassword">
|
||||
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
|
||||
</svg>
|
||||
Confirmar
|
||||
</label>
|
||||
<span asp-validation-for="ConfirmarContrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-auth">
|
||||
<span>Crear Cuenta</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
||||
<circle cx="8.5" cy="7" r="4"/>
|
||||
<line x1="20" y1="8" x2="20" y2="14"/>
|
||||
<line x1="23" y1="11" x2="17" y2="11"/>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="auth-footer">
|
||||
<p>¿Ya tienes una cuenta?</p>
|
||||
<a asp-action="Login" class="auth-link">Iniciar Sesión</a>
|
||||
</div>
|
||||
|
||||
<div class="auth-branding">
|
||||
<span>Sistema de Gestión</span>
|
||||
<span class="separator">•</span>
|
||||
<span>@nameFoundation</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
244
RS_system/Views/AsistenciaCulto/Create.cshtml
Normal file
244
RS_system/Views/AsistenciaCulto/Create.cshtml
Normal file
@@ -0,0 +1,244 @@
|
||||
@model Rs_system.Models.ViewModels.AsistenciaCultoViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Nuevo Registro de Asistencia";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Nuevo Registro</h2>
|
||||
<p class="text-muted small mb-0">Registre la asistencia de un culto o actividad eclesiástica.</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Create" method="post" id="asistenciaForm">
|
||||
@Html.AntiForgeryToken()
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger"></div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">
|
||||
<i class="bi bi-calendar-event me-2"></i>Información del Culto
|
||||
</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FechaHoraInicio" class="form-label fw-semibold"></label>
|
||||
<input asp-for="FechaHoraInicio" type="datetime-local" class="form-control" />
|
||||
<span asp-validation-for="FechaHoraInicio" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="TipoCulto" class="form-label fw-semibold"></label>
|
||||
<select asp-for="TipoCulto" asp-items="@(new SelectList(ViewBag.TiposCulto))" class="form-select">
|
||||
<option value="">-- Seleccione --</option>
|
||||
</select>
|
||||
<span asp-validation-for="TipoCulto" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">
|
||||
<i class="bi bi-people me-2"></i>Tipo de Conteo
|
||||
</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<div class="btn-group w-100" role="group" aria-label="Tipo de conteo">
|
||||
@foreach (var tipo in ViewBag.TiposConteo as List<Rs_system.Models.Enums.TipoConteo>)
|
||||
{
|
||||
<input type="radio" class="btn-check" name="TipoConteo" id="tipo@((int)tipo)" value="@((int)tipo)"
|
||||
@(Model.TipoConteo == tipo ? "checked" : "")>
|
||||
<label class="btn btn-outline-success" for="tipo@((int)tipo)">
|
||||
@tipo.ToString()
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
<span asp-validation-for="TipoConteo" class="text-danger small d-block mt-2"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Campos para Conteo Detallado -->
|
||||
<div id="camposDetallado" class="campos-tipo mb-4">
|
||||
<h6 class="mb-3 text-success">
|
||||
<i class="bi bi-list-check me-2"></i>Conteo Detallado por Grupo
|
||||
</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="HermanasMisioneras" class="form-label fw-semibold"></label>
|
||||
<input asp-for="HermanasMisioneras" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="HermanasMisioneras" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="HermanosFraternidad" class="form-label fw-semibold"></label>
|
||||
<input asp-for="HermanosFraternidad" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="HermanosFraternidad" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="EmbajadoresCristo" class="form-label fw-semibold"></label>
|
||||
<input asp-for="EmbajadoresCristo" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="EmbajadoresCristo" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Ninos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Ninos" type="number" min="0" class="form-control campo-detallado campo-ninos" />
|
||||
<span asp-validation-for="Ninos" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Visitas" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Visitas" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="Visitas" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Amigos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Amigos" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="Amigos" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Campos para Conteo General -->
|
||||
<div id="camposGeneral" class="campos-tipo mb-4">
|
||||
<h6 class="mb-3 text-warning">
|
||||
<i class="bi bi-people-fill me-2"></i>Conteo General
|
||||
</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="AdultosGeneral" class="form-label fw-semibold"></label>
|
||||
<input asp-for="AdultosGeneral" type="number" min="0" class="form-control campo-general" />
|
||||
<span asp-validation-for="AdultosGeneral" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Ninos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Ninos" type="number" min="0" class="form-control campo-general campo-ninos" />
|
||||
<span asp-validation-for="Ninos" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Campos para Conteo Total -->
|
||||
<div id="camposTotal" class="campos-tipo mb-4">
|
||||
<h6 class="mb-3 text-info">
|
||||
<i class="bi bi-calculator me-2"></i>Conteo Total Directo
|
||||
</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="TotalManual" class="form-label fw-semibold"></label>
|
||||
<input asp-for="TotalManual" type="number" min="0" class="form-control campo-total" />
|
||||
<span asp-validation-for="TotalManual" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Calculado -->
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title"><i class="bi bi-calculator-fill me-2"></i>Total Calculado</h6>
|
||||
<div class="display-4 text-primary text-center" id="totalCalculado">0</div>
|
||||
<div class="text-center small text-muted mt-2">Asistentes totales</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Observaciones -->
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">
|
||||
<i class="bi bi-chat-text me-2"></i>Observaciones
|
||||
</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-12">
|
||||
<label asp-for="Observaciones" class="form-label"></label>
|
||||
<textarea asp-for="Observaciones" class="form-control" rows="3"
|
||||
placeholder="Observaciones adicionales sobre el culto..."></textarea>
|
||||
<span asp-validation-for="Observaciones" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
|
||||
<button type="submit" class="btn btn-primary-custom px-5">
|
||||
<i class="bi bi-save me-2"></i>Guardar Registro
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Ocultar todos los campos al inicio
|
||||
$('.campos-tipo').hide();
|
||||
|
||||
// Función para mostrar campos según tipo de conteo
|
||||
function mostrarCamposPorTipo() {
|
||||
const tipoConteo = $('input[name="TipoConteo"]:checked').val();
|
||||
|
||||
// Ocultar todos los campos
|
||||
$('.campos-tipo').hide();
|
||||
$('.campos-tipo input').prop('disabled', true);
|
||||
|
||||
// Mostrar campos correspondientes y habilitarlos
|
||||
if (tipoConteo === '1') { // Detallado
|
||||
$('#camposDetallado').show();
|
||||
$('.campo-detallado').prop('disabled', false);
|
||||
} else if (tipoConteo === '2') { // General
|
||||
$('#camposGeneral').show();
|
||||
$('.campo-general').prop('disabled', false);
|
||||
} else if (tipoConteo === '3') { // Total
|
||||
$('#camposTotal').show();
|
||||
$('.campo-total').prop('disabled', false);
|
||||
}
|
||||
|
||||
// Calcular total
|
||||
calcularTotal();
|
||||
}
|
||||
|
||||
// Función para calcular el total
|
||||
function calcularTotal() {
|
||||
const tipoConteo = $('input[name="TipoConteo"]:checked').val();
|
||||
let total = 0;
|
||||
|
||||
if (tipoConteo === '1') { // Detallado
|
||||
total = parseInt($('#HermanasMisioneras').val() || 0) +
|
||||
parseInt($('#HermanosFraternidad').val() || 0) +
|
||||
parseInt($('#EmbajadoresCristo').val() || 0) +
|
||||
parseInt($('#Ninos').val() || 0) +
|
||||
parseInt($('#Visitas').val() || 0) +
|
||||
parseInt($('#Amigos').val() || 0);
|
||||
} else if (tipoConteo === '2') { // General
|
||||
total = parseInt($('#AdultosGeneral').val() || 0) +
|
||||
parseInt($('#Ninos').val() || 0);
|
||||
} else if (tipoConteo === '3') { // Total
|
||||
total = parseInt($('#TotalManual').val() || 0);
|
||||
}
|
||||
|
||||
$('#totalCalculado').text(total);
|
||||
}
|
||||
|
||||
// Eventos
|
||||
$('input[name="TipoConteo"]').change(mostrarCamposPorTipo);
|
||||
$('.campos-tipo input').on('input', calcularTotal);
|
||||
|
||||
// Mostrar campos iniciales
|
||||
mostrarCamposPorTipo();
|
||||
|
||||
// Formatear fecha/hora actual para input datetime-local
|
||||
const now = new Date();
|
||||
const formattedNow = now.getFullYear() + '-' +
|
||||
String(now.getMonth() + 1).padStart(2, '0') + '-' +
|
||||
String(now.getDate()).padStart(2, '0') + 'T' +
|
||||
String(now.getHours()).padStart(2, '0') + ':' +
|
||||
String(now.getMinutes()).padStart(2, '0');
|
||||
|
||||
if (!$('#FechaHoraInicio').val()) {
|
||||
$('#FechaHoraInicio').val(formattedNow);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
112
RS_system/Views/AsistenciaCulto/Delete.cshtml
Normal file
112
RS_system/Views/AsistenciaCulto/Delete.cshtml
Normal file
@@ -0,0 +1,112 @@
|
||||
@model Rs_system.Models.AsistenciaCulto
|
||||
@{
|
||||
ViewData["Title"] = "Eliminar Registro";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1 text-danger">Eliminar Registro</h2>
|
||||
<p class="text-muted small mb-0">Confirme la eliminación del registro de asistencia.</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom border-danger">
|
||||
<div class="card-header bg-danger text-white">
|
||||
<h5 class="mb-0"><i class="bi bi-exclamation-triangle me-2"></i>Confirmar Eliminación</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-warning">
|
||||
<i class="bi bi-exclamation-octagon-fill me-2"></i>
|
||||
<strong>¡Advertencia!</strong> Esta acción eliminará permanentemente el registro de asistencia. Esta acción no se puede deshacer.
|
||||
</div>
|
||||
|
||||
<h5 class="mt-4">Detalles del Registro a Eliminar:</h5>
|
||||
<dl class="row">
|
||||
<dt class="col-sm-4">Fecha y Hora:</dt>
|
||||
<dd class="col-sm-8">@Model.FechaHoraInicio.ToString("dd/MM/yyyy HH:mm")</dd>
|
||||
|
||||
<dt class="col-sm-4">Tipo de Culto:</dt>
|
||||
<dd class="col-sm-8">
|
||||
<span class="badge bg-primary">@Model.TipoCulto</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-4">Tipo de Conteo:</dt>
|
||||
<dd class="col-sm-8">
|
||||
<span class="badge @(Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.Detallado ? "bg-success" :
|
||||
Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.General ? "bg-warning" : "bg-info")">
|
||||
@Model.TipoConteo
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-4">Total de Asistentes:</dt>
|
||||
<dd class="col-sm-8 fw-bold text-primary">@Model.Total</dd>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.Observaciones))
|
||||
{
|
||||
<dt class="col-sm-4">Observaciones:</dt>
|
||||
<dd class="col-sm-8">@Model.Observaciones</dd>
|
||||
}
|
||||
|
||||
<dt class="col-sm-4">Fecha de creación:</dt>
|
||||
<dd class="col-sm-8">@Model.CreadoEn.ToString("dd/MM/yyyy HH:mm")</dd>
|
||||
</dl>
|
||||
|
||||
@if (Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.Detallado)
|
||||
{
|
||||
<div class="card bg-light mt-3">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">Desglose de Asistencia:</h6>
|
||||
<div class="row small">
|
||||
<div class="col-md-6">
|
||||
<div>Hermanas: @Model.HermanasMisioneras</div>
|
||||
<div>Hermanos: @Model.HermanosFraternidad</div>
|
||||
<div>Embajadores: @Model.EmbajadoresCristo</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div>Niños: @Model.Ninos</div>
|
||||
<div>Visitas: @Model.Visitas</div>
|
||||
<div>Amigos: @Model.Amigos</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.General)
|
||||
{
|
||||
<div class="card bg-light mt-3">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">Conteo General:</h6>
|
||||
<div class="row small">
|
||||
<div class="col-md-6">
|
||||
<div>Adultos: @Model.AdultosGeneral</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div>Niños: @Model.Ninos</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<form asp-action="Delete" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="d-flex justify-content-between">
|
||||
<a asp-action="Index" class="btn btn-secondary">
|
||||
<i class="bi bi-x-circle me-2"></i>Cancelar
|
||||
</a>
|
||||
<button type="submit" class="btn btn-danger">
|
||||
<i class="bi bi-trash-fill me-2"></i>Eliminar Permanentemente
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
172
RS_system/Views/AsistenciaCulto/Details.cshtml
Normal file
172
RS_system/Views/AsistenciaCulto/Details.cshtml
Normal file
@@ -0,0 +1,172 @@
|
||||
@model Rs_system.Models.AsistenciaCulto
|
||||
@{
|
||||
ViewData["Title"] = "Detalles del Registro";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Detalles del Registro</h2>
|
||||
<p class="text-muted small mb-0">Información completa de la asistencia registrada.</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10">
|
||||
<div class="card-custom">
|
||||
<div class="card-body">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">
|
||||
<i class="bi bi-calendar-event me-2"></i>Información del Culto
|
||||
</h5>
|
||||
<dl class="row">
|
||||
<dt class="col-sm-5">Fecha y Hora:</dt>
|
||||
<dd class="col-sm-7">@Model.FechaHoraInicio.ToString("dd/MM/yyyy HH:mm")</dd>
|
||||
|
||||
<dt class="col-sm-5">Tipo de Culto:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<span class="badge bg-primary">@Model.TipoCulto</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Tipo de Conteo:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<span class="badge @(Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.Detallado ? "bg-success" :
|
||||
Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.General ? "bg-warning" : "bg-info")">
|
||||
@Model.TipoConteo
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">
|
||||
<i class="bi bi-calculator me-2"></i>Resumen
|
||||
</h5>
|
||||
<div class="text-center py-3">
|
||||
<div class="display-1 text-primary">@Model.Total</div>
|
||||
<div class="text-muted">Asistentes Totales</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">
|
||||
<i class="bi bi-people me-2"></i>Desglose de Asistencia
|
||||
</h5>
|
||||
|
||||
@if (Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.Detallado)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-light mb-3">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-success">Conteo Detallado</h6>
|
||||
<dl class="row small">
|
||||
<dt class="col-sm-8">Hermanas (Concilio Misionero):</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.HermanasMisioneras</dd>
|
||||
|
||||
<dt class="col-sm-8">Hermanos (Fraternidad de Varones):</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.HermanosFraternidad</dd>
|
||||
|
||||
<dt class="col-sm-8">Embajadores de Cristo:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.EmbajadoresCristo</dd>
|
||||
|
||||
<dt class="col-sm-8">Niños:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.Ninos</dd>
|
||||
|
||||
<dt class="col-sm-8">Visitas:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.Visitas</dd>
|
||||
|
||||
<dt class="col-sm-8">Amigos:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.Amigos</dd>
|
||||
</dl>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<dt class="col-sm-8">Total Adultos Detallado:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.TotalAdultosDetallado</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (Model.TipoConteo == Rs_system.Models.Enums.TipoConteo.General)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-light mb-3">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-warning">Conteo General</h6>
|
||||
<dl class="row small">
|
||||
<dt class="col-sm-8">Adultos en General:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.AdultosGeneral</dd>
|
||||
|
||||
<dt class="col-sm-8">Niños:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.Ninos</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-light mb-3">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-info">Conteo Total Directo</h6>
|
||||
<dl class="row small">
|
||||
<dt class="col-sm-8">Total Presente:</dt>
|
||||
<dd class="col-sm-4 text-end fw-bold">@Model.TotalManual</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.Observaciones))
|
||||
{
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3 mt-4">
|
||||
<i class="bi bi-chat-text me-2"></i>Observaciones
|
||||
</h5>
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<p class="card-text">@Model.Observaciones</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3 mt-4">
|
||||
<i class="bi bi-info-circle me-2"></i>Información de Auditoría
|
||||
</h5>
|
||||
<dl class="row small">
|
||||
<dt class="col-sm-3">Registrado por:</dt>
|
||||
<dd class="col-sm-3">@(Model.CreadoPor ?? "Sistema")</dd>
|
||||
|
||||
<dt class="col-sm-3">Fecha de creación:</dt>
|
||||
<dd class="col-sm-3">@Model.CreadoEn.ToString("dd/MM/yyyy HH:mm")</dd>
|
||||
|
||||
<dt class="col-sm-3">Última actualización:</dt>
|
||||
<dd class="col-sm-3">@Model.ActualizadoEn.ToString("dd/MM/yyyy HH:mm")</dd>
|
||||
</dl>
|
||||
|
||||
<div class="d-flex justify-content-between mt-4">
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary-custom">
|
||||
<i class="bi bi-pencil me-2"></i>Editar
|
||||
</a>
|
||||
<div>
|
||||
<a asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-outline-danger me-2">
|
||||
<i class="bi bi-trash me-2"></i>Eliminar
|
||||
</a>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-list me-2"></i>Volver al Listado
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
236
RS_system/Views/AsistenciaCulto/Edit.cshtml
Normal file
236
RS_system/Views/AsistenciaCulto/Edit.cshtml
Normal file
@@ -0,0 +1,236 @@
|
||||
@model Rs_system.Models.ViewModels.AsistenciaCultoViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Editar Registro de Asistencia";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Editar Registro</h2>
|
||||
<p class="text-muted small mb-0">Actualice la información de asistencia del culto.</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit" method="post" id="asistenciaForm">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger"></div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">
|
||||
<i class="bi bi-calendar-event me-2"></i>Información del Culto
|
||||
</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="FechaHoraInicio" class="form-label fw-semibold"></label>
|
||||
<input asp-for="FechaHoraInicio" type="datetime-local" class="form-control" />
|
||||
<span asp-validation-for="FechaHoraInicio" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="TipoCulto" class="form-label fw-semibold"></label>
|
||||
<select asp-for="TipoCulto" asp-items="@(new SelectList(ViewBag.TiposCulto))" class="form-select">
|
||||
<option value="">-- Seleccione --</option>
|
||||
</select>
|
||||
<span asp-validation-for="TipoCulto" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">
|
||||
<i class="bi bi-people me-2"></i>Tipo de Conteo
|
||||
</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<div class="btn-group w-100" role="group" aria-label="Tipo de conteo">
|
||||
@foreach (var tipo in ViewBag.TiposConteo as List<Rs_system.Models.Enums.TipoConteo>)
|
||||
{
|
||||
<input type="radio" class="btn-check" name="TipoConteo" id="tipo@((int)tipo)" value="@((int)tipo)"
|
||||
@(Model.TipoConteo == tipo ? "checked" : "")>
|
||||
<label class="btn btn-outline-success" for="tipo@((int)tipo)">
|
||||
@tipo.ToString()
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
<span asp-validation-for="TipoConteo" class="text-danger small d-block mt-2"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Campos para Conteo Detallado -->
|
||||
<div id="camposDetallado" class="campos-tipo mb-4">
|
||||
<h6 class="mb-3 text-success">
|
||||
<i class="bi bi-list-check me-2"></i>Conteo Detallado por Grupo
|
||||
</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="HermanasMisioneras" class="form-label fw-semibold"></label>
|
||||
<input asp-for="HermanasMisioneras" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="HermanasMisioneras" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="HermanosFraternidad" class="form-label fw-semibold"></label>
|
||||
<input asp-for="HermanosFraternidad" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="HermanosFraternidad" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="EmbajadoresCristo" class="form-label fw-semibold"></label>
|
||||
<input asp-for="EmbajadoresCristo" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="EmbajadoresCristo" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Ninos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Ninos" type="number" min="0" class="form-control campo-detallado campo-ninos" />
|
||||
<span asp-validation-for="Ninos" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Visitas" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Visitas" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="Visitas" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Amigos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Amigos" type="number" min="0" class="form-control campo-detallado" />
|
||||
<span asp-validation-for="Amigos" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Campos para Conteo General -->
|
||||
<div id="camposGeneral" class="campos-tipo mb-4">
|
||||
<h6 class="mb-3 text-warning">
|
||||
<i class="bi bi-people-fill me-2"></i>Conteo General
|
||||
</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="AdultosGeneral" class="form-label fw-semibold"></label>
|
||||
<input asp-for="AdultosGeneral" type="number" min="0" class="form-control campo-general" />
|
||||
<span asp-validation-for="AdultosGeneral" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Ninos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Ninos" type="number" min="0" class="form-control campo-general campo-ninos" />
|
||||
<span asp-validation-for="Ninos" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Campos para Conteo Total -->
|
||||
<div id="camposTotal" class="campos-tipo mb-4">
|
||||
<h6 class="mb-3 text-info">
|
||||
<i class="bi bi-calculator me-2"></i>Conteo Total Directo
|
||||
</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="TotalManual" class="form-label fw-semibold"></label>
|
||||
<input asp-for="TotalManual" type="number" min="0" class="form-control campo-total" />
|
||||
<span asp-validation-for="TotalManual" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Calculado -->
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title"><i class="bi bi-calculator-fill me-2"></i>Total Calculado</h6>
|
||||
<div class="display-4 text-primary text-center" id="totalCalculado">@Model.Total</div>
|
||||
<div class="text-center small text-muted mt-2">Asistentes totales</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Observaciones -->
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">
|
||||
<i class="bi bi-chat-text me-2"></i>Observaciones
|
||||
</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-12">
|
||||
<label asp-for="Observaciones" class="form-label"></label>
|
||||
<textarea asp-for="Observaciones" class="form-control" rows="3"
|
||||
placeholder="Observaciones adicionales sobre el culto..."></textarea>
|
||||
<span asp-validation-for="Observaciones" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
|
||||
<button type="submit" class="btn btn-primary-custom px-5">
|
||||
<i class="bi bi-save me-2"></i>Actualizar Registro
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Ocultar todos los campos al inicio
|
||||
$('.campos-tipo').hide();
|
||||
|
||||
// Función para mostrar campos según tipo de conteo
|
||||
function mostrarCamposPorTipo() {
|
||||
const tipoConteo = $('input[name="TipoConteo"]:checked').val();
|
||||
|
||||
// Ocultar todos los campos
|
||||
$('.campos-tipo').hide();
|
||||
$('.campos-tipo input').prop('disabled', true);
|
||||
|
||||
// Mostrar campos correspondientes y habilitarlos
|
||||
if (tipoConteo === '1') { // Detallado
|
||||
$('#camposDetallado').show();
|
||||
$('.campo-detallado').prop('disabled', false);
|
||||
} else if (tipoConteo === '2') { // General
|
||||
$('#camposGeneral').show();
|
||||
$('.campo-general').prop('disabled', false);
|
||||
} else if (tipoConteo === '3') { // Total
|
||||
$('#camposTotal').show();
|
||||
$('.campo-total').prop('disabled', false);
|
||||
}
|
||||
|
||||
// Calcular total
|
||||
calcularTotal();
|
||||
}
|
||||
|
||||
// Función para calcular el total
|
||||
function calcularTotal() {
|
||||
const tipoConteo = $('input[name="TipoConteo"]:checked').val();
|
||||
let total = 0;
|
||||
|
||||
if (tipoConteo === '1') { // Detallado
|
||||
total = parseInt($('#HermanasMisioneras').val() || 0) +
|
||||
parseInt($('#HermanosFraternidad').val() || 0) +
|
||||
parseInt($('#EmbajadoresCristo').val() || 0) +
|
||||
parseInt($('#Ninos').val() || 0) +
|
||||
parseInt($('#Visitas').val() || 0) +
|
||||
parseInt($('#Amigos').val() || 0);
|
||||
} else if (tipoConteo === '2') { // General
|
||||
total = parseInt($('#AdultosGeneral').val() || 0) +
|
||||
parseInt($('#Ninos').val() || 0);
|
||||
} else if (tipoConteo === '3') { // Total
|
||||
total = parseInt($('#TotalManual').val() || 0);
|
||||
}
|
||||
|
||||
$('#totalCalculado').text(total);
|
||||
}
|
||||
|
||||
// Eventos
|
||||
$('input[name="TipoConteo"]').change(mostrarCamposPorTipo);
|
||||
$('.campos-tipo input').on('input', calcularTotal);
|
||||
|
||||
// Mostrar campos iniciales
|
||||
mostrarCamposPorTipo();
|
||||
|
||||
// Calcular total inicial
|
||||
calcularTotal();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
154
RS_system/Views/AsistenciaCulto/Index.cshtml
Normal file
154
RS_system/Views/AsistenciaCulto/Index.cshtml
Normal file
@@ -0,0 +1,154 @@
|
||||
@model Rs_system.Models.ViewModels.AsistenciaCultoFiltroViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Asistencia de Cultos";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Registro de Asistencia</h2>
|
||||
<p class="text-muted small mb-0">Gestione la asistencia de los diferentes cultos y actividades eclesiásticas.</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-calendar-plus me-2"></i>Nuevo Registro
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Filtros -->
|
||||
<div class="card-custom mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-3"><i class="bi bi-funnel me-2"></i>Filtrar Registros</h5>
|
||||
<form asp-action="Index" method="get">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<label asp-for="FechaDesde" class="form-label small fw-semibold"></label>
|
||||
<input asp-for="FechaDesde" type="date" class="form-control form-control-sm" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="FechaHasta" class="form-label small fw-semibold"></label>
|
||||
<input asp-for="FechaHasta" type="date" class="form-control form-control-sm" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="TipoCulto" class="form-label small fw-semibold"></label>
|
||||
<select asp-for="TipoCulto" asp-items="@(new SelectList(ViewBag.TiposCulto))" class="form-select form-select-sm">
|
||||
<option value="">-- Todos --</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="TipoConteo" class="form-label small fw-semibold"></label>
|
||||
<select asp-for="TipoConteo" asp-items="@(new SelectList(ViewBag.TiposConteo))" class="form-select form-select-sm">
|
||||
<option value="">-- Todos --</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="d-flex justify-content-between">
|
||||
<button type="submit" class="btn btn-primary-custom btn-sm px-3">
|
||||
<i class="bi bi-search me-2"></i>Filtrar
|
||||
</button>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-x-circle me-2"></i>Limpiar
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tabla de resultados -->
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
@if (Model.Resultados?.Any() == true)
|
||||
{
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fecha y Hora</th>
|
||||
<th>Tipo de Culto</th>
|
||||
<th>Conteo</th>
|
||||
<th>Detalle</th>
|
||||
<th>Total</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Resultados)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<strong>@item.FechaHoraInicio.ToString("dd/MM/yyyy")</strong><br />
|
||||
<small class="text-muted">@item.FechaHoraInicio.ToString("HH:mm")</small>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-primary">@item.TipoCulto</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge @(item.TipoConteo == Rs_system.Models.Enums.TipoConteo.Detallado ? "bg-success" :
|
||||
item.TipoConteo == Rs_system.Models.Enums.TipoConteo.General ? "bg-warning" : "bg-info")">
|
||||
@item.TipoConteo
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
@if (item.TipoConteo == Rs_system.Models.Enums.TipoConteo.Detallado)
|
||||
{
|
||||
<div class="small">
|
||||
<div><strong>Hermanas:</strong> @item.HermanasMisioneras</div>
|
||||
<div><strong>Hermanos:</strong> @item.HermanosFraternidad</div>
|
||||
<div><strong>Embajadores:</strong> @item.EmbajadoresCristo</div>
|
||||
<div><strong>Niños:</strong> @item.Ninos</div>
|
||||
<div><strong>Visitas:</strong> @item.Visitas</div>
|
||||
<div><strong>Amigos:</strong> @item.Amigos</div>
|
||||
</div>
|
||||
}
|
||||
else if (item.TipoConteo == Rs_system.Models.Enums.TipoConteo.General)
|
||||
{
|
||||
<div class="small">
|
||||
<div><strong>Adultos:</strong> @item.AdultosGeneral</div>
|
||||
<div><strong>Niños:</strong> @item.Ninos</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="small text-muted">Conteo total directo</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<span class="fw-bold text-primary">@item.Total</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-sm btn-outline-primary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-sm btn-outline-secondary" title="Detalles">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-sm btn-outline-danger" title="Eliminar">
|
||||
<i class="bi bi-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-calendar-x display-1 text-muted"></i>
|
||||
<h4 class="mt-3">No hay registros de asistencia</h4>
|
||||
<p class="text-muted">Comience creando un nuevo registro de asistencia.</p>
|
||||
<a asp-action="Create" class="btn btn-primary-custom mt-2">
|
||||
<i class="bi bi-plus-circle me-2"></i>Crear Primer Registro
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Model.Resultados?.Any() == true)
|
||||
{
|
||||
<div class="mt-3 text-muted small">
|
||||
<i class="bi bi-info-circle me-2"></i>Mostrando @Model.Resultados.Count() registros
|
||||
</div>
|
||||
}
|
||||
73
RS_system/Views/Configuracion/Edit.cshtml
Normal file
73
RS_system/Views/Configuracion/Edit.cshtml
Normal file
@@ -0,0 +1,73 @@
|
||||
@model Rs_system.Models.ConfiguracionSistema
|
||||
@{
|
||||
ViewData["Title"] = "Editar Configuración";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Editar Parámetro</h2>
|
||||
<p class="text-muted small mb-0">Modificando la clave: <code>@Model.Clave</code></p>
|
||||
</div>
|
||||
<a asp-action="Index" asp-route-categoria="@Model.Categoria" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" asp-for="Id" />
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label fw-bold">Descripción</label>
|
||||
<p class="text-muted small">@Model.Descripcion</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label asp-for="Valor" class="form-label fw-bold">Valor</label>
|
||||
|
||||
@if (Model.TipoDato == "BOOLEANO")
|
||||
{
|
||||
<select asp-for="Valor" class="form-select">
|
||||
<option value="true">Activado (True)</option>
|
||||
<option value="false">Desactivado (False)</option>
|
||||
</select>
|
||||
}
|
||||
else if (Model.TipoDato == "HTML" || Model.TipoDato == "JSON")
|
||||
{
|
||||
<textarea asp-for="Valor" class="form-control" rows="8" style="font-family: monospace;"></textarea>
|
||||
}
|
||||
else if (Model.TipoDato == "NUMERO")
|
||||
{
|
||||
<input asp-for="Valor" class="form-control" type="number" />
|
||||
}
|
||||
else if (Model.TipoDato == "FECHA")
|
||||
{
|
||||
<input asp-for="Valor" class="form-control" type="date" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input asp-for="Valor" class="form-control" />
|
||||
}
|
||||
<span asp-validation-for="Valor" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mt-5">
|
||||
<div class="small text-muted">
|
||||
<i class="bi bi-info-circle me-1"></i>
|
||||
Tipo: <span class="badge bg-light text-dark border">@Model.TipoDato</span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary-custom">
|
||||
<i class="bi bi-save me-2"></i>Guardar Cambios
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
93
RS_system/Views/Configuracion/Index.cshtml
Normal file
93
RS_system/Views/Configuracion/Index.cshtml
Normal file
@@ -0,0 +1,93 @@
|
||||
@model IEnumerable<Rs_system.Models.ConfiguracionSistema>
|
||||
@{
|
||||
ViewData["Title"] = "Configuración del Sistema";
|
||||
var categorias = (List<string>)ViewBag.Categorias;
|
||||
var selectedCategoria = (string)ViewBag.SelectedCategoria;
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Configuración</h2>
|
||||
<p class="text-muted small mb-0">Gestione los parámetros dinámicos y ajustes globales del sistema.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="card-custom py-2 px-3">
|
||||
<div class="d-flex gap-2 overflow-auto">
|
||||
<a asp-action="Index" class="btn btn-sm @(string.IsNullOrEmpty(selectedCategoria) ? "btn-primary-custom" : "btn-outline-secondary")">
|
||||
Todas
|
||||
</a>
|
||||
@foreach (var cat in categorias)
|
||||
{
|
||||
<a asp-action="Index" asp-route-categoria="@cat"
|
||||
class="btn btn-sm @(selectedCategoria == cat ? "btn-primary-custom" : "btn-outline-secondary")">
|
||||
@cat
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Clave</th>
|
||||
<th>Valor</th>
|
||||
<th>Categoría / Grupo</th>
|
||||
<th>Descripción</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!Model.Any())
|
||||
{
|
||||
<tr>
|
||||
<td colspan="5" class="text-center py-4 text-muted">No hay configuraciones registradas.</td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="fw-bold">
|
||||
<code>@item.Clave</code>
|
||||
</td>
|
||||
<td>
|
||||
@if (item.TipoDato == "BOOLEANO")
|
||||
{
|
||||
<span class="badge @(item.Valor?.ToLower() == "true" ? "bg-success" : "bg-danger")">
|
||||
@(item.Valor?.ToLower() == "true" ? "Activado" : "Desactivado")
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-truncate d-inline-block" style="max-width: 200px;">@item.Valor</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-light text-dark border">@item.Categoria</span>
|
||||
<span class="badge bg-light text-muted border">@item.Grupo</span>
|
||||
</td>
|
||||
<td class="small text-muted">@item.Descripcion</td>
|
||||
<td>
|
||||
@if (item.EsEditable)
|
||||
{
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-sm btn-outline-secondary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="bi bi-lock-fill text-muted" title="Solo lectura"></i>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
43
RS_system/Views/Home/Index.cshtml
Normal file
43
RS_system/Views/Home/Index.cshtml
Normal file
@@ -0,0 +1,43 @@
|
||||
@inject Rs_system.Services.IConfiguracionService ConfigService
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
ViewData["Title"] = "Dashboard";
|
||||
var nameIglesia = await ConfigService.GetValorOrDefaultAsync("NAME_FOUNDATION", "Rs_system");
|
||||
}
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<div class="d-flex align-items-center mb-4 border-bottom pb-3">
|
||||
<i class="bi bi-house-door-fill text-primary fs-3 me-3"></i>
|
||||
<h2 class="mb-0 text-primary">@nameIglesia</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Sistema de Gestión</h3>
|
||||
<p class="card-text">
|
||||
Bienvenido al sistema de gestión integral de @nameIglesia. Esta plataforma está diseñada para facilitar la administración de recursos, miembros, eventos y actividades de la iglesia.
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Desde este panel principal podrás acceder a todas las funcionalidades del sistema, incluyendo:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Gestión de miembros y asistentes</li>
|
||||
<li>Control de eventos y actividades</li>
|
||||
<li>Administración de recursos y materiales</li>
|
||||
<li>Reportes y estadísticas</li>
|
||||
<li>Configuración del sistema</li>
|
||||
</ul>
|
||||
<p class="card-text">
|
||||
Utiliza el menú de navegación para acceder a las diferentes secciones del sistema.
|
||||
</p>
|
||||
</div>
|
||||
<div class="text-muted small mt-4 pt-3 border-top">
|
||||
Sistema desarrollado para optimizar la gestión eclesiástica
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
6
RS_system/Views/Home/Privacy.cshtml
Normal file
6
RS_system/Views/Home/Privacy.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
||||
83
RS_system/Views/Modulo/Create.cshtml
Normal file
83
RS_system/Views/Modulo/Create.cshtml
Normal file
@@ -0,0 +1,83 @@
|
||||
@model Rs_system.Models.Modulo
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Nuevo Módulo";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Nuevo Módulo</h4>
|
||||
<p class="text-muted mb-0">Crear un nuevo módulo o secció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="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label asp-for="Nombre" class="form-label">Nombre del Módulo</label>
|
||||
<input asp-for="Nombre" class="form-control" placeholder="Ej. Administración, Reportes..." />
|
||||
<span asp-validation-for="Nombre" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label asp-for="ParentId" class="form-label">Módulo Padre (Opcional)</label>
|
||||
<select asp-for="ParentId" class="form-select">
|
||||
<option value="">-- Ninguno (Módulo Raíz) --</option>
|
||||
@foreach (var modulo in (IEnumerable<Rs_system.Models.Modulo>)ViewBag.ModulosPadre)
|
||||
{
|
||||
<option value="@modulo.Id">@modulo.Nombre</option>
|
||||
}
|
||||
</select>
|
||||
<small class="text-muted">Si se selecciona, este será un sub-módulo</small>
|
||||
</div>
|
||||
<div class="col-md-2 mb-3">
|
||||
<label asp-for="Orden" class="form-label">Orden</label>
|
||||
<input asp-for="Orden" class="form-control" type="number" />
|
||||
<span asp-validation-for="Orden" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 mb-3">
|
||||
<label asp-for="Icono" class="form-label">Icono (Bootstrap Icons)</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i id="iconPreview" class="bi bi-question-circle"></i></span>
|
||||
<input asp-for="Icono" class="form-control" placeholder="bi-gear, bi-person..." oninput="updateIconPreview(this.value)" />
|
||||
</div>
|
||||
<small class="text-muted">Use nombres de <a href="https://icons.getbootstrap.com/" target="_blank">Bootstrap Icons</a></small>
|
||||
<span asp-validation-for="Icono" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label class="form-label d-block">Estado</label>
|
||||
<div class="form-check form-switch mt-2">
|
||||
<input class="form-check-input" type="checkbox" asp-for="Activo">
|
||||
<label class="form-check-label" asp-for="Activo">Activo</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<button type="submit" class="btn btn-primary-custom px-4">
|
||||
<i class="bi bi-save me-2"></i>Guardar Módulo
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
<script>
|
||||
function updateIconPreview(iconName) {
|
||||
const preview = document.getElementById('iconPreview');
|
||||
preview.className = 'bi ' + (iconName || 'bi-question-circle');
|
||||
}
|
||||
</script>
|
||||
}
|
||||
85
RS_system/Views/Modulo/Edit.cshtml
Normal file
85
RS_system/Views/Modulo/Edit.cshtml
Normal file
@@ -0,0 +1,85 @@
|
||||
@model Rs_system.Models.Modulo
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Editar Módulo";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Editar Módulo</h4>
|
||||
<p class="text-muted mb-0">Modificar módulo existente</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="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="hidden" asp-for="CreadoEn" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label asp-for="Nombre" class="form-label">Nombre del Módulo</label>
|
||||
<input asp-for="Nombre" class="form-control" />
|
||||
<span asp-validation-for="Nombre" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label asp-for="ParentId" class="form-label">Módulo Padre (Opcional)</label>
|
||||
<select asp-for="ParentId" class="form-select">
|
||||
<option value="">-- Ninguno (Módulo Raíz) --</option>
|
||||
@foreach (var modulo in (IEnumerable<Rs_system.Models.Modulo>)ViewBag.ModulosPadre)
|
||||
{
|
||||
<option value="@modulo.Id">@modulo.Nombre</option>
|
||||
}
|
||||
</select>
|
||||
<small class="text-muted">Si se selecciona, este será un sub-módulo</small>
|
||||
</div>
|
||||
<div class="col-md-2 mb-3">
|
||||
<label asp-for="Orden" class="form-label">Orden</label>
|
||||
<input asp-for="Orden" class="form-control" type="number" />
|
||||
<span asp-validation-for="Orden" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 mb-3">
|
||||
<label asp-for="Icono" class="form-label">Icono (Bootstrap Icons)</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i id="iconPreview" class="bi @(Model.Icono ?? "bi-question-circle")"></i></span>
|
||||
<input asp-for="Icono" class="form-control" oninput="updateIconPreview(this.value)" />
|
||||
</div>
|
||||
<small class="text-muted">Use nombres de <a href="https://icons.getbootstrap.com/" target="_blank">Bootstrap Icons</a></small>
|
||||
<span asp-validation-for="Icono" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label class="form-label d-block">Estado</label>
|
||||
<div class="form-check form-switch mt-2">
|
||||
<input class="form-check-input" type="checkbox" asp-for="Activo">
|
||||
<label class="form-check-label" asp-for="Activo">Activo</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<button type="submit" class="btn btn-primary-custom px-4">
|
||||
<i class="bi bi-save me-2"></i>Guardar Cambios
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
<script>
|
||||
function updateIconPreview(iconName) {
|
||||
const preview = document.getElementById('iconPreview');
|
||||
preview.className = 'bi ' + (iconName || 'bi-question-circle');
|
||||
}
|
||||
</script>
|
||||
}
|
||||
87
RS_system/Views/Modulo/Index.cshtml
Normal file
87
RS_system/Views/Modulo/Index.cshtml
Normal file
@@ -0,0 +1,87 @@
|
||||
@model IEnumerable<Rs_system.Models.Modulo>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Gestión de Módulos / Secciones";
|
||||
}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Gestión de Módulos / Secciones</h4>
|
||||
<p class="text-muted mb-0">Administración de módulos del sistema</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-plus-lg me-1"></i> Nuevo Módulo
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if (TempData["ErrorMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i> @TempData["ErrorMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Orden</th>
|
||||
<th>Nombre</th>
|
||||
<th>Icono</th>
|
||||
<th class="text-center">Activo</th>
|
||||
<th class="text-center">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td><span class="badge bg-secondary">@item.Orden</span></td>
|
||||
<td class="fw-bold">@item.Nombre</td>
|
||||
<td><i class="bi @item.Icono me-2"></i>@item.Icono</td>
|
||||
<td class="text-center">
|
||||
@if (item.Activo)
|
||||
{
|
||||
<span class="text-success"><i class="bi bi-check-circle-fill"></i></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted"><i class="bi bi-x-circle"></i></span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-outline-primary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline-danger" title="Eliminar"
|
||||
onclick="confirmDelete(@item.Id, '@item.Nombre')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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, name) {
|
||||
if (confirm(`¿Está seguro de que desea eliminar el módulo "${name}"? Se eliminará solo si no tiene permisos asociados.`)) {
|
||||
document.getElementById('deleteId').value = id;
|
||||
document.getElementById('deleteForm').submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
262
RS_system/Views/Ofrenda/Create.cshtml
Normal file
262
RS_system/Views/Ofrenda/Create.cshtml
Normal file
@@ -0,0 +1,262 @@
|
||||
@model Rs_system.Models.ViewModels.RegistroCultoViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Nuevo Registro de Ofrendas";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Nuevo Registro de Ofrendas</h4>
|
||||
<p class="text-muted mb-0">Registrar ofrendas de un culto</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i> Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form asp-action="Create" method="post" id="ofrendaForm">
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger"></div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Left Column: Basic Info -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card-custom">
|
||||
<h6 class="mb-3"><i class="bi bi-calendar-event me-2"></i>Información del Culto</h6>
|
||||
|
||||
<div class="mb-3">
|
||||
<label asp-for="Fecha" class="form-label"></label>
|
||||
<input asp-for="Fecha" class="form-control" type="date" />
|
||||
<span asp-validation-for="Fecha" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label asp-for="Observaciones" class="form-label"></label>
|
||||
<textarea asp-for="Observaciones" class="form-control" rows="3" placeholder="Notas adicionales..."></textarea>
|
||||
<span asp-validation-for="Observaciones" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Summary -->
|
||||
<div class="card-custom mt-3">
|
||||
<h6 class="mb-3"><i class="bi bi-calculator me-2"></i>Resumen</h6>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Ofrendas:</span>
|
||||
<strong id="totalOfrendas">$ 0.00</strong>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Descuentos:</span>
|
||||
<strong id="totalDescuentos" class="text-warning">$ 0.00</strong>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="fw-bold">Monto Neto:</span>
|
||||
<strong id="montoNeto" class="text-success fs-5">$ 0.00</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column: Offerings -->
|
||||
<div class="col-lg-8">
|
||||
<div class="card-custom">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h6 class="mb-0"><i class="bi bi-cash-stack me-2"></i>Ofrendas</h6>
|
||||
<button type="button" class="btn btn-sm btn-primary-custom" onclick="addOfrenda()">
|
||||
<i class="bi bi-plus-lg me-1"></i> Agregar Ofrenda
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="ofrendasContainer">
|
||||
<!-- Offerings will be added here dynamically -->
|
||||
</div>
|
||||
|
||||
<div id="emptyState" class="text-center text-muted py-4">
|
||||
<i class="bi bi-plus-circle fs-1 d-block mb-2"></i>
|
||||
Haga clic en "Agregar Ofrenda" para comenzar
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom">
|
||||
<i class="bi bi-check-lg me-1"></i> Guardar Registro
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Ofrenda Template -->
|
||||
<template id="ofrendaTemplate">
|
||||
<div class="ofrenda-item card mb-3" data-index="0">
|
||||
<div class="card-header bg-light d-flex justify-content-between align-items-center py-2">
|
||||
<span class="fw-semibold">Ofrenda #<span class="ofrenda-number">1</span></span>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="removeOfrenda(this)">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Concepto *</label>
|
||||
<input type="text" name="Ofrendas[0].Concepto" class="form-control" placeholder="Ej: Ofrenda general" required />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Monto *</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="number" step="0.01" min="0.01" name="Ofrendas[0].Monto" class="form-control ofrenda-monto" placeholder="0.00" required onchange="calculateTotals()" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="descuentos-section">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<small class="text-muted"><i class="bi bi-dash-circle me-1"></i>Descuentos</small>
|
||||
<button type="button" class="btn btn-sm btn-outline-warning" onclick="addDescuento(this)">
|
||||
<i class="bi bi-plus"></i> Agregar Descuento
|
||||
</button>
|
||||
</div>
|
||||
<div class="descuentos-container">
|
||||
<!-- Descuentos will be added here -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 pt-2 border-top d-flex justify-content-end">
|
||||
<span class="text-muted me-2">Neto:</span>
|
||||
<strong class="ofrenda-neto text-success">$ 0.00</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Descuento Template -->
|
||||
<template id="descuentoTemplate">
|
||||
<div class="descuento-item row g-2 mb-2">
|
||||
<div class="col-md-5">
|
||||
<input type="text" name="Ofrendas[0].Descuentos[0].Concepto" class="form-control form-control-sm" placeholder="Concepto descuento" required />
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="number" step="0.01" min="0.01" name="Ofrendas[0].Descuentos[0].Monto" class="form-control descuento-monto" placeholder="0.00" required onchange="calculateTotals()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-danger w-100" onclick="removeDescuento(this)">
|
||||
<i class="bi bi-x"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
let ofrendaIndex = 0;
|
||||
|
||||
function addOfrenda() {
|
||||
const container = document.getElementById('ofrendasContainer');
|
||||
const template = document.getElementById('ofrendaTemplate');
|
||||
const clone = template.content.cloneNode(true);
|
||||
|
||||
// Update indices
|
||||
const ofrendaItem = clone.querySelector('.ofrenda-item');
|
||||
ofrendaItem.dataset.index = ofrendaIndex;
|
||||
ofrendaItem.querySelector('.ofrenda-number').textContent = ofrendaIndex + 1;
|
||||
|
||||
// Update input names
|
||||
clone.querySelectorAll('[name]').forEach(input => {
|
||||
input.name = input.name.replace('[0]', `[${ofrendaIndex}]`);
|
||||
});
|
||||
|
||||
container.appendChild(clone);
|
||||
document.getElementById('emptyState').style.display = 'none';
|
||||
ofrendaIndex++;
|
||||
calculateTotals();
|
||||
}
|
||||
|
||||
function removeOfrenda(btn) {
|
||||
btn.closest('.ofrenda-item').remove();
|
||||
updateOfrendaIndices();
|
||||
calculateTotals();
|
||||
|
||||
if (document.querySelectorAll('.ofrenda-item').length === 0) {
|
||||
document.getElementById('emptyState').style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
function addDescuento(btn) {
|
||||
const ofrendaItem = btn.closest('.ofrenda-item');
|
||||
const ofrendaIdx = ofrendaItem.dataset.index;
|
||||
const container = ofrendaItem.querySelector('.descuentos-container');
|
||||
const descuentoIdx = container.querySelectorAll('.descuento-item').length;
|
||||
|
||||
const template = document.getElementById('descuentoTemplate');
|
||||
const clone = template.content.cloneNode(true);
|
||||
|
||||
// Update input names
|
||||
clone.querySelectorAll('[name]').forEach(input => {
|
||||
input.name = input.name.replace('Ofrendas[0]', `Ofrendas[${ofrendaIdx}]`);
|
||||
input.name = input.name.replace('Descuentos[0]', `Descuentos[${descuentoIdx}]`);
|
||||
});
|
||||
|
||||
container.appendChild(clone);
|
||||
calculateTotals();
|
||||
}
|
||||
|
||||
function removeDescuento(btn) {
|
||||
btn.closest('.descuento-item').remove();
|
||||
updateDescuentoIndices();
|
||||
calculateTotals();
|
||||
}
|
||||
|
||||
function updateOfrendaIndices() {
|
||||
document.querySelectorAll('.ofrenda-item').forEach((item, idx) => {
|
||||
item.dataset.index = idx;
|
||||
item.querySelector('.ofrenda-number').textContent = idx + 1;
|
||||
|
||||
item.querySelectorAll('[name^="Ofrendas["]').forEach(input => {
|
||||
input.name = input.name.replace(/Ofrendas\[\d+\]/, `Ofrendas[${idx}]`);
|
||||
});
|
||||
});
|
||||
ofrendaIndex = document.querySelectorAll('.ofrenda-item').length;
|
||||
}
|
||||
|
||||
function updateDescuentoIndices() {
|
||||
document.querySelectorAll('.ofrenda-item').forEach((ofrendaItem) => {
|
||||
ofrendaItem.querySelectorAll('.descuento-item').forEach((descItem, descIdx) => {
|
||||
descItem.querySelectorAll('[name*="Descuentos["]').forEach(input => {
|
||||
input.name = input.name.replace(/Descuentos\[\d+\]/, `Descuentos[${descIdx}]`);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function calculateTotals() {
|
||||
let totalOfrendas = 0;
|
||||
let totalDescuentos = 0;
|
||||
|
||||
document.querySelectorAll('.ofrenda-item').forEach(item => {
|
||||
const monto = parseFloat(item.querySelector('.ofrenda-monto').value) || 0;
|
||||
let descuentosSum = 0;
|
||||
|
||||
item.querySelectorAll('.descuento-monto').forEach(descInput => {
|
||||
descuentosSum += parseFloat(descInput.value) || 0;
|
||||
});
|
||||
|
||||
const neto = monto - descuentosSum;
|
||||
item.querySelector('.ofrenda-neto').textContent = `$ ${neto.toFixed(2)}`;
|
||||
|
||||
totalOfrendas += monto;
|
||||
totalDescuentos += descuentosSum;
|
||||
});
|
||||
|
||||
document.getElementById('totalOfrendas').textContent = `$ ${totalOfrendas.toFixed(2)}`;
|
||||
document.getElementById('totalDescuentos').textContent = `$ ${totalDescuentos.toFixed(2)}`;
|
||||
document.getElementById('montoNeto').textContent = `$ ${(totalOfrendas - totalDescuentos).toFixed(2)}`;
|
||||
}
|
||||
|
||||
// Add first ofrenda on page load
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
addOfrenda();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
120
RS_system/Views/Ofrenda/Details.cshtml
Normal file
120
RS_system/Views/Ofrenda/Details.cshtml
Normal file
@@ -0,0 +1,120 @@
|
||||
@model Rs_system.Models.RegistroCulto
|
||||
@{
|
||||
ViewData["Title"] = "Detalles del Registro";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Detalles del Registro</h4>
|
||||
<p class="text-muted mb-0">@Model.Fecha.ToString("dddd, dd 'de' MMMM 'de' yyyy")</p>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-outline-primary me-2">
|
||||
<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="row">
|
||||
<!-- Left Column: Summary -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card-custom">
|
||||
<h6 class="mb-3"><i class="bi bi-info-circle me-2"></i>Información General</h6>
|
||||
|
||||
<dl class="mb-0">
|
||||
<dt class="text-muted">Fecha</dt>
|
||||
<dd>@Model.Fecha.ToString("dd/MM/yyyy")</dd>
|
||||
|
||||
<dt class="text-muted">Observaciones</dt>
|
||||
<dd>@(string.IsNullOrEmpty(Model.Observaciones) ? "Sin observaciones" : Model.Observaciones)</dd>
|
||||
|
||||
<dt class="text-muted">Registrado por</dt>
|
||||
<dd>@(Model.CreadoPor ?? "Sistema")</dd>
|
||||
|
||||
<dt class="text-muted">Fecha de Registro</dt>
|
||||
<dd>@Model.CreadoEn.ToString("dd/MM/yyyy HH:mm")</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- Summary Card -->
|
||||
<div class="card-custom mt-3">
|
||||
<h6 class="mb-3"><i class="bi bi-calculator me-2"></i>Resumen</h6>
|
||||
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Ofrendas:</span>
|
||||
<strong>$ @Model.TotalOfrendas.ToString("N2")</strong>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Descuentos:</span>
|
||||
<strong class="text-warning">$ @Model.TotalDescuentos.ToString("N2")</strong>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="fw-bold">Monto Neto:</span>
|
||||
<strong class="text-success fs-5">$ @Model.MontoNeto.ToString("N2")</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column: Offerings Detail -->
|
||||
<div class="col-lg-8">
|
||||
<div class="card-custom">
|
||||
<h6 class="mb-3"><i class="bi bi-cash-stack me-2"></i>Detalle de Ofrendas</h6>
|
||||
|
||||
@if (!Model.Ofrendas.Any())
|
||||
{
|
||||
<div class="text-center text-muted py-4">
|
||||
<i class="bi bi-inbox fs-1 d-block mb-2"></i>
|
||||
No hay ofrendas registradas
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var ofrenda in Model.Ofrendas)
|
||||
{
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-light d-flex justify-content-between align-items-center py-2">
|
||||
<span class="fw-semibold">@ofrenda.Concepto</span>
|
||||
<span class="badge bg-primary">$ @ofrenda.Monto.ToString("N2")</span>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
@if (ofrenda.Descuentos.Any())
|
||||
{
|
||||
<table class="table table-sm mb-0">
|
||||
<thead>
|
||||
<tr class="text-muted">
|
||||
<th>Descuento</th>
|
||||
<th class="text-end">Monto</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var descuento in ofrenda.Descuentos)
|
||||
{
|
||||
<tr>
|
||||
<td>@descuento.Concepto</td>
|
||||
<td class="text-end text-warning">-$ @descuento.Monto.ToString("N2")</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="border-top">
|
||||
<th>Neto</th>
|
||||
<th class="text-end text-success">$ @ofrenda.MontoNeto.ToString("N2")</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="text-muted mb-0 small">Sin descuentos aplicados</p>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
294
RS_system/Views/Ofrenda/Edit.cshtml
Normal file
294
RS_system/Views/Ofrenda/Edit.cshtml
Normal file
@@ -0,0 +1,294 @@
|
||||
@model Rs_system.Models.ViewModels.RegistroCultoViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Editar Registro de Ofrendas";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Editar Registro de Ofrendas</h4>
|
||||
<p class="text-muted mb-0">Modificar registro del @Model.Fecha.ToString("dd/MM/yyyy")</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i> Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form asp-action="Edit" method="post" id="ofrendaForm">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="alert alert-danger"></div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Left Column: Basic Info -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card-custom">
|
||||
<h6 class="mb-3"><i class="bi bi-calendar-event me-2"></i>Información del Culto</h6>
|
||||
|
||||
<div class="mb-3">
|
||||
<label asp-for="Fecha" class="form-label"></label>
|
||||
<input asp-for="Fecha" class="form-control" type="date" />
|
||||
<span asp-validation-for="Fecha" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label asp-for="Observaciones" class="form-label"></label>
|
||||
<textarea asp-for="Observaciones" class="form-control" rows="3" placeholder="Notas adicionales..."></textarea>
|
||||
<span asp-validation-for="Observaciones" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Summary -->
|
||||
<div class="card-custom mt-3">
|
||||
<h6 class="mb-3"><i class="bi bi-calculator me-2"></i>Resumen</h6>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Ofrendas:</span>
|
||||
<strong id="totalOfrendas">$ 0.00</strong>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Descuentos:</span>
|
||||
<strong id="totalDescuentos" class="text-warning">$ 0.00</strong>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="fw-bold">Monto Neto:</span>
|
||||
<strong id="montoNeto" class="text-success fs-5">$ 0.00</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column: Offerings -->
|
||||
<div class="col-lg-8">
|
||||
<div class="card-custom">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h6 class="mb-0"><i class="bi bi-cash-stack me-2"></i>Ofrendas</h6>
|
||||
<button type="button" class="btn btn-sm btn-primary-custom" onclick="addOfrenda()">
|
||||
<i class="bi bi-plus-lg me-1"></i> Agregar Ofrenda
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="ofrendasContainer">
|
||||
<!-- Existing offerings will be loaded here -->
|
||||
</div>
|
||||
|
||||
<div id="emptyState" class="text-center text-muted py-4" style="display: none;">
|
||||
<i class="bi bi-plus-circle fs-1 d-block mb-2"></i>
|
||||
Haga clic en "Agregar Ofrenda" para comenzar
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom">
|
||||
<i class="bi bi-check-lg me-1"></i> Guardar Cambios
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Ofrenda Template -->
|
||||
<template id="ofrendaTemplate">
|
||||
<div class="ofrenda-item card mb-3" data-index="0">
|
||||
<div class="card-header bg-light d-flex justify-content-between align-items-center py-2">
|
||||
<span class="fw-semibold">Ofrenda #<span class="ofrenda-number">1</span></span>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="removeOfrenda(this)">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Concepto *</label>
|
||||
<input type="text" name="Ofrendas[0].Concepto" class="form-control ofrenda-concepto" placeholder="Ej: Ofrenda general" required />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Monto *</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="number" step="0.01" min="0.01" name="Ofrendas[0].Monto" class="form-control ofrenda-monto" placeholder="0.00" required onchange="calculateTotals()" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="descuentos-section">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<small class="text-muted"><i class="bi bi-dash-circle me-1"></i>Descuentos</small>
|
||||
<button type="button" class="btn btn-sm btn-outline-warning" onclick="addDescuento(this)">
|
||||
<i class="bi bi-plus"></i> Agregar Descuento
|
||||
</button>
|
||||
</div>
|
||||
<div class="descuentos-container">
|
||||
<!-- Descuentos will be added here -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 pt-2 border-top d-flex justify-content-end">
|
||||
<span class="text-muted me-2">Neto:</span>
|
||||
<strong class="ofrenda-neto text-success">$ 0.00</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Descuento Template -->
|
||||
<template id="descuentoTemplate">
|
||||
<div class="descuento-item row g-2 mb-2">
|
||||
<div class="col-md-5">
|
||||
<input type="text" name="Ofrendas[0].Descuentos[0].Concepto" class="form-control form-control-sm descuento-concepto" placeholder="Concepto descuento" required />
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="number" step="0.01" min="0.01" name="Ofrendas[0].Descuentos[0].Monto" class="form-control descuento-monto" placeholder="0.00" required onchange="calculateTotals()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-danger w-100" onclick="removeDescuento(this)">
|
||||
<i class="bi bi-x"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
let ofrendaIndex = 0;
|
||||
|
||||
// Existing data from model
|
||||
const existingData = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(Model.Ofrendas));
|
||||
|
||||
function addOfrenda(concepto = '', monto = 0, descuentos = []) {
|
||||
const container = document.getElementById('ofrendasContainer');
|
||||
const template = document.getElementById('ofrendaTemplate');
|
||||
const clone = template.content.cloneNode(true);
|
||||
|
||||
// Update indices
|
||||
const ofrendaItem = clone.querySelector('.ofrenda-item');
|
||||
ofrendaItem.dataset.index = ofrendaIndex;
|
||||
ofrendaItem.querySelector('.ofrenda-number').textContent = ofrendaIndex + 1;
|
||||
|
||||
// Update input names and values
|
||||
clone.querySelectorAll('[name]').forEach(input => {
|
||||
input.name = input.name.replace('[0]', `[${ofrendaIndex}]`);
|
||||
});
|
||||
|
||||
// Set values
|
||||
clone.querySelector('.ofrenda-concepto').value = concepto;
|
||||
clone.querySelector('.ofrenda-monto').value = monto || '';
|
||||
|
||||
container.appendChild(clone);
|
||||
|
||||
// Add existing descuentos
|
||||
const addedItem = container.lastElementChild;
|
||||
descuentos.forEach(d => {
|
||||
addDescuentoToItem(addedItem, d.concepto, d.monto);
|
||||
});
|
||||
|
||||
document.getElementById('emptyState').style.display = 'none';
|
||||
ofrendaIndex++;
|
||||
calculateTotals();
|
||||
}
|
||||
|
||||
function removeOfrenda(btn) {
|
||||
btn.closest('.ofrenda-item').remove();
|
||||
updateOfrendaIndices();
|
||||
calculateTotals();
|
||||
|
||||
if (document.querySelectorAll('.ofrenda-item').length === 0) {
|
||||
document.getElementById('emptyState').style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
function addDescuento(btn) {
|
||||
addDescuentoToItem(btn.closest('.ofrenda-item'));
|
||||
}
|
||||
|
||||
function addDescuentoToItem(ofrendaItem, concepto = '', monto = 0) {
|
||||
const ofrendaIdx = ofrendaItem.dataset.index;
|
||||
const container = ofrendaItem.querySelector('.descuentos-container');
|
||||
const descuentoIdx = container.querySelectorAll('.descuento-item').length;
|
||||
|
||||
const template = document.getElementById('descuentoTemplate');
|
||||
const clone = template.content.cloneNode(true);
|
||||
|
||||
// Update input names
|
||||
clone.querySelectorAll('[name]').forEach(input => {
|
||||
input.name = input.name.replace('Ofrendas[0]', `Ofrendas[${ofrendaIdx}]`);
|
||||
input.name = input.name.replace('Descuentos[0]', `Descuentos[${descuentoIdx}]`);
|
||||
});
|
||||
|
||||
// Set values
|
||||
clone.querySelector('.descuento-concepto').value = concepto;
|
||||
clone.querySelector('.descuento-monto').value = monto || '';
|
||||
|
||||
container.appendChild(clone);
|
||||
calculateTotals();
|
||||
}
|
||||
|
||||
function removeDescuento(btn) {
|
||||
btn.closest('.descuento-item').remove();
|
||||
updateDescuentoIndices();
|
||||
calculateTotals();
|
||||
}
|
||||
|
||||
function updateOfrendaIndices() {
|
||||
document.querySelectorAll('.ofrenda-item').forEach((item, idx) => {
|
||||
item.dataset.index = idx;
|
||||
item.querySelector('.ofrenda-number').textContent = idx + 1;
|
||||
|
||||
item.querySelectorAll('[name^="Ofrendas["]').forEach(input => {
|
||||
input.name = input.name.replace(/Ofrendas\[\d+\]/, `Ofrendas[${idx}]`);
|
||||
});
|
||||
});
|
||||
ofrendaIndex = document.querySelectorAll('.ofrenda-item').length;
|
||||
}
|
||||
|
||||
function updateDescuentoIndices() {
|
||||
document.querySelectorAll('.ofrenda-item').forEach((ofrendaItem) => {
|
||||
ofrendaItem.querySelectorAll('.descuento-item').forEach((descItem, descIdx) => {
|
||||
descItem.querySelectorAll('[name*="Descuentos["]').forEach(input => {
|
||||
input.name = input.name.replace(/Descuentos\[\d+\]/, `Descuentos[${descIdx}]`);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function calculateTotals() {
|
||||
let totalOfrendas = 0;
|
||||
let totalDescuentos = 0;
|
||||
|
||||
document.querySelectorAll('.ofrenda-item').forEach(item => {
|
||||
const monto = parseFloat(item.querySelector('.ofrenda-monto').value) || 0;
|
||||
let descuentosSum = 0;
|
||||
|
||||
item.querySelectorAll('.descuento-monto').forEach(descInput => {
|
||||
descuentosSum += parseFloat(descInput.value) || 0;
|
||||
});
|
||||
|
||||
const neto = monto - descuentosSum;
|
||||
item.querySelector('.ofrenda-neto').textContent = `$ ${neto.toFixed(2)}`;
|
||||
|
||||
totalOfrendas += monto;
|
||||
totalDescuentos += descuentosSum;
|
||||
});
|
||||
|
||||
document.getElementById('totalOfrendas').textContent = `$ ${totalOfrendas.toFixed(2)}`;
|
||||
document.getElementById('totalDescuentos').textContent = `$ ${totalDescuentos.toFixed(2)}`;
|
||||
document.getElementById('montoNeto').textContent = `$ ${(totalOfrendas - totalDescuentos).toFixed(2)}`;
|
||||
}
|
||||
|
||||
// Load existing data on page load
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
if (existingData && existingData.length > 0) {
|
||||
existingData.forEach(ofrenda => {
|
||||
addOfrenda(
|
||||
ofrenda.concepto,
|
||||
ofrenda.monto,
|
||||
ofrenda.descuentos.map(d => ({ concepto: d.concepto, monto: d.monto }))
|
||||
);
|
||||
});
|
||||
} else {
|
||||
addOfrenda();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
152
RS_system/Views/Ofrenda/Index.cshtml
Normal file
152
RS_system/Views/Ofrenda/Index.cshtml
Normal file
@@ -0,0 +1,152 @@
|
||||
@model IEnumerable<Rs_system.Models.RegistroCulto>
|
||||
@{
|
||||
ViewData["Title"] = "Registro de Ofrendas";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Registro de Ofrendas</h4>
|
||||
<p class="text-muted mb-0">Gestión de ofrendas por culto</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-plus-lg me-1"></i> Nuevo Registro
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="card-custom mb-4">
|
||||
<form method="get" class="row g-3 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Mes</label>
|
||||
<select name="mes" class="form-select" asp-items="@(ViewBag.Meses as List<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>)">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Año</label>
|
||||
<select name="anio" class="form-select" asp-items="@(ViewBag.Anios as List<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>)">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button type="submit" class="btn btn-outline-primary">
|
||||
<i class="bi bi-funnel me-1"></i> Filtrar
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.querySelector('select[name="mes"]').value = '@ViewBag.MesActual';
|
||||
document.querySelector('select[name="anio"]').value = '@ViewBag.AnioActual';
|
||||
</script>
|
||||
|
||||
<!-- 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 Ofrendas</h6>
|
||||
<h3 class="text-primary mb-0">$ @Model.Sum(r => r.TotalOfrendas).ToString("N2")</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card-custom text-center">
|
||||
<h6 class="text-muted mb-2">Total Descuentos</h6>
|
||||
<h3 class="text-warning mb-0">$ @Model.Sum(r => r.TotalDescuentos).ToString("N2")</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card-custom text-center">
|
||||
<h6 class="text-muted mb-2">Monto Neto</h6>
|
||||
<h3 class="text-success mb-0">$ @Model.Sum(r => r.MontoNeto).ToString("N2")</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Records Table -->
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fecha</th>
|
||||
<th>Ofrendas</th>
|
||||
<th class="text-end">Total</th>
|
||||
<th class="text-end">Descuentos</th>
|
||||
<th class="text-end">Neto</th>
|
||||
<th class="text-center">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!Model.Any())
|
||||
{
|
||||
<tr>
|
||||
<td colspan="6" class="text-center text-muted py-4">
|
||||
<i class="bi bi-inbox fs-1 d-block mb-2"></i>
|
||||
No hay registros para el período seleccionado
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var registro in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<strong>@registro.Fecha.ToString("dd/MM/yyyy")</strong>
|
||||
<br>
|
||||
<small class="text-muted">@registro.Fecha.DayOfWeek</small>
|
||||
</td>
|
||||
<td>
|
||||
@foreach (var ofrenda in registro.Ofrendas.Take(3))
|
||||
{
|
||||
<span class="badge bg-light text-dark me-1">@ofrenda.Concepto</span>
|
||||
}
|
||||
@if (registro.Ofrendas.Count > 3)
|
||||
{
|
||||
<span class="badge bg-secondary">+@(registro.Ofrendas.Count - 3) más</span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-end">$ @registro.TotalOfrendas.ToString("N2")</td>
|
||||
<td class="text-end text-warning">$ @registro.TotalDescuentos.ToString("N2")</td>
|
||||
<td class="text-end text-success fw-bold">$ @registro.MontoNeto.ToString("N2")</td>
|
||||
<td class="text-center">
|
||||
<a asp-action="Details" asp-route-id="@registro.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="@registro.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(@registro.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 registro?',
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
}
|
||||
90
RS_system/Views/Permiso/Create.cshtml
Normal file
90
RS_system/Views/Permiso/Create.cshtml
Normal file
@@ -0,0 +1,90 @@
|
||||
@model Rs_system.Models.Permiso
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Nueva Opción de Menú";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Nueva Opción de Menú</h4>
|
||||
<p class="text-muted mb-0">Crear un nuevo permiso o menú</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="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="ModuloId" class="form-label">Módulo (Sección)</label>
|
||||
<select asp-for="ModuloId" class="form-select"
|
||||
asp-items="@(new SelectList(ViewBag.Modulos, "Id", "Nombre"))">
|
||||
<option value="">-- Seleccione un Módulo --</option>
|
||||
</select>
|
||||
<span asp-validation-for="ModuloId" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Codigo" class="form-label">Código Único (Controlador)</label>
|
||||
<input asp-for="Codigo" class="form-control" placeholder="Ej: Expediente" />
|
||||
<span asp-validation-for="Codigo" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<label asp-for="Nombre" class="form-label">Nombre en Menú</label>
|
||||
<input asp-for="Nombre" class="form-control" placeholder="Ej: Expedientes" />
|
||||
<span asp-validation-for="Nombre" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label asp-for="Orden" class="form-label">Orden</label>
|
||||
<input asp-for="Orden" class="form-control" type="number" />
|
||||
<span asp-validation-for="Orden" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<label asp-for="Url" class="form-label">Ruta (URL)</label>
|
||||
<input asp-for="Url" class="form-control" placeholder="Ej: /Expediente/Index" />
|
||||
<span asp-validation-for="Url" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label asp-for="Icono" class="form-label">Icono (Bootstrap Icons)</label>
|
||||
<input asp-for="Icono" class="form-control" placeholder="Ej: bi-folder" />
|
||||
<span asp-validation-for="Icono" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" asp-for="EsMenu">
|
||||
<label class="form-check-label" asp-for="EsMenu">Mostrar en el menú lateral</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label asp-for="Descripcion" class="form-label">Descripción</label>
|
||||
<textarea asp-for="Descripcion" class="form-control" rows="2"></textarea>
|
||||
<span asp-validation-for="Descripcion" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom px-4">
|
||||
<i class="bi bi-save me-2"></i> Guardar Opción
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
91
RS_system/Views/Permiso/Edit.cshtml
Normal file
91
RS_system/Views/Permiso/Edit.cshtml
Normal file
@@ -0,0 +1,91 @@
|
||||
@model Rs_system.Models.Permiso
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Editar Opción de Menú";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Editar Opción de Menú</h4>
|
||||
<p class="text-muted mb-0">Modificar permiso existente</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="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="ModuloId" class="form-label">Módulo (Sección)</label>
|
||||
<select asp-for="ModuloId" class="form-select"
|
||||
asp-items="@(new SelectList(ViewBag.Modulos, "Id", "Nombre"))">
|
||||
<option value="">-- Seleccione un Módulo --</option>
|
||||
</select>
|
||||
<span asp-validation-for="ModuloId" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Codigo" class="form-label">Código Único</label>
|
||||
<input asp-for="Codigo" class="form-control" readonly />
|
||||
<span asp-validation-for="Codigo" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<label asp-for="Nombre" class="form-label">Nombre en Menú</label>
|
||||
<input asp-for="Nombre" class="form-control" />
|
||||
<span asp-validation-for="Nombre" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label asp-for="Orden" class="form-label">Orden</label>
|
||||
<input asp-for="Orden" class="form-control" type="number" />
|
||||
<span asp-validation-for="Orden" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<label asp-for="Url" class="form-label">Ruta (URL)</label>
|
||||
<input asp-for="Url" class="form-control" />
|
||||
<span asp-validation-for="Url" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label asp-for="Icono" class="form-label">Icono</label>
|
||||
<input asp-for="Icono" class="form-control" />
|
||||
<span asp-validation-for="Icono" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" asp-for="EsMenu">
|
||||
<label class="form-check-label" asp-for="EsMenu">Mostrar en el menú lateral</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label asp-for="Descripcion" class="form-label">Descripción</label>
|
||||
<textarea asp-for="Descripcion" class="form-control" rows="2"></textarea>
|
||||
<span asp-validation-for="Descripcion" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom px-4">
|
||||
<i class="bi bi-save me-2"></i> Guardar Cambios
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
96
RS_system/Views/Permiso/Index.cshtml
Normal file
96
RS_system/Views/Permiso/Index.cshtml
Normal file
@@ -0,0 +1,96 @@
|
||||
@model IEnumerable<Rs_system.Models.Permiso>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Gestión de Menú y Permisos";
|
||||
}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Gestión de Menú y Permisos</h4>
|
||||
<p class="text-muted mb-0">Administración de opciones del sistema</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-plus-lg me-1"></i> Nueva Opción
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if (TempData["ErrorMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i> @TempData["ErrorMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Módulo</th>
|
||||
<th>Orden</th>
|
||||
<th>Nombre</th>
|
||||
<th>Ruta (URL)</th>
|
||||
<th>Icono</th>
|
||||
<th class="text-center">Es Menú</th>
|
||||
<th class="text-center">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<span class="badge bg-info text-dark">
|
||||
<i class="bi @item.Modulo?.Icono me-1"></i>
|
||||
@(item.Modulo?.Nombre ?? "Sin Módulo")
|
||||
</span>
|
||||
</td>
|
||||
<td><span class="badge bg-secondary">@item.Orden</span></td>
|
||||
<td class="fw-bold">@item.Nombre</td>
|
||||
<td class="font-monospace small">@item.Url</td>
|
||||
<td><i class="bi @item.Icono me-2"></i>@item.Icono</td>
|
||||
<td class="text-center">
|
||||
@if (item.EsMenu)
|
||||
{
|
||||
<span class="text-success"><i class="bi bi-check-circle-fill"></i></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted"><i class="bi bi-x-circle"></i></span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-outline-primary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline-danger" title="Eliminar"
|
||||
onclick="confirmDelete(@item.Id, '@item.Nombre')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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, name) {
|
||||
if (confirm(`¿Está seguro de que desea eliminar "${name}"?`)) {
|
||||
document.getElementById('deleteId').value = id;
|
||||
document.getElementById('deleteForm').submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
56
RS_system/Views/Rol/Create.cshtml
Normal file
56
RS_system/Views/Rol/Create.cshtml
Normal file
@@ -0,0 +1,56 @@
|
||||
@model Rs_system.Models.RolSistema
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Nuevo Rol";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Nuevo Rol</h4>
|
||||
<p class="text-muted mb-0">Crear un nuevo rol de usuario</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="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Codigo" class="form-label">Código del Rol</label>
|
||||
<input asp-for="Codigo" class="form-control" placeholder="Ej: ADMIN, OPERADOR" />
|
||||
<span asp-validation-for="Codigo" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Nombre" class="form-label">Nombre</label>
|
||||
<input asp-for="Nombre" class="form-control" placeholder="Ej: Administrador" />
|
||||
<span asp-validation-for="Nombre" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label asp-for="Descripcion" class="form-label">Descripción</label>
|
||||
<textarea asp-for="Descripcion" class="form-control" rows="3" placeholder="Describa las responsabilidades de este rol..."></textarea>
|
||||
<span asp-validation-for="Descripcion" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom px-4">
|
||||
<i class="bi bi-save me-2"></i> Guardar Rol
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
58
RS_system/Views/Rol/Edit.cshtml
Normal file
58
RS_system/Views/Rol/Edit.cshtml
Normal file
@@ -0,0 +1,58 @@
|
||||
@model Rs_system.Models.RolSistema
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Editar Rol";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Editar Rol</h4>
|
||||
<p class="text-muted mb-0">Modificar rol existente</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="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Codigo" class="form-label">Código del Rol</label>
|
||||
<input asp-for="Codigo" class="form-control" readonly />
|
||||
<span asp-validation-for="Codigo" class="text-danger small"></span>
|
||||
<div class="form-text">El código no se puede modificar.</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Nombre" class="form-label">Nombre</label>
|
||||
<input asp-for="Nombre" class="form-control" />
|
||||
<span asp-validation-for="Nombre" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label asp-for="Descripcion" class="form-label">Descripción</label>
|
||||
<textarea asp-for="Descripcion" class="form-control" rows="3"></textarea>
|
||||
<span asp-validation-for="Descripcion" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom px-4">
|
||||
<i class="bi bi-save me-2"></i> Guardar Cambios
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
91
RS_system/Views/Rol/Index.cshtml
Normal file
91
RS_system/Views/Rol/Index.cshtml
Normal file
@@ -0,0 +1,91 @@
|
||||
@model IEnumerable<Rs_system.Models.RolSistema>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Gestión de Roles";
|
||||
}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Gestión de Roles</h4>
|
||||
<p class="text-muted mb-0">Administración de roles y permisos del sistema</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-plus-lg me-1"></i> Nuevo Rol
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if (TempData["SuccessMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<i class="bi bi-check-circle-fill me-2"></i> @TempData["SuccessMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (TempData["ErrorMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i> @TempData["ErrorMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Código</th>
|
||||
<th>Nombre</th>
|
||||
<th>Descripción</th>
|
||||
<th class="text-center">Permisos</th>
|
||||
<th class="text-center">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="font-monospace">@item.Codigo</td>
|
||||
<td class="fw-bold">@item.Nombre</td>
|
||||
<td class="text-muted small">@item.Descripcion</td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-secondary">@item.RolesPermisos.Count asignados</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a asp-action="Permissions" asp-route-id="@item.Id" class="btn btn-outline-info" title="Gestionar Permisos">
|
||||
<i class="bi bi-shield-check"></i>
|
||||
</a>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-outline-primary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline-danger" title="Eliminar"
|
||||
onclick="confirmDelete(@item.Id, '@item.Nombre')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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, name) {
|
||||
if (confirm(`¿Está seguro de que desea eliminar el rol "${name}"?`)) {
|
||||
document.getElementById('deleteId').value = id;
|
||||
document.getElementById('deleteForm').submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
62
RS_system/Views/Rol/Permissions.cshtml
Normal file
62
RS_system/Views/Rol/Permissions.cshtml
Normal file
@@ -0,0 +1,62 @@
|
||||
@model IEnumerable<Rs_system.Models.Permiso>
|
||||
|
||||
@{
|
||||
var rol = ViewBag.Rol as Rs_system.Models.RolSistema;
|
||||
var assignedCodes = ViewBag.AssignedControllerCodes as List<string>;
|
||||
ViewData["Title"] = "Gestionar Acceso a Menú: " + rol?.Nombre;
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h4 class="mb-1">Gestionar Acceso a Menú</h4>
|
||||
<p class="text-muted mb-0">Configurar permisos para: <strong>@rol?.Nombre</strong> (@rol?.Codigo)</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">
|
||||
<p class="text-muted mb-4">Seleccione las opciones del menú que estarán disponibles para este rol.</p>
|
||||
|
||||
<form asp-action="UpdatePermissions" method="post">
|
||||
<input type="hidden" name="rolId" value="@rol?.Id" />
|
||||
|
||||
@{
|
||||
var groupedControllers = Model.GroupBy(c => c.Modulo);
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
@foreach (var group in groupedControllers)
|
||||
{
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100 border-light shadow-sm">
|
||||
<div class="card-header bg-light py-2">
|
||||
<h6 class="mb-0 fw-bold text-primary">@group.Key</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach (var controller in group)
|
||||
{
|
||||
<div class="form-check mb-2">
|
||||
<input class="form-check-input" type="checkbox" name="selectedControllers"
|
||||
value="@controller.Codigo" id="ctrl_@controller.Codigo"
|
||||
@(assignedCodes != null && assignedCodes.Contains(controller.Codigo) ? "checked" : "")>
|
||||
<label class="form-check-label" for="ctrl_@controller.Codigo">
|
||||
<span class="fw-semibold">@controller.Nombre</span>
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end border-top pt-3">
|
||||
<a asp-action="Index" class="btn btn-outline-secondary me-2">Cancelar</a>
|
||||
<button type="submit" class="btn btn-primary-custom px-5">
|
||||
<i class="bi bi-check-all me-2"></i> Guardar Configuración
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
19
RS_system/Views/Shared/Components/Menu/Default.cshtml
Normal file
19
RS_system/Views/Shared/Components/Menu/Default.cshtml
Normal file
@@ -0,0 +1,19 @@
|
||||
@model Rs_system.Models.ViewModels.MenuViewModel
|
||||
|
||||
@{
|
||||
var currentController = ViewContext.RouteData.Values["controller"]?.ToString();
|
||||
var currentAction = ViewContext.RouteData.Values["action"]?.ToString();
|
||||
var currentUrl = $"/{currentController}/{currentAction}";
|
||||
ViewData["CurrentUrl"] = currentUrl;
|
||||
}
|
||||
|
||||
<nav class="nav flex-column">
|
||||
<a class="nav-link-custom @(currentController == "Home" ? "active" : "")" asp-controller="Home" asp-action="Index">
|
||||
<i class="bi bi-house-door"></i> Inicio
|
||||
</a>
|
||||
|
||||
@foreach (var item in Model.Items)
|
||||
{
|
||||
<partial name="Components/Menu/_MenuItem" model="item" view-data="ViewData" />
|
||||
}
|
||||
</nav>
|
||||
46
RS_system/Views/Shared/Components/Menu/_MenuItem.cshtml
Normal file
46
RS_system/Views/Shared/Components/Menu/_MenuItem.cshtml
Normal file
@@ -0,0 +1,46 @@
|
||||
@using Rs_system.Models.ViewModels
|
||||
@model MenuItem
|
||||
|
||||
@{
|
||||
var currentUrl = ViewData["CurrentUrl"] as string ?? "";
|
||||
var collapseId = "menu-" + Guid.NewGuid().ToString("N");
|
||||
|
||||
// Helper function to check active state recursively
|
||||
bool IsItemOrChildActive(MenuItem item, string url)
|
||||
{
|
||||
if (!item.IsGroup && !string.IsNullOrEmpty(item.Url))
|
||||
{
|
||||
return url.StartsWith(item.Url, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
return item.Children.Any(c => IsItemOrChildActive(c, url));
|
||||
}
|
||||
|
||||
bool isExpanded = Model.IsGroup && IsItemOrChildActive(Model, currentUrl);
|
||||
}
|
||||
|
||||
@if (Model.IsGroup)
|
||||
{
|
||||
<div class="nav-section-title mt-3" data-bs-toggle="collapse" data-bs-target="#@collapseId" aria-expanded="@isExpanded.ToString().ToLower()" style="cursor:pointer">
|
||||
@if (!string.IsNullOrEmpty(Model.Icon))
|
||||
{
|
||||
<i class="bi @Model.Icon me-1"></i>
|
||||
}
|
||||
@Model.Title
|
||||
<i class="bi bi-chevron-down float-end small"></i>
|
||||
</div>
|
||||
<div class="collapse @(isExpanded ? "show" : "")" id="@collapseId">
|
||||
<div class="ms-3 border-start ps-2">
|
||||
@foreach (var child in Model.Children)
|
||||
{
|
||||
<partial name="Components/Menu/_MenuItem" model="child" view-data="ViewData" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
var isActive = !string.IsNullOrEmpty(Model.Url) && currentUrl.StartsWith(Model.Url, StringComparison.OrdinalIgnoreCase);
|
||||
<a class="nav-link-custom @(isActive ? "active" : "")" href="@Model.Url">
|
||||
<i class="bi @Model.Icon"></i> @Model.Title
|
||||
</a>
|
||||
}
|
||||
25
RS_system/Views/Shared/Error.cshtml
Normal file
25
RS_system/Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
93
RS_system/Views/Shared/_Layout.cshtml
Normal file
93
RS_system/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,93 @@
|
||||
@inject Rs_system.Services.IConfiguracionService ConfigService
|
||||
@{
|
||||
var logoUrl = await ConfigService.GetValorOrDefaultAsync("LOGO_FOUNDATION", "/assets/home.png");
|
||||
var nameShort = await ConfigService.GetValorOrDefaultAsync("NAME_FOUNDATION_SHORT", "Rs_system");
|
||||
var nameFoundation = await ConfigService.GetValorOrDefaultAsync("NAME_FOUNDATION", "Rs_system");
|
||||
var descriptionShort = await ConfigService.GetValorOrDefaultAsync("DESCRIPTION_SHORT", "Fundacion sin fines de lucro");
|
||||
var version = await ConfigService.GetValorOrDefaultAsync("VERSION_SYSTEM", "1.0.0");
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>@ViewData["Title"] - @nameShort</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="~/css/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="~/css/all.min.css">
|
||||
<link rel="stylesheet" href="~/css/toastr.min.css">
|
||||
<link rel="stylesheet" href="~/css/sweetalert2.min.css">
|
||||
<link rel="stylesheet" href="~/css/inter.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true"/>
|
||||
<!--<link rel="stylesheet" href="~/Rs_system.styles.css" asp-append-version="true"/>-->
|
||||
<link rel="manifest" href="~/manifest.json">
|
||||
<meta name="theme-color" content="#1e293b">
|
||||
@RenderSection("Styles", required: false)
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-wrapper">
|
||||
<div class="sidebar-overlay" id="sidebarOverlay"></div>
|
||||
<!-- Sidebar -->
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<a class="sidebar-brand d-flex align-items-center" asp-controller="Home" asp-action="Index">
|
||||
<img src="@logoUrl" alt="Logo" class="me-2" style="height: 32px; width: auto; object-fit: contain;" />
|
||||
<span>@nameShort</span>
|
||||
</a>
|
||||
</div>
|
||||
<nav class="sidebar-nav p-3">
|
||||
@await Component.InvokeAsync("Menu")
|
||||
</nav>
|
||||
<div class="sidebar-footer p-3 border-top border-secondary">
|
||||
<small class="text-muted">v @version © 2026</small>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="main-content">
|
||||
<header class="top-header">
|
||||
<div class="header-left d-flex align-items-center">
|
||||
<button id="sidebarToggle" class="btn btn-link text-dark p-0 me-3">
|
||||
<i class="bi bi-list fs-4"></i>
|
||||
</button>
|
||||
<h5 class="mb-0 fw-semibold">@ViewData["Title"]</h5>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<partial name="_LoginPartial"/>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="page-container">
|
||||
@RenderBody()
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted small">@nameFoundation © 2026 - @descriptionShort.</span>
|
||||
<div class="small text-muted">
|
||||
<i class="bi bi-shield-check me-1"></i> Sistema Seguro
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/js/toastr.min.js"></script>
|
||||
<script src="~/js/sweetalert.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js')
|
||||
.then(reg => console.log('Service Worker registrado', reg))
|
||||
.catch(err => console.log('Error registrando Service Worker', err));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
48
RS_system/Views/Shared/_Layout.cshtml.css
Normal file
48
RS_system/Views/Shared/_Layout.cshtml.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
for details on configuring this project to bundle and minify static web assets. */
|
||||
|
||||
a.navbar-brand {
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0077cc;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
button.accept-policy {
|
||||
font-size: 1rem;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
line-height: 60px;
|
||||
}
|
||||
33
RS_system/Views/Shared/_LoginPartial.cshtml
Normal file
33
RS_system/Views/Shared/_LoginPartial.cshtml
Normal file
@@ -0,0 +1,33 @@
|
||||
@using System.Security.Claims
|
||||
|
||||
<ul class="navbar-nav">
|
||||
@if (User.Identity?.IsAuthenticated == true)
|
||||
{
|
||||
var fullName = User.FindFirstValue("FullName") ?? User.Identity.Name;
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="user-welcome">Hola, @fullName</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><h6 class="dropdown-header">@User.Identity.Name</h6></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<form asp-controller="Account" asp-action="Logout" method="post">
|
||||
<button type="submit" class="dropdown-item">
|
||||
<i class="bi bi-box-arrow-right me-2"></i>Cerrar Sesión
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-controller="Account" asp-action="Register">Registrarse</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-controller="Account" asp-action="Login">Iniciar Sesión</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
2
RS_system/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
2
RS_system/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
@@ -0,0 +1,2 @@
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>
|
||||
96
RS_system/Views/Usuario/Create.cshtml
Normal file
96
RS_system/Views/Usuario/Create.cshtml
Normal file
@@ -0,0 +1,96 @@
|
||||
@model Rs_system.Models.ViewModels.UsuarioViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Nuevo Usuario";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Nuevo Usuario</h2>
|
||||
<p class="text-muted small mb-0">Cree una nueva cuenta de acceso administrativo.</p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Create" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">Información Personal</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Nombres" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Nombres" class="form-control" />
|
||||
<span asp-validation-for="Nombres" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Apellidos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Apellidos" class="form-control" />
|
||||
<span asp-validation-for="Apellidos" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Email" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Email" class="form-control" />
|
||||
<span asp-validation-for="Email" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Telefono" class="form-label"></label>
|
||||
<input asp-for="Telefono" class="form-control" />
|
||||
<span asp-validation-for="Telefono" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-4">
|
||||
<h6 class="border-bottom pb-2 mb-3"><i class="bi bi-person-badge me-2"></i>Asignación de Roles</h6>
|
||||
<div class="row g-3">
|
||||
@foreach (var role in ViewBag.Roles as List<Rs_system.Models.RolSistema>)
|
||||
{
|
||||
<div class="col-md-4">
|
||||
<div class="form-check card p-2 border-light shadow-sm">
|
||||
<input class="form-check-input ms-0 me-2" type="checkbox" name="SelectedRoles" value="@role.Id" id="role_@role.Id">
|
||||
<label class="form-check-label" for="role_@role.Id">
|
||||
<strong>@role.Nombre</strong><br />
|
||||
<small class="text-muted">@role.Descripcion</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">Credenciales de Acceso</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-12">
|
||||
<label asp-for="NombreUsuario" class="form-label fw-semibold"></label>
|
||||
<input asp-for="NombreUsuario" class="form-control" />
|
||||
<span asp-validation-for="NombreUsuario" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Contrasena" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Contrasena" class="form-control" />
|
||||
<span asp-validation-for="Contrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="ConfirmarContrasena" class="form-label fw-semibold"></label>
|
||||
<input asp-for="ConfirmarContrasena" class="form-control" />
|
||||
<span asp-validation-for="ConfirmarContrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
|
||||
<button type="submit" class="btn btn-primary-custom px-5">
|
||||
<i class="bi bi-save me-2"></i>Crear Usuario
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
114
RS_system/Views/Usuario/Edit.cshtml
Normal file
114
RS_system/Views/Usuario/Edit.cshtml
Normal file
@@ -0,0 +1,114 @@
|
||||
@model Rs_system.Models.ViewModels.UsuarioViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Editar Usuario";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Editar Usuario</h2>
|
||||
<p class="text-muted small mb-0">Actualizando perfil de: <strong>@Model.NombreUsuario</strong></p>
|
||||
</div>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Volver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card-custom">
|
||||
<form asp-action="Edit" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">Información Personal</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Nombres" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Nombres" class="form-control" />
|
||||
<span asp-validation-for="Nombres" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Apellidos" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Apellidos" class="form-control" />
|
||||
<span asp-validation-for="Apellidos" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Email" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Email" class="form-control" />
|
||||
<span asp-validation-for="Email" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Telefono" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Telefono" class="form-control" />
|
||||
<span asp-validation-for="Telefono" class="text-danger small"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-4">
|
||||
<h6 class="border-bottom pb-2 mb-3"><i class="bi bi-person-badge me-2"></i>Asignación de Roles</h6>
|
||||
<div class="row g-3">
|
||||
@foreach (var role in ViewBag.Roles as List<Rs_system.Models.RolSistema>)
|
||||
{
|
||||
<div class="col-md-4">
|
||||
<div class="form-check card p-2 border-light shadow-sm">
|
||||
<input class="form-check-input ms-0 me-2" type="checkbox" name="SelectedRoles" value="@role.Id" id="role_@role.Id"
|
||||
@(Model.SelectedRoles.Contains(role.Id) ? "checked" : "")>
|
||||
<label class="form-check-label" for="role_@role.Id">
|
||||
<strong>@role.Nombre</strong><br />
|
||||
<small class="text-muted">@role.Descripcion</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="mb-4 text-primary border-bottom pb-2">Configuración de Cuenta</h5>
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="NombreUsuario" class="form-label fw-semibold"></label>
|
||||
<input asp-for="NombreUsuario" class="form-control" />
|
||||
<span asp-validation-for="NombreUsuario" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Activo" class="form-label fw-semibold"></label>
|
||||
<select asp-for="Activo" class="form-select">
|
||||
<option value="true">Activo</option>
|
||||
<option value="false">Inactivo</option>
|
||||
</select>
|
||||
<span asp-validation-for="Activo" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info small">
|
||||
<i class="bi bi-info-circle me-2"></i>
|
||||
Deje los campos de contraseña en blanco si no desea cambiarla.
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Contrasena" class="form-label fw-semibold">Nueva Contraseña</label>
|
||||
<input asp-for="Contrasena" class="form-control" placeholder="Opcional" />
|
||||
<span asp-validation-for="Contrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="ConfirmarContrasena" class="form-label fw-semibold"></label>
|
||||
<input asp-for="ConfirmarContrasena" class="form-control" placeholder="Opcional" />
|
||||
<span asp-validation-for="ConfirmarContrasena" class="text-danger small"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
|
||||
<button type="submit" class="btn btn-primary-custom px-5">
|
||||
<i class="bi bi-check2-circle me-2"></i>Actualizar Usuario
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
97
RS_system/Views/Usuario/Index.cshtml
Normal file
97
RS_system/Views/Usuario/Index.cshtml
Normal file
@@ -0,0 +1,97 @@
|
||||
@model IEnumerable<Rs_system.Models.Usuario>
|
||||
@{
|
||||
ViewData["Title"] = "Gestión de Usuarios";
|
||||
}
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h2 class="mb-1">Usuarios del Sistema</h2>
|
||||
<p class="text-muted small mb-0">Administre las cuentas de acceso y perfiles del personal administrativo.</p>
|
||||
</div>
|
||||
<a asp-action="Create" class="btn btn-primary-custom">
|
||||
<i class="bi bi-person-plus-fill me-2"></i>Nuevo Usuario
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card-custom">
|
||||
<div class="table-responsive">
|
||||
<table class="table-custom">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Usuario</th>
|
||||
<th>Nombre Completo</th>
|
||||
<th>Email</th>
|
||||
<th>Último Acceso</th>
|
||||
<th>Estado</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="fw-bold">@item.NombreUsuario</td>
|
||||
<td>@item.Persona.Nombres @item.Persona.Apellidos</td>
|
||||
<td>@item.Email</td>
|
||||
<td class="small text-muted">
|
||||
@(item.UltimoLogin?.ToString("dd/MM/yyyy HH:mm") ?? "Nunca")
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge @(item.Activo ? "bg-success" : "bg-danger")">
|
||||
@(item.Activo ? "Activo" : "Inactivo")
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-sm btn-outline-secondary" title="Editar">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
@if (item.Activo && item.NombreUsuario != User.Identity?.Name)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" title="Desactivar"
|
||||
onclick="confirmarDesactivacion(@item.Id, '@item.NombreUsuario')">
|
||||
<i class="bi bi-person-x"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal de Confirmación -->
|
||||
<div class="modal fade" id="modalDesactivar" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Confirmar Desactivación</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
¿Está seguro que desea revocar el acceso al usuario <strong id="nombreUsuario"></strong>?
|
||||
<p class="text-muted small mt-2">El usuario ya no podrá iniciar sesión en el sistema.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
||||
<form id="formDesactivar" asp-action="Desactivar" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" id="usuarioIdDesactivar" />
|
||||
<button type="submit" class="btn btn-danger">Desactivar</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
function confirmarDesactivacion(id, nombre) {
|
||||
document.getElementById('nombreUsuario').innerText = nombre;
|
||||
document.getElementById('usuarioIdDesactivar').value = id;
|
||||
new bootstrap.Modal(document.getElementById('modalDesactivar')).show();
|
||||
}
|
||||
</script>
|
||||
}
|
||||
3
RS_system/Views/_ViewImports.cshtml
Normal file
3
RS_system/Views/_ViewImports.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@using Rs_system
|
||||
@using Rs_system.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
3
RS_system/Views/_ViewStart.cshtml
Normal file
3
RS_system/Views/_ViewStart.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
Reference in New Issue
Block a user