From 6a4cdc4c73c60ea7d4f55997ef973ceb9de64106 Mon Sep 17 00:00:00 2001 From: michele Date: Wed, 17 Jul 2024 16:30:28 +0200 Subject: [PATCH] Michele:: modifiche per paginazione destinazioni --- Controllers/DestinazioniController.cs | 16 +- Views/Destinazioni/Index.cshtml | 229 +++++++++++++------------- 2 files changed, 127 insertions(+), 118 deletions(-) diff --git a/Controllers/DestinazioniController.cs b/Controllers/DestinazioniController.cs index 7afccd6..246335a 100644 --- a/Controllers/DestinazioniController.cs +++ b/Controllers/DestinazioniController.cs @@ -42,6 +42,7 @@ namespace SoftwayWeb.Controllers string autista = string.Empty; string dataGi = string.Empty; string mezzo = string.Empty; + string dataGiro2 = string.Empty; ViewBag.CodAutista = codAutista; ViewBag.Autista = nomeAutista; @@ -52,31 +53,42 @@ namespace SoftwayWeb.Controllers if (!string.IsNullOrEmpty(codAutista)) { helper.SetStringValue("codAutista", codAutista.TrimEnd()); + helper.SetStringValue("nomeAutista", nomeAutista.TrimEnd()); } else { - string aut = helper.GetStringValue("codAutista"); - codAutista = aut.TrimEnd(); + string codAut = helper.GetStringValue("codAutista"); + codAutista = codAut.TrimEnd(); + ViewBag.CodAutista = codAutista; + string nomeAut = helper.GetStringValue("nomeAutista"); + ViewBag.Autista = nomeAut; } if (!string.IsNullOrEmpty(codMezzo)) { helper.SetStringValue("codMezzo", codMezzo.TrimEnd()); + helper.SetStringValue("desMezzo", desMezzo.TrimEnd()); } else { string mez = helper.GetStringValue("codMezzo").TrimEnd(); codMezzo = mez; + ViewBag.CodMezzo = codMezzo; + string nomeMezzo = helper.GetStringValue("desMezzo"); + ViewBag.Automezzo = nomeMezzo; } if (dataGiro.Date != DateTime.MinValue) { helper.SetStringValue("dataGiro", dataGiro.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'")); dataGi = dataGiro.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); + helper.SetStringValue("dataGiro2", dataGiro.ToString("dd/MM/yyyy")); } else { dataGi = helper.GetStringValue("dataGiro"); + string dataG = helper.GetStringValue("dataGiro2"); + ViewBag.dataGiro = dataG; } urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzo"; diff --git a/Views/Destinazioni/Index.cshtml b/Views/Destinazioni/Index.cshtml index 7d0878d..5f88a35 100644 --- a/Views/Destinazioni/Index.cshtml +++ b/Views/Destinazioni/Index.cshtml @@ -48,134 +48,131 @@ @foreach (var item in Model) { - - @if (item.ConsFatta != null) - { - - @Html.HiddenFor(modelItem => item.ConsFatta.consFattaFlagCons) + + @if (item.ConsFatta != null) + { + + @Html.HiddenFor(modelItem => item.ConsFatta.consFattaFlagCons) - @if (item.ConsFatta.consFattaFlagCons.Contains("S")) - { - cons - } - else - { - nocons - } - + @if (item.ConsFatta.consFattaFlagCons.Contains("S")) + { + cons } else { - - notyet - + nocons } - - @Html.DisplayFor(modelItem => item.Seq) - + + } + else + { - @Html.DisplayFor(modelItem => item.CodCommittente) - @Html.DisplayFor(modelItem => item.Committente) + notyet + + } + + @Html.DisplayFor(modelItem => item.Seq) + + + @Html.DisplayFor(modelItem => item.CodCommittente) - @Html.DisplayFor(modelItem => item.Committente) + + + @Html.DisplayFor(modelItem => item.CodSede) - @Html.DisplayFor(modelItem => item.Sede) + + + @Html.DisplayFor(modelItem => item.IndirizzoSede) + + @if (item.Casse != null && item.Casse>0) + { + + @Html.DisplayFor(modelItem => item.Casse) + + } + else + { +   + } + @if (item.Trasf != null && item.Trasf > 0) + { + + @Html.DisplayFor(modelItem => item.Trasf) + + } + else + { +   + } + @if (item.Colli != null && item.Colli > 0) + { + + @Html.DisplayFor(modelItem => item.Colli) + + } + else + { +   + } + @if (item.num_cons != null && item.num_cons > 0) + { + + @Html.DisplayFor(modelItem => item.num_cons) + + } + else + { +   + } + @if (item.Uova != null && item.Uova > 0) + { + + @Html.DisplayFor(modelItem => item.Uova) + + } + else + { +   + } + @if (item.Cist != null && item.Cist > 0) + { + + @Html.DisplayFor(modelItem => item.Cist) + + } + else + { +   + } + + + @Html.DisplayFor(modelItem => item.Note) + + + @if (item.ConsFatta == null) + { + + @if (!string.IsNullOrEmpty(item.Prog)) + { + nocons + } + + nocons - @Html.DisplayFor(modelItem => item.CodSede) - @Html.DisplayFor(modelItem => item.Sede) + nocons - - @Html.DisplayFor(modelItem => item.IndirizzoSede) - - @if (item.Casse != null && item.Casse>0) - { - - @Html.DisplayFor(modelItem => item.Casse) - - } - else - { -   - } - @if (item.Trasf != null && item.Trasf > 0) - { - - @Html.DisplayFor(modelItem => item.Trasf) - - } - else - { -   - } - @if (item.Colli != null && item.Colli > 0) - { - - @Html.DisplayFor(modelItem => item.Colli) - - } - else - { -   - } - @if (item.num_cons != null && item.num_cons > 0) - { - - @Html.DisplayFor(modelItem => item.num_cons) - - } - else - { -   - } - @if (item.Uova != null && item.Uova > 0) - { - - @Html.DisplayFor(modelItem => item.Uova) - - } - else - { -   - } - @if (item.Cist != null && item.Cist > 0) - { - - @Html.DisplayFor(modelItem => item.Cist) - - } - else - { -   - } - - - @Html.DisplayFor(modelItem => item.Note) - - - @if (item.ConsFatta == null) - { - - @if (!string.IsNullOrEmpty(item.Prog)) - { - nocons - } - - nocons - - - nocons - - } - else - { -   -   - } - - - - - } - + } + else + { +   +   + } + +} +