merge fournisseur et mouvementStock
This commit is contained in:
parent
d7c6a992c6
commit
a6913a5400
@ -9,7 +9,7 @@ public partial class App : Application
|
||||
{
|
||||
InitializeComponent();
|
||||
// On démarre sur MainPage dans une NavigationPage pour permettre la navigation
|
||||
MainPage = new AppShell();
|
||||
MainPage = new NavigationPage(new MainPage());
|
||||
InitializeDatabase();
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,5 @@
|
||||
xmlns:views="clr-namespace:MauiAppStock.Views"
|
||||
Shell.FlyoutBehavior="Disabled"
|
||||
Title="MauiAppStock">
|
||||
|
||||
<Tab>
|
||||
<ShellContent Title="Acceuil" ContentTemplate="{DataTemplate views:MainPage}" />
|
||||
<ShellContent Title="Appareils" ContentTemplate="{DataTemplate views:AppareilsPage}"/>
|
||||
<ShellContent Title="Pièces" ContentTemplate="{DataTemplate views:PiecesPage}"/>
|
||||
<ShellContent Title="Association" ContentTemplate="{DataTemplate views:SelectAppareilForAssociationPage}"/>
|
||||
</Tab>
|
||||
|
||||
|
||||
</Shell>
|
||||
|
@ -7,10 +7,7 @@ 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)
|
||||
{
|
||||
|
@ -95,6 +95,35 @@ namespace MauiAppStock.Data
|
||||
return db.InsertAsync(appareilPiece);
|
||||
}
|
||||
|
||||
// CRUD pour MouvementStock
|
||||
public static Task<int> AddMouvementStockAsync(MouvementStock mouvement)
|
||||
{
|
||||
return db.InsertAsync(mouvement);
|
||||
}
|
||||
|
||||
public static Task<List<MouvementStock>> GetMouvementsStockAsync()
|
||||
{
|
||||
return db.Table<MouvementStock>().OrderByDescending(m => m.DateMouvement).ToListAsync();
|
||||
}
|
||||
|
||||
public static async Task<List<MouvementStock>> GetMouvementsStockForPieceAsync(int pieceId)
|
||||
{
|
||||
return await db.Table<MouvementStock>()
|
||||
.Where(m => m.PieceId == pieceId)
|
||||
.OrderByDescending(m => m.DateMouvement)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public static Task<int> UpdateMouvementStockAsync(MouvementStock mouvement)
|
||||
{
|
||||
return db.UpdateAsync(mouvement);
|
||||
}
|
||||
|
||||
public static Task<int> DeleteMouvementStockAsync(MouvementStock mouvement)
|
||||
{
|
||||
return db.DeleteAsync(mouvement);
|
||||
}
|
||||
|
||||
// Met à jour une association existante
|
||||
public static Task<int> UpdateAppareilPieceAsync(AppareilPiece appareilPiece)
|
||||
{
|
||||
|
@ -8,6 +8,7 @@
|
||||
<Button Text="Gestion des Pièces" BackgroundColor="Black" Clicked="OnPiecesClicked" />
|
||||
<Button Text="Gestion des Fournisseurs" BackgroundColor="Black" Clicked="OnFournisseursClicked" />
|
||||
<Button Text="Associer une Pièce à un Appareil" BackgroundColor="Black" Clicked="OnAssocierPieceClicked" />
|
||||
<Button Text="Mouvement de stock" BackgroundColor="Black" Clicked="OnMouvementStockClicked" />
|
||||
<VerticalStackLayout Padding="20" Spacing="20">
|
||||
<Image Source="logo.png"
|
||||
HeightRequest="200"
|
||||
|
@ -25,7 +25,6 @@ namespace MauiAppStock.Views
|
||||
await Navigation.PushAsync(new FournisseursPage());
|
||||
}
|
||||
|
||||
|
||||
private async void OnAssocierPieceClicked(object sender, EventArgs e)
|
||||
{
|
||||
// On navigue vers une page qui permet de sélectionner un appareil pour ensuite associer une pièce.
|
||||
|
Loading…
x
Reference in New Issue
Block a user