diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index f67b953..b793057 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -1,4 +1,4 @@ -@using static WebWindowComplex.LayoutConst +@using static WebWindowComplex.Json.WindowConst
@@ -123,25 +123,22 @@
Hardware option
- @if (CurrItem.HwdOptionList.Count > 0) + @if (CurrItem.HwOptionList.Count > 0) { - @foreach (var currOpt in CurrItem.HwdOptionList) + @foreach (var currOpt in CurrItem.HwOptionList) { switch (currOpt.Type) { - case AGBOption.HDWOPTIONTYPES.COMBO: + case HwOptionTypes.COMBO: { AGBOptionCombo currOptCombo = (AGBOptionCombo)currOpt; - + break; } - case AGBOption.HDWOPTIONTYPES.TEXT: + case HwOptionTypes.TEXT: { AGBOptionText currOptText = (AGBOptionText)currOpt; -
- @(currOptText.sName) - -
+ break; } } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 555ce9f..c36f31a 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; +using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex.Compo { @@ -169,10 +170,27 @@ namespace WebWindowComplex.Compo /// /// /// - private async Task UpdateOpt(AGBOptionCombo updRec) + private async Task UpdateOptCombo(AGBOptionCombo updRec) { // cerco il record - var currRec = CurrItem.HwdOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription); + var currRec = CurrItem.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription); + // lo aggiorno + if (updRec != null) + { + currRec = updRec; + await EC_UpdateSash.InvokeAsync(CurrItem); + } + } + + /// + /// Report aggiornamento Option Text + /// + /// + /// + private async Task UpdateOptText(AGBOptionText updRec) + { + // cerco il record + var currRec = CurrItem.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription); // lo aggiorno if (updRec != null) { diff --git a/WebWindowComplex/Compo/EditOptionText.razor b/WebWindowComplex/Compo/EditOptionText.razor new file mode 100644 index 0000000..a26b8f6 --- /dev/null +++ b/WebWindowComplex/Compo/EditOptionText.razor @@ -0,0 +1,9 @@ +
+ + +
\ No newline at end of file diff --git a/WebWindowComplex/Compo/EditOptionText.razor.cs b/WebWindowComplex/Compo/EditOptionText.razor.cs new file mode 100644 index 0000000..55b5d12 --- /dev/null +++ b/WebWindowComplex/Compo/EditOptionText.razor.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class EditOptionText + { + #region Public Properties + + [Parameter] + public AGBOptionText CurrOpt { get; set; } = null!; + + [Parameter] + public EventCallback EC_Update { get; set; } + + #endregion Public Properties + + #region Private Properties + + private string CurrValue + { + get => CurrOpt.sValue; + set + { + if (CurrOpt.sValue != value) + { + CurrOpt.sValue = CurrOpt.ValueList.FirstOrDefault(x => x == value); + _ = EC_Update.InvokeAsync(CurrOpt); + } + } + } + + #endregion Private Properties + + } +} \ No newline at end of file diff --git a/WebWindowComplex/Json/WindowConst.cs b/WebWindowComplex/Json/WindowConst.cs index c9eb397..2eedc6f 100644 --- a/WebWindowComplex/Json/WindowConst.cs +++ b/WebWindowComplex/Json/WindowConst.cs @@ -110,6 +110,13 @@ namespace WebWindowComplex.Json HORIZONTAL = 2 } + public enum HwOptionTypes : int + { + TEXT = 1, + LENGHT = 2, + COMBO = 3 + } + // Specifies the display state of an element. public enum Visibility { diff --git a/WebWindowComplex/Models/AGBOption.cs b/WebWindowComplex/Models/AGBOption.cs index e144eb7..e92e902 100644 --- a/WebWindowComplex/Models/AGBOption.cs +++ b/WebWindowComplex/Models/AGBOption.cs @@ -20,17 +20,6 @@ namespace WebWindowComplex.Models #endregion Public Constructors - #region Public Enums - - public enum HDWOPTIONTYPES : int - { - TEXT = 1, - LENGHT = 2, - COMBO = 3 - } - - #endregion Public Enums - #region Public Properties public Visibility OptVisibility @@ -57,7 +46,7 @@ namespace WebWindowComplex.Models } } - public HDWOPTIONTYPES Type + public HwOptionTypes Type { get { @@ -69,7 +58,7 @@ namespace WebWindowComplex.Models #region Protected Fields - protected HDWOPTIONTYPES m_Type; + protected HwOptionTypes m_Type; #endregion Protected Fields diff --git a/WebWindowComplex/Models/AGBOptionCombo.cs b/WebWindowComplex/Models/AGBOptionCombo.cs index dfc41e4..4cbe031 100644 --- a/WebWindowComplex/Models/AGBOptionCombo.cs +++ b/WebWindowComplex/Models/AGBOptionCombo.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex.Models { @@ -12,7 +13,7 @@ namespace WebWindowComplex.Models public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) { - m_Type = HDWOPTIONTYPES.COMBO; + m_Type = HwOptionTypes.COMBO; foreach (var Value in HdwOptionParam.Opzioni) m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione)); m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", ""); diff --git a/WebWindowComplex/Models/AGBOptionText.cs b/WebWindowComplex/Models/AGBOptionText.cs index 32bcc35..fbb5b6d 100644 --- a/WebWindowComplex/Models/AGBOptionText.cs +++ b/WebWindowComplex/Models/AGBOptionText.cs @@ -3,17 +3,55 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex.Models { + //public class AGBOptionText : AGBOption + //{ + // #region Public Constructors + + // public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) + // { + // m_Type = HdwOptionTypes.TEXT; + // m_sValue = HdwOptionParam.ValoreCorrente; + // } + + // #endregion Public Constructors + + // #region Public Properties + + // public string sValue + // { + // get + // { + // return m_sValue; + // } + // set + // { + // m_sValue = value; + // } + // } + + // #endregion Public Properties + + // #region Private Fields + + // private string m_sValue; + + // #endregion Private Fields + //} + public class AGBOptionText : AGBOption { #region Public Constructors public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) { - m_Type = HDWOPTIONTYPES.TEXT; - m_sValue = HdwOptionParam.ValoreCorrente; + m_Type = HwOptionTypes.TEXT; + foreach (var Value in HdwOptionParam.Opzioni) + m_ValueList.Add(Value.Valore); + m_sValue = m_ValueList.FirstOrDefault(x => x == HdwOptionParam.ValoreCorrente) ?? ""; } #endregion Public Constructors @@ -32,12 +70,22 @@ namespace WebWindowComplex.Models } } + public List ValueList + { + get + { + return m_ValueList; + } + } + #endregion Public Properties #region Private Fields private string m_sValue; + private List m_ValueList = new List(); #endregion Private Fields } + } \ No newline at end of file diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index 2c5dd6e..b9ee70b 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -80,7 +80,7 @@ namespace WebWindowComplex.Models } } - public List HwdOptionList + public List HwOptionList { get { @@ -478,7 +478,7 @@ namespace WebWindowComplex.Models /// public void ReqRefreshHwOption() { - HwdOptionList.Clear(); + HwOptionList.Clear(); // chiamata evento calcolo opzioni hardware OnReqHwOptionPreview(m_ParentWindow.sSerialized(), SelHardware.Id); } @@ -513,7 +513,7 @@ namespace WebWindowComplex.Models } RefreshHardwareList(); // se il vecchio hw selezionato non va più bene viene selezionato il primo della lista - if(!HardwareList.Contains(m_SelHardware) && m_SelHardware.Shape != m_CurrShape) + if(!HardwareList.Contains(m_SelHardware) || m_SelHardware.Shape != m_CurrShape) SetFirstHardware(); } @@ -691,25 +691,25 @@ namespace WebWindowComplex.Models { if (!string.IsNullOrEmpty(OptionXml)) { - ParametriOpzioni HwdOptions = null; + ParametriOpzioni HwOptions = null; XmlSerializer serializer = new XmlSerializer(typeof(ParametriOpzioni)); StringReader reader = new StringReader(OptionXml); - HwdOptions = (ParametriOpzioni)serializer.Deserialize(reader); - if (HwdOptions.Items != null) + HwOptions = (ParametriOpzioni)serializer.Deserialize(reader); + if (HwOptions.Items != null) { m_HwdOptionList.Clear(); - foreach (var HdwOption in HwdOptions.Items) + foreach (var HwOption in HwOptions.Items) { - switch (HdwOption.Tipo) + switch (HwOption.Tipo) { case "Text": { - m_HwdOptionList.Add(new AGBOptionText(HdwOption)); + m_HwdOptionList.Add(new AGBOptionText(HwOption)); break; } case "List": { - m_HwdOptionList.Add(new AGBOptionCombo(HdwOption)); + m_HwdOptionList.Add(new AGBOptionCombo(HwOption)); break; } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index a1ab187..6a261f2 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.2714 + 2.7.10.2716 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -148,6 +148,14 @@ + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 9b8287e..9ddb469 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.2714 + 2.7.10.2716 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -205,6 +205,17 @@ + + + + + + + + + + +