From cfc019c8e7616596729f13deaffd677d731bb602 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 15 Oct 2025 16:13:55 +0200 Subject: [PATCH] aggiornata funzione SerialMan --- Test.UI/Components/Pages/EditJWD.razor | 62 +++++++++++++++++++ Test.UI/Components/Pages/EditJWD.razor.cs | 12 ++++ WebWindowComplex/SerialMan.cs | 50 +++++++++++++-- WebWindowComplex/WebWindowComplex.csproj | 23 ++++++- .../WebWindowConfigurator.csproj | 21 ++++++- 5 files changed, 162 insertions(+), 6 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 3fdf510..20de6e0 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -3,6 +3,68 @@ EditJWD +
+
+
+ FamilyHw + +
+
+ +
+
+ Color + +
+
+
+
+ Material + +
+
+
+
+ Glass + +
+
+
+
+ Profile + +
+
+
+ +
+
+ /// Riceve un JWD in ingresso e effettua una sostituzione dei parametri rieschiesti (SE non nulli) /// @@ -18,22 +21,61 @@ namespace WebWindowComplex /// /// /// Valore serializzato con le modifiche richieste - public string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial) + public static string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile) { string outVal = currSer; // serializzazione JWD --> window - + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(currSer, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + Window currWindow = WindowFromJson.Deserialize(); // verifica 1:1 delle richieste if (!string.IsNullOrEmpty(newFamilyHardware)) { + SearchSash(currWindow.AreaList.First(), newFamilyHardware, null); } if (newHardware != null) { + SearchSash(currWindow.AreaList.First(), null, newHardware); } if (!string.IsNullOrEmpty(newColorMaterial)) { + currWindow.sColorMaterial = newColorMaterial; + } + if (!string.IsNullOrEmpty(newMaterial)) + { + currWindow.sMaterial = newMaterial; + } + if (!string.IsNullOrEmpty(newGlass)) + { + currWindow.sGlass = newGlass; + } + if (!string.IsNullOrEmpty(newProfile)) + { + currWindow.sProfilePath = newProfile; + } + var CurrJwd = JsonConvert.SerializeObject(currWindow.Serialize(), Formatting.Indented); + return CurrJwd; + + + } + + internal static void SearchSash(Area currentArea, string? newFamilyHw, Hardware? newHardware) + { + if (currentArea.AreaType.Equals(AreaTypes.SASH)) + { + Sash s = (Sash)currentArea; + if (!string.IsNullOrEmpty(newFamilyHw)) + { + s.SelFamilyHardware = newFamilyHw; + } + if (newHardware != null) + { + s.SelHardware = newHardware; + } + } + foreach (Area child in currentArea.AreaList) + { + SearchSash(child, newFamilyHw, newHardware); } - return outVal; } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index ffa667d..ec2251a 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1511 + 2.7.10.1514 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -55,6 +55,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index cb82d40..9c14bf6 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1511 + 2.7.10.1514 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -68,6 +68,25 @@ + + + + + + + + + + + + + + + + + + +