using MauiAppStock.Models;
using MauiAppStock.Data;

namespace MauiAppStock.Views
{
    public partial class AddAppareilPage : ContentPage
    {
        public AddAppareilPage()
        {
            InitializeComponent();
        }

        private async void OnSaveClicked(object sender, EventArgs e)
        {
            var appareil = new Appareil
            {
                Nom = NomEntry.Text,
                Description = DescriptionEditor.Text
            };
            await Database.AddAppareilAsync(appareil);
            await Navigation.PopAsync();
        }
    }
}