@model IEnumerable @{ ViewData["Title"] = "Préstamos Activos"; }

Préstamos Activos

Artículos actualmente prestados

Nuevo Préstamo Historial
@if (!Model.Any()) {
No hay préstamos activos

Todos los artículos han sido devueltos.

} else {
@foreach (var prestamo in Model) { }
Artículo Persona Cantidad Fecha Préstamo Devolución Estimada Estado Acciones
@prestamo.Articulo?.Codigo
@prestamo.Articulo?.Nombre
@prestamo.PersonaNombre
@if (!string.IsNullOrEmpty(prestamo.PersonaIdentificacion)) {
@prestamo.PersonaIdentificacion
}
@prestamo.Cantidad @prestamo.FechaPrestamo.ToString("dd/MM/yyyy") @if (prestamo.FechaDevolucionEstimada.HasValue) { var diasRestantes = (prestamo.FechaDevolucionEstimada.Value - DateTime.Today).Days; var claseCss = diasRestantes < 0 ? "text-danger" : diasRestantes <= 3 ? "text-warning" : "text-success"; @prestamo.FechaDevolucionEstimada.Value.ToString("dd/MM/yyyy") } else { No definida } @switch (prestamo.Estado) { case "ACTIVO": Activo break; case "ATRASADO": Atrasado break; default: @prestamo.Estado break; }
}
@section Scripts { }