From 873a3c2530c153ebe27efc60a7fb65e3d788f880 Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Fri, 12 Jul 2024 12:48:06 +0200 Subject: [PATCH] elimina destinazione --- Controllers/DestinazioniController.cs | 32 ++++++++++++++++++ Views/Destinazioni/Index.cshtml | 47 +++++++++++++++------------ 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/Controllers/DestinazioniController.cs b/Controllers/DestinazioniController.cs index 527969f..6fbc347 100644 --- a/Controllers/DestinazioniController.cs +++ b/Controllers/DestinazioniController.cs @@ -96,5 +96,37 @@ namespace SoftwayWeb.Controllers } } + + [HttpPost] + public IActionResult EliminaDestinazione(string seriale) + { + SessionHelper helper = new SessionHelper(this); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "Giri/listaDestinazioniBySerial"; + urlBase = urlBase + "?seriale=" + seriale; + + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Destinazioni_Out model = new Destinazioni_Out(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + if (response.IsSuccessStatusCode) + { + string dato = response.Content.ReadAsStringAsync().Result; + model = JsonConvert.DeserializeObject(dato); + + //qui metodo post per scrivere su pimodgir + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + + return RedirectToAction("Index", "Giri"); + } } } diff --git a/Views/Destinazioni/Index.cshtml b/Views/Destinazioni/Index.cshtml index 6518f08..910e0d2 100644 --- a/Views/Destinazioni/Index.cshtml +++ b/Views/Destinazioni/Index.cshtml @@ -20,6 +20,7 @@ + @@ -31,12 +32,34 @@ + @foreach (var item in Model) { + @if (item.ConsFatta != null) + { + + } + else + { + + } @@ -113,29 +136,11 @@ - - - @if (item.ConsFatta != null) - { - } - else - { - - } + +
  Seq Committente SedeUova Cist Note 
+ @Html.HiddenFor(modelItem => item.ConsFatta.consFattaFlagCons) + + @if (item.ConsFatta.consFattaFlagCons.Contains("S")) + { + cons + } + else + { + nocons + } + + notyet + @Html.DisplayFor(modelItem => item.Seq) @Html.DisplayFor(modelItem => item.Note) - @Html.HiddenFor(modelItem => item.ConsFatta.consFattaFlagCons) - - @if (item.ConsFatta.consFattaFlagCons.Contains("S")) - { - cons - } - else - { - nocons - } + nocons - notyet -