diff --git a/SteUp.Shared/Components/Pages/IspezionePage.razor b/SteUp.Shared/Components/Pages/IspezionePage.razor
index 90457cd..ab72537 100644
--- a/SteUp.Shared/Components/Pages/IspezionePage.razor
+++ b/SteUp.Shared/Components/Pages/IspezionePage.razor
@@ -35,25 +35,28 @@
@($"{group.Value.Count} sched{(group.Value.Count == 1 ? "a" : "e")}")
-
- @if (NetworkService.IsNetworkAvailable())
- {
-
+ @if (SteupDataService.InspectionPageState.Ispezione.Stato != StatusEnum.Completata)
+ {
+
+ @if (NetworkService.IsNetworkAvailable())
+ {
+
-
- }
- else
- {
-
- }
-
+
+ }
+ else
+ {
+
+ }
+
+ }
@@ -61,6 +64,7 @@
{
}
diff --git a/SteUp.Shared/Components/SingleElements/Card/SchedaCard.razor b/SteUp.Shared/Components/SingleElements/Card/SchedaCard.razor
index d657cf8..b4a6c2a 100644
--- a/SteUp.Shared/Components/SingleElements/Card/SchedaCard.razor
+++ b/SteUp.Shared/Components/SingleElements/Card/SchedaCard.razor
@@ -27,21 +27,34 @@
- @if (NetworkService.IsNetworkAvailable())
+ @if (Stato != StatusEnum.Completata)
{
-
-
-
+ if (NetworkService.IsNetworkAvailable())
+ {
+
+
+
+ }
+ else
+ {
+
+ Modifica
+
+
+ Cancella
+
+ }
}
else
{
-
- Modifica
-
-
- Cancella
+
+ Visualizza
}
@@ -55,6 +68,7 @@
@code{
[Parameter] public string CodMdep { get; set; } = string.Empty;
[Parameter] public DateTime Data { get; set; }
+ [Parameter] public StatusEnum Stato { get; set; }
[Parameter] public required Scheda Scheda { get; set; }
[Parameter] public EventCallback OnSchedaModified { get; set; }
[Parameter] public EventCallback OnSchedaDeleted { get; set; }
@@ -72,7 +86,7 @@
private async Task DeleteScheda()
{
var result = await _messageBox.ShowAsync();
-
+
if (result is true)
{
VisibleOverlay = true;
@@ -80,15 +94,18 @@
if (Scheda.ActivityId != null)
await IntegrySteupService.DeleteScheda(Scheda.ActivityId);
-
+
var deleteScheda = await IspezioniService.DeleteSchedaAsync(Scheda.Id);
if (deleteScheda) await OnSchedaDeleted.InvokeAsync(Scheda);
-
+
VisibleOverlay = false;
StateHasChanged();
}
}
+ private void ViewScheda() =>
+ _ = Dialog.OpenFormScheda(CodMdep, Data, false, Scheda, true);
+
private async Task ExportScheda()
{
VisibleOverlay = true;
@@ -109,12 +126,12 @@
ParentActivityId = Scheda.Ispezione?.ActivityId
}
);
-
+
if (apiResponse != null)
{
Scheda.ActivityId = apiResponse.ActivityIdScheda;
SteupDataService.InspectionPageState.Ispezione.ActivityId = apiResponse.ActivityIdIspezione;
-
+
await IspezioniService.UpdateActivityIdIspezioneAsync(CodMdep, Data,
UserSession.User.Username, apiResponse.ActivityIdIspezione
);
diff --git a/SteUp.Shared/Components/SingleElements/Modal/ModalFormScheda.razor b/SteUp.Shared/Components/SingleElements/Modal/ModalFormScheda.razor
index c722eed..12ef106 100644
--- a/SteUp.Shared/Components/SingleElements/Modal/ModalFormScheda.razor
+++ b/SteUp.Shared/Components/SingleElements/Modal/ModalFormScheda.razor
@@ -20,7 +20,7 @@
-
+
@@ -89,21 +89,24 @@
}
-
-
-
- Aggiungi foto
-
-
+
+ @if (!ReadOnly)
+ {
+
+
+ Aggiungi foto
+
+
+ }