Michele: icone consegne fatte

This commit is contained in:
michele 2024-07-09 10:39:08 +02:00
parent 9bd0f76740
commit d2d5c751c2
3 changed files with 70 additions and 57 deletions

View File

@ -31,7 +31,7 @@ namespace SoftwayWeb.Controllers
urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzo"; urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzo";
//dataGiro = dataGiro.ToUniversalTime(); //dataGiro = dataGiro.ToUniversalTime();
//urlBase = urlBase + "autista=" + giro.CodAutista + "datGiro=" /*+ giro.DataGiro*/; //urlBase = urlBase + "autista=" + giro.CodAutista + "datGiro=" /*+ giro.DataGiro*/;
urlBase = urlBase + "?autista=" + codAutista.Trim() + "&dataGiro=2023-05-30T00%3A00%3A00.000Z" + "&mezzo=" + codMezzo /*+ dataGiro*/; urlBase = urlBase + "?autista=" + codAutista.TrimEnd() + "&dataGiro=2023-05-30T00%3A00%3A00.000Z" + "&mezzo=" + codMezzo /*+ dataGiro*/;
Uri baseAddress = new Uri(urlBase); Uri baseAddress = new Uri(urlBase);
client = new HttpClient(); client = new HttpClient();
client.BaseAddress = baseAddress; client.BaseAddress = baseAddress;
@ -43,15 +43,28 @@ namespace SoftwayWeb.Controllers
{ {
string dato = response.Content.ReadAsStringAsync().Result; string dato = response.Content.ReadAsStringAsync().Result;
modelList = JsonConvert.DeserializeObject<List<Destinazioni_Out>>(dato); modelList = JsonConvert.DeserializeObject<List<Destinazioni_Out>>(dato);
modelList = modelList.Where(x => x.serialeGiro == id).ToList(); modelList = modelList.Where(x => x.serialeGiro == id && x.CodAutista.Contains(codAutista.TrimEnd())).ToList();
//if (page != null && page < 1) if (!string.IsNullOrEmpty(codAutista))
//{ {
// page = 1; //modelList = modelList.Where(x => x.CodAutista.Contains(codAutista)).ToList();
//}
//var pageSize = 10;
var shortList = modelList.ToPagedList(/*page ?? 1, pageSize*/); ViewData["CurrentFilter"] = codAutista;
ViewBag.Autista = codAutista;
}
else
{
ViewData["CurrentFilter"] = null;
}
if (page != null && page < 1)
{
page = 1;
}
var pageSize = 10;
var shortList = modelList.ToPagedList(page ?? 1, pageSize);
return View(/*modelList*/shortList); return View(/*modelList*/shortList);
} }
else else

View File

@ -55,7 +55,7 @@ namespace SoftwayWeb.Controllers
ViewData["CurrentFilter"] = codAutista; ViewData["CurrentFilter"] = codAutista;
//ViewBag.Autista = codAutista; ViewBag.Autista = codAutista;
} }
else else
{ {
@ -72,7 +72,7 @@ namespace SoftwayWeb.Controllers
page = 1; page = 1;
} }
var pageSize = 1/*10*/; var pageSize = 10;
var shortList = modelList.ToPagedList(page ?? 1, pageSize); var shortList = modelList.ToPagedList(page ?? 1, pageSize);
return View(shortList/*modelList*/); return View(shortList/*modelList*/);

View File

@ -27,7 +27,7 @@
<th>Bancali caricati</th> <th>Bancali caricati</th>
<th>Bancali scaricati</th> <th>Bancali scaricati</th>
<th hidden>Automezzo</th> <th hidden>Automezzo</th>
<th @* hidden *@>Autista</th> <th hidden>Autista</th>
<th>Importo recuperato</th> <th>Importo recuperato</th>
<th>Note (importo)@* Importo non recuperato *@</th> <th>Note (importo)@* Importo non recuperato *@</th>
<th>Note (bancali)@* Bancali non recuperati *@</th> <th>Note (bancali)@* Bancali non recuperati *@</th>
@ -154,12 +154,12 @@
} }
else else
{ {
<td hidden>&nbsp;</td>
<td hidden>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td hidden>&nbsp;</td>
<td>&nbsp;</td> <td hidden>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@ -179,7 +179,7 @@
@Html.HiddenFor(modelItem => item.DataCarico) @Html.HiddenFor(modelItem => item.DataCarico)
</td> </td>
<td hidden> <td hidden>
@Html.DisplayFor(modelItem => item.CodAutista) @* - *@ @Html.DisplayFor(modelItem => item.Autista) @Html.HiddenFor(modelItem => item.CodAutista) @* - *@ @Html.HiddenFor(modelItem => item.Autista)
</td> </td>
<td> <td>
@Html.HiddenFor(modelItem => item.Brmerce) @Html.HiddenFor(modelItem => item.Brmerce)
@ -223,8 +223,8 @@
</tbody> </tbody>
</table> </table>
<br /> <br />
@* <nav> <nav>
@Html.PagedListPager(Model, page => Url.Action("index", new { page = page, Model/* , searchString = @ViewData["CurrentFilter"] */ }), new PagedListRenderOptions() @Html.PagedListPager(Model, page => Url.Action("index", new { page = page, searchString = @ViewData["CurrentFilter"] }), new PagedListRenderOptions()
{ {
ActiveLiElementClass = "active", ActiveLiElementClass = "active",
PageClasses = new[] { "page-link" }, PageClasses = new[] { "page-link" },
@ -236,4 +236,4 @@
DisplayLinkToPreviousPage = PagedListDisplayMode.Always, DisplayLinkToPreviousPage = PagedListDisplayMode.Always,
DisplayLinkToNextPage = PagedListDisplayMode.Always DisplayLinkToNextPage = PagedListDisplayMode.Always
}) })
</nav> *@ </nav>