From f4cf876ef2bf976a983447dcf15310f3db52f9fe Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Wed, 2 Oct 2024 11:23:27 +0200 Subject: [PATCH] debug e ristrutturazione pagina aggiungi destinazione --- Controllers/DestinazioniController.cs | 17 ++- Models/Destinazioni_Out.cs | 8 + Views/AddDestinazione/AddDestinazione.cshtml | 143 ++++++++++-------- .../Destinazioni/ModificaDestinazione.cshtml | 6 +- 4 files changed, 103 insertions(+), 71 deletions(-) diff --git a/Controllers/DestinazioniController.cs b/Controllers/DestinazioniController.cs index e4872cb..00a1380 100644 --- a/Controllers/DestinazioniController.cs +++ b/Controllers/DestinazioniController.cs @@ -190,10 +190,13 @@ namespace SoftwayWeb.Controllers return RedirectToAction("Index", "Destinazioni", new { + //string id, string? codAutista, string? nomeAutista, DateTime dataGiro, string? codMezzo, string? desMezzo id = model.serialeGiro, codAutista = model.CodAutista, + nomeAutista=model.Autista, dataGiro = model.DataCarico, - codMezzo=model.CodAutomezzo + codMezzo=model.CodAutomezzo, + desMezzo = model.DescAutomezzo }); } @@ -227,6 +230,10 @@ namespace SoftwayWeb.Controllers mezzi.Find(c => c.Value.Equals(model.CodAutomezzo)).Selected = true; ViewBag.CodMezzo = mezzi; + model.CodAutistaOld = model.CodAutista; + model.CodAutomezzoOld = model.CodAutomezzo; + model.AutistaOld = model.Autista; + model.DescAutomezzoOld = model.DescAutomezzo; return View(model); } @@ -278,11 +285,11 @@ namespace SoftwayWeb.Controllers return RedirectToAction("Index", "Destinazioni", new { id = model.serialeGiro, - codAutista = model.CodAutista, - nomeAutista = model.Autista, + codAutista = model.CodAutistaOld, + nomeAutista = model.AutistaOld, dataGiro = model.DataCarico, - codMezzo = model.CodAutomezzo, - desMezzo = model.DescAutomezzo + codMezzo = model.CodAutomezzoOld, + desMezzo = model.DescAutomezzoOld }); } else diff --git a/Models/Destinazioni_Out.cs b/Models/Destinazioni_Out.cs index 2925397..6de2d47 100644 --- a/Models/Destinazioni_Out.cs +++ b/Models/Destinazioni_Out.cs @@ -57,6 +57,12 @@ namespace SoftwayWeb.Models public int? Seq { get; set; } public string? Prog { get; set; } public string? Pisergir { get; set; } + + public string? CodAutomezzoOld { get; set; } + public string? CodAutistaOld { get; set; } + public string? AutistaOld { get; set; } + public string? DescAutomezzoOld { get; set; } + public class ConsegnaFatta { [Display(Name = "Seriale consegna")] @@ -82,6 +88,8 @@ namespace SoftwayWeb.Models [Display(Name = "Ora consegna")] public DateTime? consFattaDataOra { get; set; } + + } } } diff --git a/Views/AddDestinazione/AddDestinazione.cshtml b/Views/AddDestinazione/AddDestinazione.cshtml index a236e6d..22d9e6c 100644 --- a/Views/AddDestinazione/AddDestinazione.cshtml +++ b/Views/AddDestinazione/AddDestinazione.cshtml @@ -25,85 +25,98 @@ {
-
-
+
+ + +
@Html.DropDownListFor(x => x.Picommit, (IEnumerable)ViewBag.Commit, new { @id = "ddlCommittenti", @class = "agy-form-field require" })
-
+
@Html.DropDownListFor(x => x.Pidesdiv, new List(), "- Seleziona sede", new { @id = "ddlSediCons", @class = "agy-form-field require" })
-
- - - -
-
- -
- @Html.DropDownList("autista",ViewBag.CodAutista, null, new { @class = "agy-form-field require" }) -
- -
-
- -
- @Html.DropDownList("mezzo",ViewBag.Mezzi, null, new { @class = "agy-form-field require" }) -
- -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
+
+
- - @Html.HiddenFor(x => x.Piprogre) - @Html.HiddenFor(x => x.Piserial) - @Html.HiddenFor(x => x.Pitiprec) - @Html.HiddenFor(x => x.Pisergir) - - - Torna alla lista + @Html.DropDownList("autista",ViewBag.CodAutista, null, new { @class = "agy-form-field require" })
+ +
+
 
+
+ +
+ @Html.DropDownList("mezzo",ViewBag.Mezzi, null, new { @class = "agy-form-field require" }) +
+ +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ +
+
 
+ + @Html.HiddenFor(x => x.Piprogre) + @Html.HiddenFor(x => x.Piserial) + @Html.HiddenFor(x => x.Pitiprec) + @Html.HiddenFor(x => x.Pisergir)
} diff --git a/Views/Destinazioni/ModificaDestinazione.cshtml b/Views/Destinazioni/ModificaDestinazione.cshtml index c795789..05a7005 100644 --- a/Views/Destinazioni/ModificaDestinazione.cshtml +++ b/Views/Destinazioni/ModificaDestinazione.cshtml @@ -68,7 +68,11 @@ @Html.HiddenFor(model => model.Note) @Html.HiddenFor(model => model.Seq) @Html.HiddenFor(model => model.Prog) - + + @Html.HiddenFor(model => model.CodAutistaOld) + @Html.HiddenFor(model => model.CodAutomezzoOld) + @Html.HiddenFor(model => model.AutistaOld) + @Html.HiddenFor(model => model.DescAutomezzoOld)