Fix selezione key in cascata

This commit is contained in:
Samuele Locatelli
2024-02-02 11:31:24 +01:00
parent abd4f94279
commit f54e5702c2
22 changed files with 210 additions and 149 deletions
+58 -23
View File
@@ -31,29 +31,11 @@ namespace MagMan.Core.Services
public event Action EA_SearchUpdated = null!;
public event Action EA_ShowSearch = null!;
public event Action EA_CustomerSel = null!;
public event Action EA_KeySel = null!;
public event Action<bool> EA_ShowCustomers = null!;
#endregion Public Events
#if false
public SelectData DetailFilter
{
get => _detailFilter;
set
{
if (_detailFilter != value)
{
_detailFilter = value;
if (EA_FilterUpdated != null)
{
EA_FilterUpdated?.Invoke();
}
}
}
}
public SelectOrderData Order_Filter { get; set; } = SelectOrderData.Init(5, 30);
#endif
#region Public Properties
@@ -114,7 +96,23 @@ namespace MagMan.Core.Services
}
}
}
}
}
public int KeyNum
{
get => _keyNum;
set
{
if (_keyNum != value)
{
_keyNum = value;
if (EA_KeySel != null)
{
EA_KeySel?.Invoke();
}
}
}
}
public string SelOrderCode { get; set; } = "";
public string SelPlantId { get; set; } = "0";
@@ -145,6 +143,23 @@ namespace MagMan.Core.Services
}
}
public bool ShowCustomers
{
get => _showCustomers;
set
{
if (_showCustomers != value)
{
_showCustomers = value;
if (EA_ShowCustomers != null)
{
EA_ShowCustomers?.Invoke(value);
}
}
}
}
/// <summary>
/// Cliente selezionato (da browser data cache)
/// </summary>
@@ -157,9 +172,27 @@ namespace MagMan.Core.Services
/// <summary>
/// Imposta Cliente selezionato (browser data cache)
/// </summary>
public async Task ClientIdSet(int machSel)
public async Task ClientIdSet(int newVal)
{
await localStore.SetItemAsync("ClientID", machSel);
await localStore.SetItemAsync("ClientID", newVal);
}
/// <summary>
/// KeyNum da cliente selezionato (da browser data cache)
/// </summary>
public async Task<int> KeyNumGet()
{
var answ = await localStore.GetItemAsync<int>("KeyNum");
return answ;
}
/// <summary>
/// Imposta KeyNum da cliente selezionato (browser data cache)
/// </summary>
public async Task KeyNumSet(int newVal)
{
await localStore.SetItemAsync("KeyNum", newVal);
}
#endregion Public Properties
@@ -503,7 +536,9 @@ namespace MagMan.Core.Services
private string _pageName = "";
private string _searchVal = "";
private int _customerID = -1;
private int _keyNum = -1;
private bool _showSearch = false;
private bool _showCustomers = true;
private Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields