From 0afc6f6a5d6f3e71a126bd53cf1e23d62dbd1a6b Mon Sep 17 00:00:00 2001 From: brunetg Date: Sat, 10 May 2025 01:14:37 +0200 Subject: [PATCH] revert a6913a5400bf5e54e6552927186b6c31f0529efb revert merge fournisseur et mouvementStock --- MauiAppStock/App.xaml.cs | 2 +- MauiAppStock/AppShell.xaml | 9 ++++++++- MauiAppStock/AppShell.xaml.cs | 5 ++++- MauiAppStock/Data/Database.cs | 29 ----------------------------- MauiAppStock/Views/MainPage.xaml | 1 - MauiAppStock/Views/MainPage.xaml.cs | 1 + 6 files changed, 14 insertions(+), 33 deletions(-) diff --git a/MauiAppStock/App.xaml.cs b/MauiAppStock/App.xaml.cs index 7bb788a..f709f05 100644 --- a/MauiAppStock/App.xaml.cs +++ b/MauiAppStock/App.xaml.cs @@ -9,7 +9,7 @@ public partial class App : Application { InitializeComponent(); // On démarre sur MainPage dans une NavigationPage pour permettre la navigation - MainPage = new NavigationPage(new MainPage()); + MainPage = new AppShell(); InitializeDatabase(); } diff --git a/MauiAppStock/AppShell.xaml b/MauiAppStock/AppShell.xaml index 260140d..16d2bb4 100644 --- a/MauiAppStock/AppShell.xaml +++ b/MauiAppStock/AppShell.xaml @@ -6,5 +6,12 @@ xmlns:views="clr-namespace:MauiAppStock.Views" Shell.FlyoutBehavior="Disabled" Title="MauiAppStock"> - + + + + + + + + diff --git a/MauiAppStock/AppShell.xaml.cs b/MauiAppStock/AppShell.xaml.cs index 3729ae9..e0da968 100644 --- a/MauiAppStock/AppShell.xaml.cs +++ b/MauiAppStock/AppShell.xaml.cs @@ -7,7 +7,10 @@ public partial class AppShell : Shell public AppShell() { InitializeComponent(); - + Routing.RegisterRoute(nameof(MainPage), typeof(MainPage)); + Routing.RegisterRoute(nameof(AppareilsPage), typeof(AppareilsPage)); + Routing.RegisterRoute(nameof(PiecesPage), typeof(PiecesPage)); + Routing.RegisterRoute(nameof(SelectAppareilForAssociationPage), typeof(SelectAppareilForAssociationPage)); } protected override void OnNavigating(ShellNavigatingEventArgs args) { diff --git a/MauiAppStock/Data/Database.cs b/MauiAppStock/Data/Database.cs index 4330285..dbfae7f 100644 --- a/MauiAppStock/Data/Database.cs +++ b/MauiAppStock/Data/Database.cs @@ -95,35 +95,6 @@ namespace MauiAppStock.Data return db.InsertAsync(appareilPiece); } - // CRUD pour MouvementStock - public static Task AddMouvementStockAsync(MouvementStock mouvement) - { - return db.InsertAsync(mouvement); - } - - public static Task> GetMouvementsStockAsync() - { - return db.Table().OrderByDescending(m => m.DateMouvement).ToListAsync(); - } - - public static async Task> GetMouvementsStockForPieceAsync(int pieceId) - { - return await db.Table() - .Where(m => m.PieceId == pieceId) - .OrderByDescending(m => m.DateMouvement) - .ToListAsync(); - } - - public static Task UpdateMouvementStockAsync(MouvementStock mouvement) - { - return db.UpdateAsync(mouvement); - } - - public static Task DeleteMouvementStockAsync(MouvementStock mouvement) - { - return db.DeleteAsync(mouvement); - } - // Met à jour une association existante public static Task UpdateAppareilPieceAsync(AppareilPiece appareilPiece) { diff --git a/MauiAppStock/Views/MainPage.xaml b/MauiAppStock/Views/MainPage.xaml index ae39711..2f892d9 100644 --- a/MauiAppStock/Views/MainPage.xaml +++ b/MauiAppStock/Views/MainPage.xaml @@ -8,7 +8,6 @@