Fix gestione sel cliente
This commit is contained in:
@@ -439,7 +439,12 @@ namespace MagMan.Data.Admin.Services
|
||||
if (custRow != null)
|
||||
{
|
||||
answ = custRow.MainKey;
|
||||
CustMKeyList.Add(CustID, answ);
|
||||
try
|
||||
{
|
||||
CustMKeyList.Add(CustID, answ);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
Log.Info($"TokenMKeyList: added {CustID} --> {answ}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,6 @@ namespace MagMan.UI.Components
|
||||
{
|
||||
public partial class CmpSelCliente
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> E_CustSelected { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
@@ -28,14 +21,8 @@ namespace MagMan.UI.Components
|
||||
{
|
||||
customerID = value;
|
||||
InvokeAsync(() => AppMService.ClientIdSet(value));
|
||||
if (false)
|
||||
{
|
||||
E_CustSelected.InvokeAsync(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppMService.CustomerID = value;
|
||||
}
|
||||
AppMService.CustomerID = value;
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +36,10 @@ namespace MagMan.UI.Components
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
CustomerID = await AppMService.ClientIdGet();
|
||||
if (firstRender || CustomerID < 0)
|
||||
{
|
||||
CustomerID = await AppMService.ClientIdGet();
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -66,7 +56,7 @@ namespace MagMan.UI.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private int customerID = 0;
|
||||
private int customerID = -1;
|
||||
|
||||
private List<CustomerModel>? CustomersList = null;
|
||||
|
||||
|
||||
@@ -41,11 +41,6 @@ namespace MagMan.UI.Components
|
||||
AppMessages.EA_PageUpdated += OnPageUpdate;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(0);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
@@ -58,13 +53,6 @@ namespace MagMan.UI.Components
|
||||
private bool ShowSearch { get; set; } = false;
|
||||
|
||||
|
||||
#if false
|
||||
protected void SaveCust(int newCustId)
|
||||
{
|
||||
AppMessages.CustomerID = newCustId;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.0.2401.2319</Version>
|
||||
<Version>1.0.2401.2410</Version>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
|
||||
@@ -19,12 +19,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
@if (currMode != CtMode.Company)
|
||||
{
|
||||
<CmpSelCliente E_CustSelected="SaveCust"></CmpSelCliente>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (currMode == CtMode.Loading)
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace MagMan.UI.Pages
|
||||
AppMService.ShowSearch = false;
|
||||
AppMService.PageName = "Admin Area";
|
||||
AppMService.PageIcon = "fa-solid fa-house pr-2";
|
||||
AppMService.EA_CustomerSel += AppMService_EA_CustomerSel;
|
||||
AppMService.EA_CustomerSel += AppMService_EA_CustomerSel;
|
||||
CustomerID = AppMService.CustomerID;
|
||||
}
|
||||
|
||||
private async void AppMService_EA_CustomerSel()
|
||||
@@ -45,19 +46,12 @@ namespace MagMan.UI.Pages
|
||||
var actMode = currMode;
|
||||
currMode = CtMode.Loading;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
#if false
|
||||
CustomerID = AppMService.CustomerID;
|
||||
#endif
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(50);
|
||||
currMode = actMode;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
protected void SaveCust(int newCustId)
|
||||
{
|
||||
CustomerID = newCustId;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
@attribute [AllowAnonymous]
|
||||
|
||||
<div class="mt-4 p-3 bg-light text-dark rounded shadow-lg">
|
||||
<div class="mt-4 p-3 bg-light text-dark border border-light rounded shadow-lg">
|
||||
<div class="row">
|
||||
<div class="col-6 col-md-8 pr-0">
|
||||
<h1>Mag-Man</h1>
|
||||
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row px-5">
|
||||
<div class="col-6 col-md-4">
|
||||
<div class="col-6 col-md-3">
|
||||
<AuthorizeView Roles="SuperAdmin, Admin">
|
||||
<Authorized>
|
||||
<NavLink type="button" class="btn btn-block btn-primary text-light p-3 m-2 w-100" title="Scheda Fornitore" href="AdminArea">
|
||||
@@ -52,7 +52,7 @@
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<div class="col-6 col-md-3">
|
||||
<AuthorizeView Roles="SuperAdmin, Admin, User">
|
||||
<Authorized>
|
||||
<NavLink type="button" class="btn btn-block btn-primary text-light p-3 m-2 w-100" title="Stato Impianti" href="MachineStatus">
|
||||
@@ -62,7 +62,17 @@
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<div class="col-6 col-md-3">
|
||||
<AuthorizeView Roles="SuperAdmin, Admin, User">
|
||||
<Authorized>
|
||||
<NavLink type="button" class="btn btn-block btn-primary text-light p-3 m-2 w-100" title="Stato Impianti" href="ProjectsStatus">
|
||||
<i class="fa-solid fa-chart-gantt fa-2x mb-2" aria-hidden="true"></i>
|
||||
<h4>Progetti</h4>
|
||||
</NavLink>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<AuthorizeView Roles="SuperAdmin, Admin, User">
|
||||
<Authorized>
|
||||
<NavLink type="button" class="btn btn-block btn-primary text-light p-3 m-2 w-100" title="Scheda Stazione" href="WareHouse">
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace MagMan.UI.Pages
|
||||
// resetto cache redis
|
||||
await MTService.FlushRedisCache();
|
||||
string baseAppPath = Configuration["OptConf:BaseUrl"];
|
||||
NavMan.NavigateTo(baseAppPath);
|
||||
NavMan.NavigateTo(baseAppPath, true);
|
||||
}
|
||||
[Inject]
|
||||
private NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
@@ -2,13 +2,6 @@
|
||||
|
||||
<PageTitle>WareHouse Area</PageTitle>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<CmpSelCliente E_CustSelected="SaveCust"></CmpSelCliente>
|
||||
</div>
|
||||
</div>
|
||||
@if (CustomerID == 0)
|
||||
{
|
||||
<div class="alert alert-info">
|
||||
|
||||
@@ -20,8 +20,6 @@ namespace MagMan.UI.Pages
|
||||
[Inject]
|
||||
protected MessageService AppMService { get; set; } = null!;
|
||||
|
||||
protected int CustomerID { get; set; } = 0;
|
||||
|
||||
protected string mainCss
|
||||
{
|
||||
get => MaterialSel == null ? "col-12" : "col-6 small";
|
||||
@@ -39,16 +37,12 @@ namespace MagMan.UI.Pages
|
||||
AppMService.ShowSearch = true;
|
||||
AppMService.PageName = "Warehouse Area";
|
||||
AppMService.PageIcon = "fa-solid fa-warehouse pr-2";
|
||||
AppMService.EA_CustomerSel += AppMService_EA_CustomerSel;
|
||||
CustomerID = AppMService.CustomerID;
|
||||
// rileggo dati
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task SaveCust(int newCustId)
|
||||
{
|
||||
CustomerID = newCustId;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected void SaveMat(MaterialModel? newMat)
|
||||
{
|
||||
MaterialSel = newMat;
|
||||
@@ -65,12 +59,20 @@ namespace MagMan.UI.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int CustomerID { get; set; } = 0;
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void AppMService_EA_CustomerSel()
|
||||
{
|
||||
CustomerID = AppMService.CustomerID;
|
||||
await Task.Delay(10);
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MagMan - Wood Warehouse Management System</i>
|
||||
<h4>Versione: 1.0.2401.2319</h4>
|
||||
<h4>Versione: 1.0.2401.2410</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.2401.2319
|
||||
1.0.2401.2410
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.2401.2319</version>
|
||||
<version>1.0.2401.2410</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user