From 0b016b01a0faf7ed55558537facbe8d8747c8973 Mon Sep 17 00:00:00 2001 From: michele Date: Thu, 19 Oct 2023 15:32:02 +0200 Subject: [PATCH] valori vuoti su dropdown --- Controllers/ChiamateController.cs | 17 +++++++++---- Controllers/ImpiantiController.cs | 16 ++++++++++--- Controllers/Rapp_NewController.cs | 17 ++++++++++--- Views/Rapp_New/Details.cshtml | 40 +++++++++++++++---------------- Views/Tecnici/Index.cshtml | 19 +++++++-------- 5 files changed, 69 insertions(+), 40 deletions(-) diff --git a/Controllers/ChiamateController.cs b/Controllers/ChiamateController.cs index 424b84e..1335f14 100644 --- a/Controllers/ChiamateController.cs +++ b/Controllers/ChiamateController.cs @@ -452,10 +452,19 @@ namespace VirtualTask.Controllers foreach (var role in modelList) { SelectListItem listItem = new SelectListItem(); - string s = role.tccodice + " - " + role.tcdescri; - listItem.Value = role.tccodice; - listItem.Text = s; - selectItems.Add(listItem); + if (role == modelList.First()) + { + listItem.Value = string.Empty; + listItem.Text = ""; + selectItems.Add(listItem); + } + else + { + string s = role.tccodice + " - " + role.tcdescri; + listItem.Value = role.tccodice; + listItem.Text = s; + selectItems.Add(listItem); + } } } return selectItems; diff --git a/Controllers/ImpiantiController.cs b/Controllers/ImpiantiController.cs index bf919fc..75166c8 100644 --- a/Controllers/ImpiantiController.cs +++ b/Controllers/ImpiantiController.cs @@ -323,9 +323,19 @@ namespace VirtualTask.Controllers foreach (var role in modelList) { SelectListItem listItem = new SelectListItem(); - listItem.Value = role.ancodice; - listItem.Text = role.andescri; - selectItems.Add(listItem); + + if (role == modelList.First()) + { + listItem.Value = string.Empty; + listItem.Text = ""; + selectItems.Add(listItem); + } + else + { + listItem.Value = role.ancodice; + listItem.Text = role.andescri; + selectItems.Add(listItem); + } } } return selectItems; diff --git a/Controllers/Rapp_NewController.cs b/Controllers/Rapp_NewController.cs index 6a94f9d..a2a1bc6 100644 --- a/Controllers/Rapp_NewController.cs +++ b/Controllers/Rapp_NewController.cs @@ -193,6 +193,7 @@ namespace VirtualTask.Controllers return RedirectToAction("Error"); } + ViewBag.Chisure = GetCodChiusura(); return View(rapp); } @@ -357,9 +358,19 @@ namespace VirtualTask.Controllers foreach (var role in modelList) { SelectListItem listItem = new SelectListItem(); - listItem.Value = role.cccodice; - listItem.Text = role.ccdescr; - selectItems.Add(listItem); + + if (role == modelList.First()) + { + listItem.Value = string.Empty; + listItem.Text = ""; + selectItems.Add(listItem); + } + else + { + listItem.Value = role.cccodice; + listItem.Text = role.ccdescr; + selectItems.Add(listItem); + } } } diff --git a/Views/Rapp_New/Details.cshtml b/Views/Rapp_New/Details.cshtml index 4ec2535..e740214 100644 --- a/Views/Rapp_New/Details.cshtml +++ b/Views/Rapp_New/Details.cshtml @@ -316,64 +316,64 @@
@Html.DisplayFor(model => model.tipo_intervento)
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/Views/Tecnici/Index.cshtml b/Views/Tecnici/Index.cshtml index 4a0d7e6..85010d7 100644 --- a/Views/Tecnici/Index.cshtml +++ b/Views/Tecnici/Index.cshtml @@ -116,15 +116,14 @@