SoftwayWeb/Views/Giri/Index.cshtml

144 lines
5.2 KiB
Plaintext

@* @model IEnumerable<SoftwayWeb.Models.GiriConsegnaView> *@
@model IPagedList<SoftwayWeb.Models.GiriConsegnaView>
@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList;
@* @using X.PagedList.Web.Common; *@
@{
ViewData["Title"] = "Giri di consegna";
Layout = "~/Views/Shared/_LayoutAreaRis.cshtml";
}
@*
@{
ViewData["Title"] = "Index";
}
<h1>Giri di consegna</h1> *@
<h1>Giri di consegna</h1>
<p>
<a asp-action="Create">Aggiungi nuovo giro di consegna</a>
</p>
@using (Html.BeginForm())
{
@* <div>@Html.TextBox("codAutista", null, new { placeholder = "Codice autista", @class = "agy-form-field require" })</div> *@
<div>@Html.DropDownList("codAutista", ViewBag.Autisti, null, new { @class = "agy-form-field require" })</div>
<br />
<div>@Html.TextBox("data", null, new { type = "date", @class = "agy-form-field require" })</div>
<br />
<div>
@Html.CheckBox("aperto", new { placeholder ="aperto", @checked = true, })
@Html.Label("aperto", "aperto")
</div>
<br />
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></div>
}
<table class="table">
<thead>
<tr>
@* <th>Seriale giro</th> *@
<th>Data</th>
@*<th>Cod. Autista</th>*@
<th>Autista</th>
<th>Automezzo</th>
<th>Bancali caricati</th>
<th>Bancali recuperati</th>
<th>Importo da recuperare</th>
<th>Importo recuperato</th>
@* <th>Data chiusura</th> *@
@* <th hidden>
@Html.DisplayNameFor(model => model.SerialeGiro)
</th>
<th>
@Html.DisplayNameFor(model => model.DataGiro)
</th>
<th>
@Html.DisplayNameFor(model => model.CodAutista)
</th>
<th>
@Html.DisplayNameFor(model => model.Autista)
</th>
<th>
@Html.DisplayNameFor(model => model.BancaliCaricati)
</th>
<th>
@Html.DisplayNameFor(model => model.BancaliRecuperati)
</th>
<th>
@Html.DisplayNameFor(model => model.ImportoDaRecuperare)
</th>
<th>
@Html.DisplayNameFor(model => model.ImportoRecuperato)
</th>
<th>
@Html.DisplayNameFor(model => model.DataChiusura)
</th>
<th></th> *@
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.DataGiro)
</td>
<td>
@Html.DisplayFor(modelItem => item.CodAutista) - @Html.DisplayFor(modelItem => item.Autista)
</td>
<td>
@Html.DisplayFor(modelItem => item.CodMezzo) - @Html.DisplayFor(modelItem => item.Automezzo)
</td>
<td>
@Html.DisplayFor(modelItem => item.BancaliCaricati)
</td>
<td>
@Html.DisplayFor(modelItem => item.BancaliRecuperati)
</td>
<td>
@Html.DisplayFor(modelItem => item.ImportoDaRecuperare)
</td>
<td>
@Html.DisplayFor(modelItem => item.ImportoRecuperato)
</td>
<td hidden>
@Html.HiddenFor(modelItem => item.DataChiusura)
</td>
<td hidden>
@Html.HiddenFor(modelItem => item.SerialeGiro)
</td>
<td>
<a href="@Url.ActionLink("Index", "Destinazioni", new { id=item.SerialeGiro, codAutista=item.CodAutista, dataGiro=item.DataGiro, codMezzo=item.CodMezzo })" title="Destinazioni" class="links">Destinazioni</a>
<a href="@Url.ActionLink("Bancali", "GiriChiudi", new { id=item.SerialeGiro })" title="Bancali" class="links">Modifica bancali</a>
<a href="@Url.ActionLink("Chiudi", "GiriChiudi", new { id=item.SerialeGiro })" title="Chiudi" class="links">Chiudi</a>
<a href="@Url.ActionLink("Riapri", "GiriChiudi", new { id=item.SerialeGiro })" title="Riapri" class="links">Riapri</a>
<a href="@Url.ActionLink("Elimina", "GiriElimina", new { id=item.SerialeGiro })" title="Elimina" class="links">Elimina</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>