Thoscellen b8eb688ac8 init
2020-05-16 16:42:11 +02:00

58 lines
1.8 KiB
Plaintext

@model IEnumerable<FrozenFishWeb.Models.Produit>
@{
ViewBag.Title = "Liste des produits | FrozenFish";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<table class="table table-striped table-hover" id="ListDeProduits">
<tr>
<th>#</th>
<th>Marque & Nom</th>
<th></th>
<th>Date d'achat</th>
<th>Durée</th>
<th>Fin de garantie</th>
</tr>
@{int i = 1; }
@foreach (var item in Model) {
<tr>
<td>
@(i++)
</td>
<td class="@if (!item.SousGarantie) { <text>LineThrough</text> }">
<a href="@Url.Action("Details", "Produit", new { id = item.Id })">
<span class="text-info">@item.Marque</span>
<span class="text-primary">@item.Nom</span>
</a>
</td>
<td>
<span class="ShowOnHover">
@Html.ActionLink(" ", "Edit", new { /* id=item.PrimaryKey */ }, new { @class = "glyphicon glyphicon-pencil", title = "Modifier" })
@Html.ActionLink(" ", "Delete", null, new { @class = "glyphicon glyphicon-trash", title = "Supprimer" })
</span>
</td>
<td> @item.DateAchat.ToString("dd/MM/yyyy") </td>
<td>
@if (item.DureeGarantie <= 1) {
@item.DureeGarantie @: an
} else {
@item.DureeGarantie <text> ans</text>
}
</td>
<td>
@if (item.SousGarantie) {
<span class="text-success">
<span class="glyphicon glyphicon-ok"></span>
@item.DateAchat.AddYears(item.DureeGarantie).ToString("dd/MM/yyyy")
</span>
} else {
<span class="text-danger">
<span class="glyphicon glyphicon-remove text-danger"></span>
@item.DateAchat.AddYears(item.DureeGarantie).ToString("dd/MM/yyyy")
</span>
}
</td>
</tr>
}
</table>