Aggiunto caricamento file

This commit is contained in:
2025-11-05 15:20:27 +01:00
parent f4b2e70881
commit a26f1a57cc

View File

@@ -228,15 +228,22 @@
} }
} }
@if (ActivityFileList != null) @if (!IsLoading)
{ {
foreach (var file in ActivityFileList) if (ActivityFileList != null)
{ {
<MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))" OnClose="@(() => DeleteAttach(file))" Color="Color.Default"> foreach (var file in ActivityFileList)
@file.FileName {
</MudChip> <MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))" OnClose="@(() => DeleteAttach(file))" Color="Color.Default">
@file.FileName
</MudChip>
}
} }
} }
else
{
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7" />
}
</div> </div>
@if (!IsView) @if (!IsView)
@@ -318,6 +325,7 @@
private List<ActivityFileDto>? ActivityFileList { get; set; } private List<ActivityFileDto>? ActivityFileList { get; set; }
private bool IsNew { get; set; } private bool IsNew { get; set; }
private bool IsLoading { get; set; }
private bool IsView => !NetworkService.ConnectionAvailable; private bool IsView => !NetworkService.ConnectionAvailable;
private string? LabelSave { get; set; } private string? LabelSave { get; set; }
@@ -443,6 +451,9 @@
{ {
return Task.Run(async () => return Task.Run(async () =>
{ {
IsLoading = true;
await InvokeAsync(StateHasChanged);
SelectedComessa = ActivityModel.Commessa; SelectedComessa = ActivityModel.Commessa;
Users = await ManageData.GetTable<StbUser>(); Users = await ManageData.GetTable<StbUser>();
@@ -456,6 +467,7 @@
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" }); Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
Pros = await ManageData.GetProspect(); Pros = await ManageData.GetProspect();
IsLoading = false;
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
}); });
} }