VirtualTask/Views/Impianti/Index.cshtml
2023-11-06 10:02:17 +01:00

155 lines
5.8 KiB
Plaintext

@model IPagedList<VirtualTask.Models.Impianto>
@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Web.Common;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
@{
ViewData["Title"] = "Impianti";
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
}
<div class="agy-project-wrapper agy-project-page-wrapper">
<div class="container">
<p>
<a asp-action="Create" class="info-data"><img src="~/assets/images/icons8-nuovo-50.png" alt="Crea un nuovo elemento" /></a>
</p>
@using (Html.BeginForm())
{
<div>
<div style="float:left;width:40%;padding:0 20px;">@Html.TextBox("SearchString", null, new { placeholder = "Cerca per Indirizzo", @class = "agy-form-field require" })</div>
<div style="float:left;width:2%;">&nbsp;</div>
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></div>
</div>
}
<table class="table">
<thead>
<tr>
<th>Cod. Impianto</th>
<th hidden>Azienda</th>
<th>Descrizione</th>
<th>Indirizzo</th>
<th>Cod. Cliente</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.imcodimp)
</td>
<td>
@Html.DisplayFor(modelItem => item.imdescri)
</td>
<td>
@Html.DisplayFor(modelItem => item.indirizzo)
</td>
<td>
@Html.DisplayFor(modelItem => item.imultcli) - @Html.DisplayFor(modelItem => item.descCliente)
</td>
<td>
<a href="@Url.Action("Edit", "Impianti", new { id=item.imcodimp })" title="Modifica" class="links">
<img alt="Modifica" src="@Url.Content("~/assets/images/icons8-modificare-64.png")" style="width:30px;height:30px;">
</a>
|
<a href="@Url.Action("Details", "Impianti", new { id=item.imcodimp })" title="Dettaglio" class="links">
<img alt="Dettaglio" src="@Url.Content("~/assets/images/icons8-visualizza-file-64.png")" style="width:30px;height:30px;">
</a>
|
<a href="@Url.Action("Delete", "Impianti", new { id=item.imcodimp })" title="Elimina" class="links">
<img alt="Elimina" src="@Url.Content("~/assets/images/icons8-elimina-50.png")" style="width:30px;height:30px;">
</a>
</td>
</tr>
}
</tbody>
</table>
<br />
<nav>
@Html.PagedListPager(Model, page => Url.Action("index", new { page = page, searchString=@ViewData["CurrentFilter"] }), new PagedListRenderOptions()
{
ActiveLiElementClass = "active",
PageClasses = new[]{ "page-link"},
LiElementClasses=new[] { "page-item" },
UlElementClasses = new[] { "pagination","justify-content-center", "mt-3" },
LinkToNextPageFormat = "Successiva",
LinkToPreviousPageFormat = "Precedente",
MaximumPageNumbersToDisplay = 5,
DisplayLinkToPreviousPage = PagedListDisplayMode.Always,
DisplayLinkToNextPage = PagedListDisplayMode.Always
})
</nav>
</div>
</div>
@*
<h1>Impianti</h1>
<p>
<a asp-action="Create">Crea nuovo impianto</a>
</p>
@using (Html.BeginForm())
{
<p>
Cerca per indirizzo: @Html.TextBox("SearchString")
<input type="submit" value="Cerca" />
</p>
}
<table class="table">
<thead>
<tr>
<th>Cod. Impianto</th>
<th hidden>Azienda</th>
<th>Descrizione</th>
<th>Indirizzo</th>
<th>Cod. Cliente</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>@Html.DisplayFor(modelItem => item.imcodimp)</td>
<td hidden>@Html.DisplayFor(modelItem => item.imcodazi)</td>
@Html.HiddenFor(modelItem => item.imcodazi)
<td>@Html.DisplayFor(modelItem => item.imdescri)</td>
<td>@Html.DisplayFor(modelItem => item.indirizzo)</td>
<td>@Html.DisplayFor(modelItem => item.imultcli) - @Html.DisplayFor(modelItem => item.descCliente)</td>
<td>
@Html.ActionLink("Modifica", "Edit", new { id=item.imcodimp }) |
@Html.ActionLink("Dettaglio", "Details", new { id=item.imcodimp }) |
@Html.ActionLink("Elimina", "Delete", new { id=item.imcodimp })
</td>
</tr>
}
</tbody>
</table>
<br />
<nav>
@Html.PagedListPager(Model, page => Url.Action("index", new { page = page, searchString=@ViewData["CurrentFilter"] }), new PagedListRenderOptions()
{
ActiveLiElementClass = "active",
PageClasses = new[]{ "page-link"},
LiElementClasses=new[] { "page-item" },
UlElementClasses = new[] { "pagination","justify-content-center", "mt-3" },
LinkToNextPageFormat = "Successiva",
LinkToPreviousPageFormat = "Precedente",
MaximumPageNumbersToDisplay = 5,
DisplayLinkToPreviousPage = PagedListDisplayMode.Always,
DisplayLinkToNextPage = PagedListDisplayMode.Always
})
</nav>
*@