diff --git a/Controllers/RapportiniController.cs b/Controllers/RapportiniController.cs index be9ff1e..466aa4a 100644 --- a/Controllers/RapportiniController.cs +++ b/Controllers/RapportiniController.cs @@ -36,7 +36,7 @@ namespace VirtualTask.Controllers #region INDEX - public IActionResult Index(string Impianto, int? page = 1) + public IActionResult Index(string impianto, int? page = 1) { SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); @@ -64,13 +64,13 @@ namespace VirtualTask.Controllers ViewBag.Rapportini = getImpianti(); - if (!string.IsNullOrEmpty(Impianto)) + if (!string.IsNullOrEmpty(impianto)) { - modelList = modelList.Where(s => s.codice_impianto.Contains(Impianto)).ToList(); + modelList = modelList.Where(s => s.codice_impianto.Contains(impianto)).ToList(); - ViewData["CurrentFilter"] = Impianto; + ViewData["CurrentFilter"] = impianto; - ViewBag.Impianto = Impianto; + ViewBag.Impianto = impianto; } else ViewData["CurrentFilter"] = null; @@ -100,8 +100,7 @@ namespace VirtualTask.Controllers #region metodi interni - [HttpPost] - public IActionResult ExportDataToExcel(DateTime dataIni, DateTime dataFin, string Impianto) + public IActionResult ExportDataToExcel(DateTime dataIni, DateTime dataFin, string? impianto) { SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); @@ -121,8 +120,6 @@ namespace VirtualTask.Controllers List modelList = new List(); - //modelList = lista; - HttpResponseMessage response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) @@ -131,10 +128,12 @@ namespace VirtualTask.Controllers modelList = JsonConvert.DeserializeObject>(data); - //ViewData["CurrentFilter"] = Impianto; + ViewData["CurrentFilter"] = impianto; - modelList = modelList.Where(x => x.codice_impianto.Equals(Impianto)).ToList(); - //ViewBag.Impianto = Impianto; + if (!impianto.Equals("System.Collections.Generic.List`1[Microsoft.AspNetCore.Mvc.Rendering.SelectListItem]")/* || impianto != null*/) + { + modelList = modelList.Where(x => x.codice_impianto.Equals(impianto)).ToList(); + } if (!dataFin.ToString().Substring(0, 10).Equals("01/01/0001")) { diff --git a/Views/Rapportini/Index.cshtml b/Views/Rapportini/Index.cshtml index 3fe8b6e..4dae37e 100644 --- a/Views/Rapportini/Index.cshtml +++ b/Views/Rapportini/Index.cshtml @@ -19,7 +19,7 @@
Impianto: - @Html.DropDownList("Impianto", ViewBag.Rapportini, null, new { @class = "agy-form-field require" }) + @Html.DropDownList("impianto", ViewBag.Rapportini, null, new { @class = "agy-form-field require" })
 
@@ -31,6 +31,7 @@


+ @using (Html.BeginForm("ExportDataToExcel", "Rapportini")) {
@@ -42,8 +43,10 @@ Data a: @Html.TextBox("dataFin", null, new { type = "date", @class = "agy-form-field require" })
+ + @Html.Hidden("impianto", ViewBag.Rapportini, null) - @Html.Hidden("Impianto", ViewBag.Rapportini, null) + @* @Html.Hiddenfor(x => x.codice) *@
diff --git a/Views/Shared/_Layout2.cshtml b/Views/Shared/_Layout2.cshtml index bb91096..78b4706 100644 --- a/Views/Shared/_Layout2.cshtml +++ b/Views/Shared/_Layout2.cshtml @@ -253,10 +253,8 @@ Purchase:
  • Lunedì - Venerdì : 09:00 - 13:00 e 14:30 - 18:00
  • Sabato/Domenica: Chiuso
  • - @*
  • Sunday : Day Off (Holiday)
  • *@
- @*
Call Now -
-
+(61) 1800-125-124
*@ +
diff --git a/Views/Shared/_LayoutAreaRiservata.cshtml b/Views/Shared/_LayoutAreaRiservata.cshtml index 3c156b2..bf310f7 100644 --- a/Views/Shared/_LayoutAreaRiservata.cshtml +++ b/Views/Shared/_LayoutAreaRiservata.cshtml @@ -267,6 +267,7 @@ Purchase: @*
Call Now -
+(61) 1800-125-124
*@ +