Advertisement
DimasGarcia

index.cshtml

May 22nd, 2021
2,033
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 2.18 KB | None | 0 0
  1. @using ADSProjectLab.Utilities
  2. @model IEnumerable<ADSProjectLab.Models.Estudiante>
  3.  
  4. @{
  5.     ViewBag.Title = "Estudiantes";
  6.     Layout = "~/Views/Shared/_Layout.cshtml";
  7. }
  8.  
  9. <h2>Listado de estudiantes</h2>
  10. <hr />
  11. <p>
  12.     @Html.ActionLink("Crear", "Form", new { _operacion = Operacion.Insertar }, new { @class = "btn btn-primary" })
  13. </p>
  14. @if (Model.Count() > 0)
  15. {
  16. <table class="table table-bordered table-striped">
  17.     <tr>
  18.         <th>
  19.             @Html.DisplayNameFor(model => model.Codigo)
  20.         </th>
  21.         <th>
  22.             @Html.DisplayNameFor(model => model.Email)
  23.         </th>
  24.         <th>
  25.             @Html.DisplayNameFor(model => model.Nombres)
  26.         </th>
  27.         <th>
  28.             @Html.DisplayNameFor(model => model.Apellidos)
  29.         </th>
  30.         <th>
  31.             @Html.DisplayNameFor(model => model.IdCarrera)
  32.         </th>
  33.         <th></th>
  34.     </tr>
  35.  
  36.     @foreach (var item in Model)
  37.     {
  38.         <tr>
  39.             <td>
  40.                 @Html.DisplayFor(modelItem => item.Codigo)
  41.             </td>
  42.             <td>
  43.                 @Html.DisplayFor(modelItem => item.Email)
  44.             </td>
  45.             <td>
  46.                 @Html.DisplayFor(modelItem => item.Nombres)
  47.             </td>
  48.             <td>
  49.                 @Html.DisplayFor(modelItem => item.Apellidos)
  50.             </td>
  51.             <td>
  52.                 @Html.DisplayFor(modelItem => item.Carrera.Nombre)
  53.             </td>
  54.             <td>
  55.                 @Html.ActionLink("Editar", "Form", new { id = item.Id, _operacion = Operacion.Modificar },
  56.                                                               new { @class = "btn btn-xs btn-warning" })
  57.                 @Html.ActionLink("Ver", "Form", new { id = item.Id, _operacion = Operacion.Ver },
  58.                                                               new { @class = "btn btn-xs btn-default" })
  59.                 @Html.ActionLink("Eliminar", "Delete", new { id = item.Id, _operacion = Operacion.Eliminar }
  60.                                                               , new { @class = "btn btn-xs btn-danger eliminar" })
  61.             </td>
  62.         </tr>
  63.     }
  64.  
  65. </table>
  66. }
  67. else
  68. {
  69. <h4 class="text-center">No hay datos.</h4>
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement