MICHELE: risolto problema data timezone + paginazione che da errore
This commit is contained in:
parent
571609cd68
commit
fdc8579ff4
@ -24,14 +24,35 @@ namespace SoftwayWeb.Controllers
|
||||
apiUrl = key;
|
||||
}
|
||||
|
||||
public IActionResult Index(string id, string? codAutista, DateTime dataGiro, /*Destinazioni_Out giro,*/ string? codMezzo, int? page = 1)
|
||||
public IActionResult Index(string id, string? codAutista, DateTime dataGiro, string? codMezzo, int? page = 1)
|
||||
{
|
||||
helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
|
||||
ViewBag.CodAutista = codAutista;
|
||||
//if (codAutista == null)
|
||||
//{
|
||||
// //ViewBag.CodAutista = "codAutista";
|
||||
// codAutista = ViewBag.CodAutista;
|
||||
//}
|
||||
|
||||
|
||||
//if (!string.IsNullOrEmpty(codAutista))
|
||||
//{
|
||||
// //modelList = modelList.Where(x => x.CodAutista.Contains(codAutista)).ToList();
|
||||
|
||||
// ViewData["CurrentFilter"] = codAutista;
|
||||
|
||||
// ViewBag.Autista = codAutista;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ViewData = ViewBag.CodAutista;
|
||||
//}
|
||||
|
||||
urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzo";
|
||||
//dataGiro = dataGiro.ToUniversalTime();
|
||||
//urlBase = urlBase + "autista=" + giro.CodAutista + "datGiro=" /*+ giro.DataGiro*/;
|
||||
urlBase = urlBase + "?autista=" + codAutista.TrimEnd() + "&dataGiro=2023-05-30T00%3A00%3A00.000Z" + "&mezzo=" + codMezzo /*+ dataGiro*/;
|
||||
string dataGi = dataGiro.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'");
|
||||
urlBase = urlBase + "?autista=" + codAutista.TrimEnd() + "&dataGiro=" + dataGi + "&mezzo=" + codMezzo;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
@ -43,20 +64,13 @@ namespace SoftwayWeb.Controllers
|
||||
{
|
||||
string dato = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Destinazioni_Out>>(dato);
|
||||
modelList = modelList.Where(x => x.serialeGiro == id && x.CodAutista.Contains(codAutista.TrimEnd())).ToList();
|
||||
modelList = modelList.Where(x => x.serialeGiro == id).ToList();
|
||||
|
||||
if (!string.IsNullOrEmpty(codAutista))
|
||||
{
|
||||
//modelList = modelList.Where(x => x.CodAutista.Contains(codAutista)).ToList();
|
||||
//ViewData["codAutista"] = codAutista;
|
||||
//ViewBag.CodAutista = "codAutista";
|
||||
//ViewBag.DataGiro = dataGiro;
|
||||
//ViewBag.CodMezzo = codMezzo;
|
||||
|
||||
ViewData["CurrentFilter"] = codAutista;
|
||||
|
||||
ViewBag.Autista = codAutista;
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewData["CurrentFilter"] = null;
|
||||
}
|
||||
|
||||
if (page != null && page < 1)
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
@using X.PagedList;
|
||||
@using X.PagedList.Mvc.Core;
|
||||
@using X.PagedList;
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Lista Destinazioni";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRis.cshtml";
|
||||
@ -11,6 +12,11 @@
|
||||
|
||||
<h1>Lista destinazioni</h1>
|
||||
|
||||
|
||||
<h2>@ViewBag.CodAutista</h2>
|
||||
|
||||
|
||||
|
||||
@* <p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
@ -144,11 +150,11 @@
|
||||
|
||||
@if (item.ConsFatta.consFattaFlagCons.Contains("S"))
|
||||
{
|
||||
<img alt="cons" src="@Url.Content("~/images/Green.png")" style="width:50px;height:50px;">
|
||||
<img alt="cons" src="@Url.Content("~/images/Green.png")" style="width:35px;height:35px">
|
||||
}
|
||||
else
|
||||
{
|
||||
<img alt="nocons" src="@Url.Content("~/images/Red.png")" style="width:50px;height:50px;">
|
||||
<img alt="nocons" src="@Url.Content("~/images/Red.png")" style="width:35px;height:35px;">
|
||||
}
|
||||
</td>
|
||||
}
|
||||
@ -164,7 +170,7 @@
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<img alt="notyet" src="@Url.Content("~/images/Yellow.png")" style="width:50px;height:50px;">
|
||||
<img alt="notyet" src="@Url.Content("~/images/Yellow.png")" style="width:35px;height:35px;">
|
||||
</td>
|
||||
}
|
||||
|
||||
@ -202,6 +208,7 @@
|
||||
<td hidden>
|
||||
@Html.HiddenFor(modelItem => item.ItemList)
|
||||
</td>
|
||||
|
||||
@* @if (item.ConsFatta != null){
|
||||
<td>
|
||||
<img alt="cons" src="@Url.Content("~/images/fatto1.png")" style="width:35px;height:35px;">
|
||||
|
||||
@ -87,11 +87,11 @@
|
||||
@Html.DisplayFor(modelItem => item.parzialeImpRec)
|
||||
</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"><img alt="nocons" src="@Url.Content("~/images/icons8-oggetti-puntiforme-30.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Bancali", "GiriChiudi", new { id=item.SerialeGiro })" title="Bancali" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bancale-24.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Chiudi", "GiriChiudi", new { id=item.SerialeGiro })" title="Chiudi" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bandiera-a-scacchi-64.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Riapri", "GiriChiudi", new { id=item.SerialeGiro })" title="Riapri" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-riduzione-32.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Elimina", "GiriElimina", new { id=item.SerialeGiro })" title="Elimina" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-rimuovere-24.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Index", "Destinazioni", new { id=item.SerialeGiro, codAutista=item.CodAutista, dataGiro=item.DataGiro, codMezzo=item.CodMezzo })" title="Destinazioni" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-oggetti-puntiforme-30.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Bancali", "GiriChiudi", new { id=item.SerialeGiro })" title="Bancali" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bancale-24.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Chiudi", "GiriChiudi", new { id=item.SerialeGiro })" title="Chiudi" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bandiera-a-scacchi-64.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Riapri", "GiriChiudi", new { id=item.SerialeGiro })" title="Riapri" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-riduzione-32.png")" style="width:24px;height:24px;"></a>
|
||||
<a href="@Url.ActionLink("Elimina", "GiriElimina", new { id=item.SerialeGiro })" title="Elimina" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-rimuovere-24.png")" style="width:24px;height:24px;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user