diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 2f41adf..0fb1fe4 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -611,7 +611,7 @@ namespace WebWindowComplex UpdateDict(); } } - if (m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0) + if (m_CurrWindow != null && m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0) { checkWarnings(); if (SashList.Count > 0) @@ -736,7 +736,7 @@ namespace WebWindowComplex } m_CurrWindow = WindowFromJson.Deserialize(); groupIdOK = CheckGroupId(m_CurrWindow); - if(m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0 && groupIdOK) + if (m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0 && groupIdOK) { FrameWindow = m_CurrWindow.AreaList[0]; if (m_PreviousWindow != null) @@ -777,16 +777,23 @@ namespace WebWindowComplex // Inserisco le forme ricevuto nei sash group foreach (var item in LiveData.DictShape) { - Sash sashFromGroupId = SashList.First(x => x.GroupId == item.Key); - sashFromGroupId.SashShape = item.Value; - sashFromGroupId.UpdateShape(item.Value); + //Sash sashFromGroupId = SashList.First(x => x.GroupId == item.Key); + var sashFromGroupId = SashList.FirstOrDefault(x => x.GroupId == item.Key); + if (sashFromGroupId != null) + { + sashFromGroupId.SashShape = item.Value; + sashFromGroupId.UpdateShape(item.Value); + } } if (prevReq == (int)DataReq.ReqShape) { if (reqHwOpt > 0) { List reqList = SashList.Select(x => x.GroupId).ToList(); - _ = DoReqOptHardware(reqList); + if (reqList.Count > 0) + { + _ = DoReqOptHardware(reqList); + } } } } @@ -802,7 +809,7 @@ namespace WebWindowComplex } } } - if(LiveData.ProfElementList.Count > 0) + if (LiveData.ProfElementList.Count > 0) { // Inserisco i profili ricevuti nei rispettivi Element foreach (var item in LiveData.ProfElementList) @@ -987,7 +994,7 @@ namespace WebWindowComplex { listWarnings.Add("ColorMaterial", $"Missing Color: {m_CurrWindow.sColorMaterial}"); } - if (ListPayload.Glass == null || !ListPayload.Glass.Contains(m_CurrWindow.sGlass)) + if (ListPayload.Glass == null || !ListPayload.Glass.Contains(m_CurrWindow.sGlass)) { listWarnings.Add("Glass", $"Missing Glass: {m_CurrWindow.sGlass}"); } @@ -1153,7 +1160,7 @@ namespace WebWindowComplex // Cerco area corrispondente al GroupId Area? found = SearchAreaFromGroupId(FrameWindow, GroupIdSearch); List elemList = new List(); - if(found != null) + if (found != null) { switch (found.AreaType) { @@ -1178,7 +1185,7 @@ namespace WebWindowComplex { Sash sash = (Sash)found; SashDimension anta = sash.SashList.ElementAt(EntityIdSearch - 1); - for(int index = anta.ElementDimensionList.Count; index < profileNameList.Count; index++) + for (int index = anta.ElementDimensionList.Count; index < profileNameList.Count; index++) { double valStd = Window.m_ParameterList.GetValueOrDefault(profileNameList.ElementAt(index) + "_DimStd"); anta.ElementDimensionList.Add(new ElementDimension(sash, index + 1, valStd)); @@ -1196,7 +1203,7 @@ namespace WebWindowComplex { Split split = (Split)found; List SpElemList = split.searchElemFromSubArea(EntityIdSearch); - for(int i = 0; i < SpElemList.Count; i++) + for (int i = 0; i < SpElemList.Count; i++) { SpElemList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); SpElemList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMin")); @@ -1207,7 +1214,7 @@ namespace WebWindowComplex break; } } - foreach(var item in elemList) + foreach (var item in elemList) { item.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMin")); item.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMax")); @@ -1366,7 +1373,7 @@ namespace WebWindowComplex } } } - + /// /// Aggiornamento Element a causa di un cambiamento nella sash /// @@ -1436,7 +1443,7 @@ namespace WebWindowComplex // richiedo update element della sash (se presenti) if (SashList.Count > 0) { - foreach(var item in SashList) + foreach (var item in SashList) { reqList.Add(item.GroupId); } @@ -1566,7 +1573,7 @@ namespace WebWindowComplex } else { - Sash item = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId ); + Sash item = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId); if (newSash != null && item != null) { item = newSash; diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index bc4fa32..623c6a1 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.415 + 3.1.2.416 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -70,5 +70,6 @@ + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index f174a1b..042cfdd 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.415 + 3.1.2.416 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -93,5 +93,6 @@ +