From 94bc4a303e0ce70b7231a9768e932b49aaa35d5c Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Tue, 1 Oct 2024 17:51:29 +0200 Subject: [PATCH] correzione per update su TUTTI i campi di SBRORD --- Controllers/GiriController.cs | 6 +++++- appsettings.json | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Controllers/GiriController.cs b/Controllers/GiriController.cs index 7bbcda6..4e173c0 100644 --- a/Controllers/GiriController.cs +++ b/Controllers/GiriController.cs @@ -221,9 +221,13 @@ namespace ApiSoftway.Controllers Sbr_ord sbr_Ord = new Sbr_ord(); sbr_Ord.Brserial = d.Brserial; sbr_Ord.Pisergir = newSer; + //ATTENZIONE!! fa l'aggiornamento su tutti i campi dell'oggetto + using (var transactionDest = _sbrord_context.Database.BeginTransaction()) { - _sbrord_context.Entry(sbr_Ord).State = EntityState.Modified; + //_sbrord_context.Entry(sbr_Ord).State = EntityState.Modified; + _sbrord_context.Entry(sbr_Ord).Property(x => x.Pisergir).IsModified = true; + await _sbrord_context.SaveChangesAsync(); transactionDest.Commit(); } diff --git a/appsettings.json b/appsettings.json index 618af2e..e0b11e5 100644 --- a/appsettings.json +++ b/appsettings.json @@ -8,9 +8,9 @@ "AllowedHosts": "*", "ConnectionStrings": { - "GESA": "Data Source=10.0.0.10;Initial Catalog=AHRGESA;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", - //"GESA": "Data Source=10.0.0.10;Initial Catalog=AHR80_GESA;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", - "ApiStr": "Data Source=10.0.0.10;Initial Catalog=API_POLO;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + + "GESA": "Data Source=172.25.30.152;Initial Catalog=AHRGESA_old;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + //"GESA": "Data Source=windowstest.polo;Initial Catalog=AHRGESA;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" }, "JWT": { "ValidAudience": "http://localhost:4200",