diff --git a/Views/GestionDepart/GestionDepartPage.xaml b/Views/GestionDepart/GestionDepartPage.xaml
index dd43ff7..a16a286 100644
--- a/Views/GestionDepart/GestionDepartPage.xaml
+++ b/Views/GestionDepart/GestionDepartPage.xaml
@@ -8,8 +8,40 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -44,38 +76,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Views/GestionDepart/GestionDepartPage.xaml.cs b/Views/GestionDepart/GestionDepartPage.xaml.cs
index 6e1351a..78d9697 100644
--- a/Views/GestionDepart/GestionDepartPage.xaml.cs
+++ b/Views/GestionDepart/GestionDepartPage.xaml.cs
@@ -14,7 +14,9 @@ namespace HegreHotel.Views.GestionDepart;
public partial class GestionDepartPage : ContentPage
{
- public ObservableCollection Reservations { get; set; } = new ObservableCollection();
+ public ObservableCollection ReservationsDeb { get; set; } = new ObservableCollection();
+ public ObservableCollection ReservationsFin { get; set; } = new ObservableCollection();
+
public GestionDepartPage()
{
InitializeComponent();
@@ -26,14 +28,25 @@ public partial class GestionDepartPage : ContentPage
string dbPath = Path.Combine(FileSystem.AppDataDirectory, "HegreHotel.db3");
var db = SingletonConnection.GetInstance(dbPath);
var reservationList = await db.Table().ToListAsync();
- Reservations.Clear();
+ ReservationsDeb.Clear();
+ ReservationsFin.Clear();
foreach (var reservation in reservationList)
{
- Reservations.Add(reservation);
+ if (reservation.DateDebut == DateTime.Now.Date)
+ {
+ ReservationsDeb.Add(reservation);
+ } else if (reservation.DateFin == DateTime.Now.Date)
+ {
+ ReservationsFin.Add(reservation);
+ }
+
}
- GestionDepartListView.ItemsSource = Reservations;
- GestionArriveListView.ItemsSource = Reservations;
+
+ GestionArriveListView.ItemsSource = ReservationsDeb;
+
+ GestionDepartListView.ItemsSource = ReservationsFin;
+
}
private void GestionPage_OnAppearing(object? sender, EventArgs e)