diff --git a/SteUp.Data/Migrations/20260916111422_AddBozzaScheda.Designer.cs b/SteUp.Data/Migrations/20260916111422_AddBozzaScheda.Designer.cs
new file mode 100644
index 0000000..3b4ea07
--- /dev/null
+++ b/SteUp.Data/Migrations/20260916111422_AddBozzaScheda.Designer.cs
@@ -0,0 +1,157 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using SteUp.Data.LocalDb;
+
+#nullable disable
+
+namespace SteUp.Data.Migrations
+{
+ [DbContext(typeof(AppDbContext))]
+ [Migration("20260916111422_AddBozzaScheda")]
+ partial class AddBozzaScheda
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "10.0.7");
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.Ispezione", b =>
+ {
+ b.Property("CodMdep")
+ .HasColumnType("TEXT");
+
+ b.Property("Data")
+ .HasColumnType("TEXT");
+
+ b.Property("Rilevatore")
+ .HasColumnType("TEXT");
+
+ b.Property("ActivityId")
+ .HasColumnType("TEXT");
+
+ b.Property("Stato")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("CodMdep", "Data", "Rilevatore");
+
+ b.ToTable("Ispezioni");
+ });
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.Scheda", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ActivityId")
+ .HasColumnType("TEXT");
+
+ b.Property("ActivityTypeId")
+ .HasColumnType("TEXT");
+
+ b.Property("Bozza")
+ .HasColumnType("INTEGER");
+
+ b.Property("CodJfas")
+ .HasColumnType("TEXT");
+
+ b.Property("CodMdep")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Data")
+ .HasColumnType("TEXT");
+
+ b.Property("DescrizioneReparto")
+ .HasColumnType("TEXT");
+
+ b.Property("ImageNames")
+ .HasColumnType("TEXT");
+
+ b.Property("Note")
+ .HasColumnType("TEXT");
+
+ b.Property("Responsabile")
+ .HasColumnType("TEXT");
+
+ b.Property("Rilevatore")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Scadenza")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CodMdep", "Data", "Rilevatore");
+
+ b.ToTable("Schede");
+ });
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.SchedaArticolo", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Barcode")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("Descrizione")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("SchedaId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("SchedaId", "Barcode")
+ .IsUnique();
+
+ b.ToTable("SchedaArticoli");
+ });
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.Scheda", b =>
+ {
+ b.HasOne("SteUp.Shared.Core.Entities.Ispezione", "Ispezione")
+ .WithMany("Schede")
+ .HasForeignKey("CodMdep", "Data", "Rilevatore")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Ispezione");
+ });
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.SchedaArticolo", b =>
+ {
+ b.HasOne("SteUp.Shared.Core.Entities.Scheda", "Scheda")
+ .WithMany("Articoli")
+ .HasForeignKey("SchedaId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scheda");
+ });
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.Ispezione", b =>
+ {
+ b.Navigation("Schede");
+ });
+
+ modelBuilder.Entity("SteUp.Shared.Core.Entities.Scheda", b =>
+ {
+ b.Navigation("Articoli");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/SteUp.Data/Migrations/20260916111422_AddBozzaScheda.cs b/SteUp.Data/Migrations/20260916111422_AddBozzaScheda.cs
new file mode 100644
index 0000000..5fda41e
--- /dev/null
+++ b/SteUp.Data/Migrations/20260916111422_AddBozzaScheda.cs
@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace SteUp.Data.Migrations
+{
+ ///
+ public partial class AddBozzaScheda : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "Bozza",
+ table: "Schede",
+ type: "INTEGER",
+ nullable: false,
+ defaultValue: false);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "Bozza",
+ table: "Schede");
+ }
+ }
+}
diff --git a/SteUp.Data/Migrations/AppDbContextModelSnapshot.cs b/SteUp.Data/Migrations/AppDbContextModelSnapshot.cs
index 21aa4ae..f268281 100644
--- a/SteUp.Data/Migrations/AppDbContextModelSnapshot.cs
+++ b/SteUp.Data/Migrations/AppDbContextModelSnapshot.cs
@@ -15,7 +15,7 @@ namespace SteUp.Data.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder.HasAnnotation("ProductVersion", "10.0.3");
+ modelBuilder.HasAnnotation("ProductVersion", "10.0.7");
modelBuilder.Entity("SteUp.Shared.Core.Entities.Ispezione", b =>
{
@@ -51,6 +51,9 @@ namespace SteUp.Data.Migrations
b.Property("ActivityTypeId")
.HasColumnType("TEXT");
+ b.Property("Bozza")
+ .HasColumnType("INTEGER");
+
b.Property("CodJfas")
.HasColumnType("TEXT");
diff --git a/SteUp.Maui/Core/CoreModule.cs b/SteUp.Maui/Core/CoreModule.cs
index 139ee4d..ab9cf4f 100644
--- a/SteUp.Maui/Core/CoreModule.cs
+++ b/SteUp.Maui/Core/CoreModule.cs
@@ -20,6 +20,7 @@ using SteUp.Shared.Core.Interface.System.Network;
using SteUp.Shared.Core.Messages.Ispezione;
using SteUp.Shared.Core.Messages.Scanner;
using SteUp.Shared.Core.Messages.Scheda;
+using SteUp.Shared.Core.Messages.System;
using SteUp.Shared.Core.Services;
namespace SteUp.Maui.Core;
@@ -65,6 +66,7 @@ public static class CoreModule
builder.Services.AddSingleton();
builder.Services.AddSingleton();
builder.Services.AddSingleton();
+ builder.Services.AddSingleton();
}
public void RegisterDbServices()
diff --git a/SteUp.Maui/Platforms/Android/MainActivity.cs b/SteUp.Maui/Platforms/Android/MainActivity.cs
index 9d5aaa8..3d1cafb 100644
--- a/SteUp.Maui/Platforms/Android/MainActivity.cs
+++ b/SteUp.Maui/Platforms/Android/MainActivity.cs
@@ -3,6 +3,8 @@ using Android.Content.PM;
using Android.OS;
using Android.Views;
using AndroidX.Core.View;
+using Microsoft.Extensions.DependencyInjection;
+using SteUp.Shared.Core.Messages.System;
namespace SteUp.Maui
{
@@ -25,6 +27,16 @@ namespace SteUp.Maui
ViewCompat.SetOnApplyWindowInsetsListener(content, new ImeInsetsListener());
}
+ public override void OnBackPressed()
+ {
+ // Se la UI Blazor ha un form aperto se ne occupa lei (propone il salvataggio
+ // come bozza); altrimenti comportamento standard.
+ var backButton = IPlatformApplication.Current?.Services.GetService();
+ if (backButton?.TryHandleBackPressed() == true) return;
+
+ base.OnBackPressed();
+ }
+
private sealed class ImeInsetsListener : Java.Lang.Object, IOnApplyWindowInsetsListener
{
public WindowInsetsCompat OnApplyWindowInsets(Android.Views.View? v, WindowInsetsCompat? insets)
diff --git a/SteUp.Shared/Components/Pages/IspezionePage.razor b/SteUp.Shared/Components/Pages/IspezionePage.razor
index d8b7f0e..0c8c211 100644
--- a/SteUp.Shared/Components/Pages/IspezionePage.razor
+++ b/SteUp.Shared/Components/Pages/IspezionePage.razor
@@ -40,6 +40,7 @@
@{
var daInviare = group.Value.CountDaInviare();
+ var daCompletare = group.Value.CountBozze();
}