diff --git a/Controllers/AnagController.cs b/Controllers/AnagController.cs index 19e4091..31ac04c 100644 --- a/Controllers/AnagController.cs +++ b/Controllers/AnagController.cs @@ -6,7 +6,9 @@ using NuGet.Common; using System.Diagnostics; using System.Reflection; using System.Runtime.Intrinsics.Arm; +using System.Security.Policy; using System.Text; +using System.Text.Json.Nodes; using VirtualTask.Models; using X.PagedList; @@ -339,10 +341,32 @@ namespace VirtualTask.Controllers p++; seriale=Convert.ToString(p); seriale = seriale.PadLeft(10, '0'); + Progressivo upd=new Progressivo(); + upd.val_prog = p; + upd.tipo_prog = _serchiam; + upd.azienda = tenant; + updateSeriale(upd ); } - //todo AGGIORNO IL VALORE DEL PROGRESSIVO - return seriale; } + private async void updateSeriale(Progressivo p) + { + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + apiUrl = helper.GetStringValue("apiUrl"); + tenant = helper.GetStringValue("tenant"); + urlBase = apiUrl + "progressivo/mod"; + urlBase = urlBase + "?token=" + token; + //Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + + var stringPayload = JsonConvert.SerializeObject(p); + var httpContent = new StringContent(stringPayload, Encoding.UTF8, "application/json"); + var httpResponse = await client.PostAsync(urlBase, httpContent); + if (httpResponse.Content != null) + { + var responseContent = await httpResponse.Content.ReadAsStringAsync(); + } + } } } diff --git a/Views/Anag/Create.cshtml b/Views/Anag/Create.cshtml index 9d34116..26020c6 100644 --- a/Views/Anag/Create.cshtml +++ b/Views/Anag/Create.cshtml @@ -15,12 +15,8 @@ @Html.HiddenFor(x => x.andtobso) @Html.HiddenFor(x => x.annumlis) + @Html.HiddenFor(x => x.ancodice) -
- - - -
diff --git a/Views/Anag/Details.cshtml b/Views/Anag/Details.cshtml index 7ef36a4..f173698 100644 --- a/Views/Anag/Details.cshtml +++ b/Views/Anag/Details.cshtml @@ -71,6 +71,6 @@
- @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | + @Html.ActionLink("Edit", "Edit", new { id = Model.ancodice }) | Back to List
diff --git a/Views/Anag/Edit.cshtml b/Views/Anag/Edit.cshtml index ec4aef0..dbbb7e9 100644 --- a/Views/Anag/Edit.cshtml +++ b/Views/Anag/Edit.cshtml @@ -16,10 +16,14 @@ @Html.HiddenFor(x => x.antipcon) @Html.HiddenFor(x => x.andtobso) @Html.HiddenFor(x => x.annumlis) + + +
- - + @Html.HiddenFor(x => x.ancodice) + @Html.DisplayFor(model => model.ancodice) +
diff --git a/Views/Anag/Index.cshtml b/Views/Anag/Index.cshtml index ee47305..bddb6c9 100644 --- a/Views/Anag/Index.cshtml +++ b/Views/Anag/Index.cshtml @@ -9,15 +9,15 @@ ViewData["Title"] = "Index"; } -

Index

+

Anagrafiche

- Create New + Crea nuova anagrafica

@using (Html.BeginForm()) {

- Find by Rag. Sociale: @Html.TextBox("SearchString") + Cerca per Rag. Sociale: @Html.TextBox("SearchString")

} @@ -122,8 +122,8 @@ PageClasses = new[]{ "page-link"}, LiElementClasses=new[] { "page-item" }, UlElementClasses = new[] { "pagination","justify-content-center", "mt-3" }, - LinkToNextPageFormat = "Next", - LinkToPreviousPageFormat = "Previous", + LinkToNextPageFormat = "Successiva", + LinkToPreviousPageFormat = "Precedente", MaximumPageNumbersToDisplay = 5, DisplayLinkToPreviousPage = PagedListDisplayMode.Always, DisplayLinkToNextPage = PagedListDisplayMode.Always