diff --git a/MainPage.xaml b/MainPage.xaml
index 9e50782..8c00611 100644
--- a/MainPage.xaml
+++ b/MainPage.xaml
@@ -21,5 +21,8 @@
+
diff --git a/MainPage.xaml.cs b/MainPage.xaml.cs
index 7d78e2f..c7c4233 100644
--- a/MainPage.xaml.cs
+++ b/MainPage.xaml.cs
@@ -2,6 +2,7 @@ using HegreHotel.Views;
using HegreHotel.Views.Chambre;
using HegreHotel.Views.Client;
using HegreHotel.Views.Reservation;
+using HegreHotel.Views.GestionDepart;
using Microsoft.Maui.Controls;
namespace HegreHotel
@@ -27,5 +28,10 @@ namespace HegreHotel
{
await Navigation.PushAsync(new ReservationsPage());
}
+
+ private async void OnGestionDepartClicked(object sender, EventArgs e)
+ {
+ await Navigation.PushAsync(new GestionDepartPage());
+ }
}
}
\ No newline at end of file
diff --git a/Views/GestionDepart/GestionDepartPage.xaml b/Views/GestionDepart/GestionDepartPage.xaml
new file mode 100644
index 0000000..172f79b
--- /dev/null
+++ b/Views/GestionDepart/GestionDepartPage.xaml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Views/GestionDepart/GestionDepartPage.xaml.cs b/Views/GestionDepart/GestionDepartPage.xaml.cs
new file mode 100644
index 0000000..78d9697
--- /dev/null
+++ b/Views/GestionDepart/GestionDepartPage.xaml.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using HegreHotel.Models;
+using Microsoft.Maui.Controls;
+using System.Collections.ObjectModel;
+using System.IO;
+using Microsoft.Maui.Storage;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HegreHotel.Views.GestionDepart;
+
+public partial class GestionDepartPage : ContentPage
+{
+ public ObservableCollection ReservationsDeb { get; set; } = new ObservableCollection();
+ public ObservableCollection ReservationsFin { get; set; } = new ObservableCollection();
+
+ public GestionDepartPage()
+ {
+ InitializeComponent();
+ LoadReservations();
+ }
+
+ private async void LoadReservations()
+ {
+ string dbPath = Path.Combine(FileSystem.AppDataDirectory, "HegreHotel.db3");
+ var db = SingletonConnection.GetInstance(dbPath);
+ var reservationList = await db.Table().ToListAsync();
+ ReservationsDeb.Clear();
+ ReservationsFin.Clear();
+ foreach (var reservation in reservationList)
+ {
+ if (reservation.DateDebut == DateTime.Now.Date)
+ {
+ ReservationsDeb.Add(reservation);
+ } else if (reservation.DateFin == DateTime.Now.Date)
+ {
+ ReservationsFin.Add(reservation);
+ }
+
+ }
+
+
+ GestionArriveListView.ItemsSource = ReservationsDeb;
+
+ GestionDepartListView.ItemsSource = ReservationsFin;
+
+ }
+
+ private void GestionPage_OnAppearing(object? sender, EventArgs e)
+ {
+ LoadReservations();
+ }
+}
\ No newline at end of file