Compare commits
No commits in common. "7f05f4f634ead9e3dd0d6e3ad5ddb8ccf65c167d" and "460b12f066f88e619062e62bd315289378bd2c29" have entirely different histories.
7f05f4f634
...
460b12f066
@ -21,8 +21,5 @@
|
|||||||
<Button Text="Gérer les Réservations"
|
<Button Text="Gérer les Réservations"
|
||||||
Clicked="OnReservationsClicked"
|
Clicked="OnReservationsClicked"
|
||||||
Margin="0,10"/>
|
Margin="0,10"/>
|
||||||
<Button Text="Gérer les départs et arrivées"
|
|
||||||
Clicked="OnGestionDepartClicked"
|
|
||||||
Margin="0,10"/>
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
@ -2,7 +2,6 @@ using HegreHotel.Views;
|
|||||||
using HegreHotel.Views.Chambre;
|
using HegreHotel.Views.Chambre;
|
||||||
using HegreHotel.Views.Client;
|
using HegreHotel.Views.Client;
|
||||||
using HegreHotel.Views.Reservation;
|
using HegreHotel.Views.Reservation;
|
||||||
using HegreHotel.Views.GestionDepart;
|
|
||||||
using Microsoft.Maui.Controls;
|
using Microsoft.Maui.Controls;
|
||||||
|
|
||||||
namespace HegreHotel
|
namespace HegreHotel
|
||||||
@ -28,10 +27,5 @@ namespace HegreHotel
|
|||||||
{
|
{
|
||||||
await Navigation.PushAsync(new ReservationsPage());
|
await Navigation.PushAsync(new ReservationsPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnGestionDepartClicked(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
await Navigation.PushAsync(new GestionDepartPage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,99 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
x:Class="HegreHotel.Views.GestionDepart.GestionDepartPage"
|
|
||||||
Title="Gestion des départs et arrivées"
|
|
||||||
Appearing="GestionPage_OnAppearing">
|
|
||||||
|
|
||||||
<ContentPage.Content>
|
|
||||||
|
|
||||||
<StackLayout>
|
|
||||||
<StackLayout>
|
|
||||||
<StackLayout Padding="20" Orientation="Horizontal">
|
|
||||||
<BoxView HeightRequest="5" Color="MediumPurple"/>
|
|
||||||
<Label Text="Arrivée(s)"
|
|
||||||
FontSize="24"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
HorizontalOptions="Center"/>
|
|
||||||
|
|
||||||
</StackLayout>
|
|
||||||
<ListView x:Name="GestionArriveListView" HasUnevenRows="True">
|
|
||||||
<ListView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<ViewCell>
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="ID chambre :"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="{Binding ChambreId}"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="Nombres de personnes :"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="{Binding NbPersonnes}"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="Date d'arrivée : aujourd'hui"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="100"/>
|
|
||||||
<Label Text="Date de départ :"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="100"/>
|
|
||||||
<Label Text="{Binding DateFin, StringFormat='{0:dd/MM/yyyy}'}"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="100"/>
|
|
||||||
</StackLayout>
|
|
||||||
</ViewCell>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListView.ItemTemplate>
|
|
||||||
</ListView>
|
|
||||||
</StackLayout>
|
|
||||||
|
|
||||||
<StackLayout>
|
|
||||||
<StackLayout Padding="20" Orientation="Horizontal">
|
|
||||||
|
|
||||||
<BoxView HeightRequest="5" Color="MediumPurple"/>
|
|
||||||
<Label Text="Départ(s)"
|
|
||||||
FontSize="24"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
HorizontalOptions="Center" />
|
|
||||||
|
|
||||||
</StackLayout>
|
|
||||||
<ListView x:Name="GestionDepartListView" HasUnevenRows="True">
|
|
||||||
<ListView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<ViewCell>
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="ID chambre :"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="{Binding ChambreId}"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="Nombres de personnes :"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="{Binding NbPersonnes}"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="50"/>
|
|
||||||
<Label Text="Date d'arrivée :"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="100"/>
|
|
||||||
<Label Text="{Binding DateDebut, StringFormat='{0:dd/MM/yyyy}'}"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="100"/>
|
|
||||||
<Label Text="Date de départ : aujourd'hui"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
WidthRequest="100"/>
|
|
||||||
</StackLayout>
|
|
||||||
</ViewCell>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListView.ItemTemplate>
|
|
||||||
</ListView>
|
|
||||||
</StackLayout>
|
|
||||||
|
|
||||||
</StackLayout>
|
|
||||||
</ContentPage.Content>
|
|
||||||
</ContentPage>
|
|
@ -1,56 +0,0 @@
|
|||||||
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<Models.Reservation> ReservationsDeb { get; set; } = new ObservableCollection<Models.Reservation>();
|
|
||||||
public ObservableCollection<Models.Reservation> ReservationsFin { get; set; } = new ObservableCollection<Models.Reservation>();
|
|
||||||
|
|
||||||
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<Models.Reservation>().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();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user