update x dizionario optionsXML
This commit is contained in:
@@ -477,8 +477,9 @@ namespace WebWindowComplex
|
||||
/// <summary>
|
||||
/// Richiesta calcolo Options HW da JWD
|
||||
/// </summary>
|
||||
/// <param name="groupIdList">Lista degli ID numerici dei gruppi da valutare</param>
|
||||
/// <returns></returns>
|
||||
protected async Task DoReqOptHardware()
|
||||
protected async Task DoReqOptHardware(List<int> groupIdList)
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
@@ -495,6 +496,8 @@ namespace WebWindowComplex
|
||||
Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}");
|
||||
Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.HARDWAREOPTIONS}");
|
||||
Args.Add("Jwd", CurrJwd);
|
||||
string listGroupId = JsonConvert.SerializeObject(groupIdList);
|
||||
Args.Add("GroupId", listGroupId);
|
||||
await EC_DoUpdate.InvokeAsync(Args);
|
||||
}
|
||||
}
|
||||
@@ -599,7 +602,7 @@ namespace WebWindowComplex
|
||||
prevLiveData = new LivePayload()
|
||||
{
|
||||
CurrJwd = LiveData.CurrJwd,
|
||||
OptionsXml = LiveData.OptionsXml,
|
||||
DictOptionsXml = LiveData.DictOptionsXml,
|
||||
DictShape = LiveData.DictShape,
|
||||
SvgPreview = LiveData.SvgPreview
|
||||
};
|
||||
@@ -695,15 +698,19 @@ namespace WebWindowComplex
|
||||
if (updRequested)
|
||||
{
|
||||
// se mancasse xml opzioni hardware lo chiedo
|
||||
if (string.IsNullOrEmpty(LiveData.OptionsXml))
|
||||
if (LiveData.DictOptionsXml.Count == 0)
|
||||
{
|
||||
foreach(var item in SashList)
|
||||
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
|
||||
//foreach (var item in SashList)
|
||||
//{
|
||||
// string req = item.SelHardware.Id;
|
||||
// if (string.IsNullOrEmpty(req))
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
if (reqList.Count > 0)
|
||||
{
|
||||
string req = item.SelHardware.Id;
|
||||
if (string.IsNullOrEmpty(req))
|
||||
{
|
||||
await DoReqOptHardware();
|
||||
}
|
||||
await DoReqOptHardware(reqList);
|
||||
}
|
||||
}
|
||||
// se mancasse dizionario forme chiamo quello
|
||||
@@ -770,10 +777,15 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
// se ho le opzioni hw le aggiungo
|
||||
if (!string.IsNullOrEmpty(LiveData.OptionsXml))
|
||||
if (LiveData.DictOptionsXml.Count > 0)
|
||||
{
|
||||
foreach (var item in SashList)
|
||||
item.SetHardwareOption(LiveData.OptionsXml);
|
||||
{
|
||||
if (LiveData.DictOptionsXml.ContainsKey(item.GroupId))
|
||||
{
|
||||
item.SetHardwareOption(LiveData.DictOptionsXml[item.GroupId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1318,10 +1330,12 @@ namespace WebWindowComplex
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateHwOptions(Sash newSash)
|
||||
{
|
||||
{
|
||||
// richiesta calcolo opzioni hardware per la singola sash group
|
||||
string req = newSash.SelHardware.Id;
|
||||
await DoReqOptHardware();
|
||||
List<int> reqList = new List<int>() { newSash.GroupId };
|
||||
// chiamo con gruppo della nuova sash
|
||||
await DoReqOptHardware(reqList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user