Files
csharp-uebung/FahrzeugeMVC/Views/Fahrzeug/Index.cshtml
2025-05-19 15:28:57 +02:00

42 lines
1001 B
Plaintext

@model FahrzeugListeModel
<p>Diese Fahrzeuge befinden sich derzeit in der Datenbank:</p>
<form asp-action="Index" asp-controller="Fahrzeug" method="get" class="mb-3">
<div class="input-group">
<input type="text" name="searchTerm" class="form-control" placeholder="Fahrzeug suchen..." />
<button class="btn btn-primary" type="submit">Suchen</button>
</div>
</form>
<table class="table table-hover mb-0">
<thead>
<tr>
<td>ID</td>
<td>Name</td>
<td>Type</td>
</tr>
</thead>
<tbody>
@foreach (var fahrzeug in Model.Fahrzeuge)
{
<tr>
<td>@fahrzeug.Id</td>
<td>@fahrzeug.Name</td>
<td>@fahrzeug.GetType()</td>
<td>
<a asp-action=Aktualisieren asp-controller="Fahrzeug" asp-route-id=@fahrzeug.Id>Aktualisieren</a>
</td>
<td>
<a asp-action=Loesche asp-controller="Fahrzeug" asp-route-id=@fahrzeug.Id>Löschen</a>
</td>
</tr>
}
</tbody>
</table>
<br/>
<p>
@Html.ActionLink("Neues Fahrzeug anlegen", "Einfuegen", "Fahrzeug")
</p>