Sie sind auf Seite 1von 2

@model IEnumerable<CardManagement.Controllers.

Cards>

@{
ViewData["Title"] = "CardList";
}

<h2>CardList</h2>

<p>
<a asp-action="Create">Create New</a>
</p>

<div class="row">
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Card Number</th>
<th>Issued Date</th>
<th>Expiry Date</th>
<th>Action</th>

</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@item.Id</td>
<td>@item.CardNumber</td>
<td>@item.IssueDate.ToString("yyyy-MM-dd")</td>
<td>@item.ExpiryDate.ToString("yyyy-MM-dd")</td>
<td>
<i class="fa fa-edit"><a href="#">Edit</a></i>
<i class="fa fa-clipboard"><a href="#">Details</a></i>
<i class="fa fa-trash"><a href="#">Delete</a></i>
</td>

</tr>
}
</tbody>
</table>
</div>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.CardNumber)
</th>
<th>
@Html.DisplayNameFor(model => model.IssueDate)
</th>
<th>
@Html.DisplayNameFor(model => model.ExpiryDate)
</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.CardNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.IssueDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExpiryDate)
</td>
<td>
<a href="@Url.Action("Edit", "HomeController")" class="btn btn-
warning">
Edit
<i class="fa fa-edit" aria-hidden="true"></i>
</a>
<a href="@Url.Action("Details", "HomeController")" class="btn
btn-warning">
Details
<i class="fa fa-clipboard" aria-hidden="true"></i>
</a>
<a href="@Url.Action("Details", "HomeController")" class="btn btn-
warning">
Delete
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
@Html.ActionLink("Edit", "Index", "Home", null, new { @class="fa
fa-clipboard" })
@*@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey
*/ }) |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey
*/ }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */
})*@
</td>
</tr>
}
</tbody>
</table>

Das könnte Ihnen auch gefallen