From 59098b1df178879a9027655a8a4de9f0d8cffb6c Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Wed, 27 Dec 2023 12:21:52 +0100 Subject: [PATCH] chiamate --- Controllers/ImpiantiController.cs | 2 +- Models/Chiamate.cs | 3 ++- Models/Impianto.cs | 2 ++ Views/Chiamate/Create.cshtml | 5 ++--- Views/Chiamate/Delete.cshtml | 9 ++++++--- Views/Chiamate/Edit.cshtml | 10 +++++++--- Views/Chiamate/Index.cshtml | 27 +++++++++++++++++++-------- appsettings.json | 2 +- 8 files changed, 40 insertions(+), 20 deletions(-) diff --git a/Controllers/ImpiantiController.cs b/Controllers/ImpiantiController.cs index 07672a5..2ef7f98 100644 --- a/Controllers/ImpiantiController.cs +++ b/Controllers/ImpiantiController.cs @@ -59,7 +59,7 @@ namespace VirtualTask.Controllers { string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); - modelList = modelList.Where(s => !string.IsNullOrEmpty(s.imcodimp) && s.imcodazi.Equals(tenant2)).ToList(); + modelList = modelList.Where(s => !string.IsNullOrEmpty(s.imcodimp) && s.imcodazi.Equals(tenant2) && s.imfinatt==null).ToList(); if (!string.IsNullOrEmpty(searchString)) { diff --git a/Models/Chiamate.cs b/Models/Chiamate.cs index 3579b25..0002a2d 100644 --- a/Models/Chiamate.cs +++ b/Models/Chiamate.cs @@ -14,7 +14,7 @@ namespace VirtualTask.Models [Display(Name = "Seriale")] public string? chserial { get; set; } - [Display(Name = "Codice esercizio")] + [Display(Name = "Anno esercizio")] public string? chcodese { get; set; } [Display(Name = "Tipo")] @@ -26,6 +26,7 @@ namespace VirtualTask.Models [Display(Name = "Data")] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")] + public DateTime? chdata { get; set; } [Display(Name = "Cod. Impianto")] diff --git a/Models/Impianto.cs b/Models/Impianto.cs index 57ab3d4..0098261 100644 --- a/Models/Impianto.cs +++ b/Models/Impianto.cs @@ -101,5 +101,7 @@ namespace VirtualTask.Models } } + public DateTime? imfinatt { get; set; } + } } diff --git a/Views/Chiamate/Create.cshtml b/Views/Chiamate/Create.cshtml index dd04a6f..1ac0cf1 100644 --- a/Views/Chiamate/Create.cshtml +++ b/Views/Chiamate/Create.cshtml @@ -60,6 +60,7 @@ @Html.HiddenFor(x => x.chcodazi) @Html.HiddenFor(x => x.chserial) @@ -81,9 +82,7 @@ -
- Torna alla lista -
+ @section Scripts { @{ diff --git a/Views/Chiamate/Delete.cshtml b/Views/Chiamate/Delete.cshtml index fc2cced..0afe890 100644 --- a/Views/Chiamate/Delete.cshtml +++ b/Views/Chiamate/Delete.cshtml @@ -49,13 +49,16 @@
 
+
model.chserial) name="id" /> -
- Torna alla lista -
+ + @*Torna alla lista*@ + Torna alla lista +
+
diff --git a/Views/Chiamate/Edit.cshtml b/Views/Chiamate/Edit.cshtml index d4ebba5..0dad4e0 100644 --- a/Views/Chiamate/Edit.cshtml +++ b/Views/Chiamate/Edit.cshtml @@ -27,7 +27,8 @@
 
- + @Html.HiddenFor(x => x.chcodese) + @Html.DisplayFor(model => model.chcodese)
@Html.HiddenFor(x => x.chtipo) @@ -40,7 +41,8 @@
 
- + +
 
@@ -89,6 +91,7 @@
 
@Html.HiddenFor(x => x.chora) @@ -141,7 +144,8 @@
- Torna alla lista +@* Torna alla lista*@ +
@section Scripts { @{ diff --git a/Views/Chiamate/Index.cshtml b/Views/Chiamate/Index.cshtml index 15fc27c..07e73e2 100644 --- a/Views/Chiamate/Index.cshtml +++ b/Views/Chiamate/Index.cshtml @@ -92,18 +92,29 @@ } - - Modifica - - | + @{ + string _url_edit = @Url.Action("Edit", "Chiamate", new { id = item.chserial }); + + if (string.IsNullOrEmpty(item.ic) || string.IsNullOrEmpty(item.ser_buono_chiu)) + { + + Modifica + + } + } Dettaglio - | - - Elimina - + @{ + string _url_del = @Url.Action("Delete", "Chiamate", new { id = item.chserial }); + if (string.IsNullOrEmpty(item.ic) || string.IsNullOrEmpty(item.ser_buono_chiu)) + { + + Elimina + + } + } } diff --git a/appsettings.json b/appsettings.json index e3d09a7..479c6ab 100644 --- a/appsettings.json +++ b/appsettings.json @@ -13,7 +13,7 @@ //TEST "rootUrlApi": "http://testapi.poloinformatico.it:9001/api/Polo/", - "rootWebLoghi": "C:\\SORGENTI\\_publish\\wwwroot\\VIRTU\\", + "rootWebLoghi": "C:\\SORGENTI\\ApiPolo\\ApiPolo\\wwwroot\\VIRTU\\", "rootUrlApi2": "http://testapi.poloinformatico.it:9001/VIRTU/", "mittenteMail": "info@virtualtask.it",