VirtualTask/Views/Impianti/Index.cshtml

178 lines
7.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">
<div class="row">
<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("Index", "Impianti"))
{
<div class="card">
<h5 class="card-header">Ricerca</h5>
<div class="table-responsive text-nowrap">
<table class="table">
<tbody class="table-border-bottom-0">
<tr>
<td>
<i class="bx bxl-angular bx-sm text-black me-3">Indirizzo:</i>
<span class="fw-medium">@Html.TextBox("searchString", null, new { placeholder = "Cerca per indirizzo impianto", @class = "agy-form-field require" })</span>
</td>
<td>
<i class="bx bxl-angular bx-sm text-black me-3">Cliente:</i>
<span class="fw-medium">@Html.DropDownList("cliente", ViewBag.Clienti, null, new { @class = "agy-form-field require" })</span>
</td>
<td>
<i class="bx bxl-angular bx-sm text-black me-3">&nbsp;</i>
<span class="fw-medium"><input type="submit" value="Cerca" class="agy-btn submitForm" /></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
}
<div style="width:100%;height:30px;">
&nbsp;
</div>
<div class="card">
<h5 class="card-header">IMPIANTI</h5>
<div class="table-responsive text-nowrap">
<table class="table table-striped">
<thead>
<tr>
<th style="width:20%;">Impianto</th>
<th style="width:35%;">Indirizzo</th>
<th style="width:30%;">Cliente</th>
<th style="width:15%;">&nbsp;</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.imcodimp) - @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>
</div>
</div>
<br />
<nav>
@Html.PagedListPager(Model, page => Url.Action("index", new { page = page, searchString = @ViewData["CurrentFilter"], cliente = ViewData["CurrentFilterCli"]}), 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>
</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>
*@