Fusion de la séparation des vues Mobile et Desktop
continuous-integration/drone/push Build is passing Details

modifStub
Hugo LIVET 2 years ago
commit c8a17b0042

@ -10,10 +10,14 @@ namespace IHM
{ {
InitializeComponent(); InitializeComponent();
MainPage = new AppShell(); if(OperatingSystem.IsWindows() || OperatingSystem.IsMacOS())
{
MainPage = new AppShellDesktop();
}
else
{
MainPage = new AppShell();
}
} }
} }

@ -3,7 +3,7 @@
x:Class="IHM.AppShell" x:Class="IHM.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:IHM" xmlns:local="clr-namespace:IHM.Mobile"
Shell.FlyoutBehavior="Disabled" Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="False"> Shell.NavBarIsVisible="False">

@ -1,4 +1,5 @@
using Model; using IHM.Mobile;
using Model;
namespace IHM namespace IHM
{ {
@ -16,6 +17,8 @@ namespace IHM
} }
} }

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="IHM.AppShellDesktop"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:IHM.Desktop"
Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="False">
<ShellContent
ContentTemplate="{DataTemplate local:MainPage}"
Route="Inscription" />
</Shell>

@ -0,0 +1,19 @@
using IHM.Desktop;
using Model;
namespace IHM
{
public partial class AppShellDesktop : Shell
{
public Manager Mgr => (App.Current as App).Manager;
public AppShellDesktop()
{
InitializeComponent();
}
}
}

@ -0,0 +1,90 @@
<?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="IHM.Desktop.MainPage"
Title="MainPage_Windows">
<StackLayout BackgroundColor="{StaticResource Primary}">
<StackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Start"
>
<Label
Margin="0,20,0,30"
HorizontalOptions="Center"
FontAttributes="Bold"
Text="Welcome To Cons'Eco"
FontSize="30"/>
<Image Source="logo_sans_fond.png" HorizontalOptions="Center" HeightRequest="200" />
<Border StrokeShape="RoundRectangle 20" BackgroundColor="White" Padding="7">
<Entry BackgroundColor="{StaticResource White}"
TextColor="{StaticResource Black}"
VerticalTextAlignment="Center"
FontSize="15"
Placeholder="Addresse mail"
x:Name="EntryMail"/>
</Border>
<Border StrokeShape="RoundRectangle 20" BackgroundColor="White" Padding="7">
<Entry BackgroundColor="{StaticResource White}"
TextColor="{StaticResource Black}"
VerticalTextAlignment="Center"
FontSize="15"
Placeholder="Mot de passe"
IsPassword="True"
x:Name="EntryPassworld"/>
</Border>
<Button
x:Name="ConnexionButton"
Text="Se connecter"
Clicked="ConnectionOnClicked"
HorizontalOptions="Center" />
<Label
Text="Mot de passe oublié ?"
TextColor="{StaticResource Yellow100Accent}"
Margin="5,0,0,0"
TextDecorations="Underline"
HorizontalOptions="Center">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}"
CommandParameter="ForgetPassword"/>
</Label.GestureRecognizers>
</Label>
<HorizontalStackLayout HorizontalOptions="Center">
<Label
Text="Pas de compte ?"
/>
<Label
Text="S'inscrire"
TextColor="{StaticResource Yellow100Accent}"
Margin="5,0,0,0"
TextDecorations="Underline">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}"
CommandParameter="Inscription"/>
</Label.GestureRecognizers>
</Label>
</HorizontalStackLayout>
</StackLayout>
</StackLayout>
</ContentPage>

@ -0,0 +1,59 @@
using Model;
using System.Windows.Input;
namespace IHM.Desktop;
public partial class MainPage : ContentPage
{
public Manager Mgr => (App.Current as App).Manager;
public MainPage()
{
InitializeComponent();
BindingContext = this;
}
public void ConnectionOnClicked(object sender, EventArgs e)
{
if (EntryMail.Text == null || EntryPassworld.Text == null)
{
AffichError("Champ invalide", "Veuillez compléter tout les champs", "OK");
}
else
{
if (Mgr.existEmail(EntryMail.Text))
{
if (Mgr.isEqualHash(Mgr.recupMdpBdd(EntryMail.Text), EntryPassworld.Text))
{
Mgr.LoadInscrit(EntryMail.Text, EntryPassworld.Text);
ConnexionValide();
}
else
{
AffichError("Mot de passe non valide", "Le mot de passe ne correspond pas à celui existant pout cette adresse mail", "OK");
}
}
else
{
AffichError("Compte inexistant", "Email ou mot de passe invalide", "OK");
}
}
}
private async void ConnexionValide()
{
await Navigation.PopModalAsync();
}
private async void AffichError(string s, string s1, string s2)
{
await DisplayAlert(s, s1, s2);
}
protected override bool OnBackButtonPressed()
{
return true;
}
//Exception à gérer pour cette version desktop
public ICommand TapCommand => new Command<string>(async (page) => await Shell.Current.GoToAsync(page));
}

@ -32,10 +32,9 @@
<ItemGroup> <ItemGroup>
<!-- App Icon --> <!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\logo.svg" Color="#512BD4" BaseSize="2000,2000"> <MauiIcon Include="Resources\AppIcon\logo.svg" ForegroundFile="Resources\AppIcon\logo.svg" Color="#512BD4" BaseSize="100,100">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiIcon> </MauiIcon>
<MauiImage Include="Resources\Images\DashBoard\account_banks.png" />
<MauiImage Include="Resources\Images\NavBar\dollar_black.png" /> <MauiImage Include="Resources\Images\NavBar\dollar_black.png" />
<MauiImage Include="Resources\Images\NavBar\settings_black.png" /> <MauiImage Include="Resources\Images\NavBar\settings_black.png" />
<Resource Include="Resources\Images\NavBar\home_black.png" /> <Resource Include="Resources\Images\NavBar\home_black.png" />
@ -80,10 +79,19 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="ChangePassword.xaml"> <Compile Update="AppShellDesktop.xaml.cs">
<DependentUpon>AppShellDesktop.xaml</DependentUpon>
</Compile>
<Compile Update="Desktop\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="AppShellDesktop.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="DashBoard.xaml"> <MauiXaml Update="ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="ForgetPassword.xaml"> <MauiXaml Update="ForgetPassword.xaml">
@ -101,6 +109,9 @@
<MauiXaml Update="Inscription.xaml"> <MauiXaml Update="Inscription.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Desktop\MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.ChangePassword" x:Class="IHM.Mobile.ChangePassword"
Title="ChangePassword"> Title="ChangePassword">
<VerticalStackLayout> <VerticalStackLayout>
<Label <Label

@ -1,6 +1,6 @@
using Model; using Model;
namespace IHM; namespace IHM.Mobile;
public partial class ChangePassword : ContentPage public partial class ChangePassword : ContentPage
{ {

@ -0,0 +1,101 @@
<?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="IHM.Mobile.DashBoard">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.15*"/>
<RowDefinition Height="1.40*"/>
<RowDefinition Height="0.15*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<HorizontalStackLayout Grid.Row="0" Grid.Column="0" VerticalOptions="Center">
<Image Source="Resources/Images/logo_sans_fond.png" HeightRequest="50" Margin="20"/>
<Label Text="Cons'Eco" FontSize="20" VerticalOptions="Center" FontAttributes="Bold"/>
</HorizontalStackLayout>
<ImageButton Grid.Row="0" Grid.Column="1" Source="Resources/Images/Dashboard/account_banks.png"
HorizontalOptions="End" Padding="10" Margin="10"
CornerRadius="10" HeightRequest="65"
BackgroundColor="{StaticResource Primary}"/>
<Label Grid.Row="1" Grid.ColumnSpan="2" Text="Liste des Dernières Opérations : " FontAttributes="Bold" FontSize="Body" Padding="20,5,0,0"/>
<CollectionView Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding LesOpe}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Source="{Binding ImageSrc}"
CornerRadius="10"/>
<Label Grid.Row="0" Grid.Column="1"
Text="{Binding NomOpe}"
FontAttributes="Bold" />
<Label Grid.Row="1" Grid.Column="1"
Text="{Binding DetailTypeOpe}"
FontAttributes="Italic"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateOpe}"/>
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2"
Text="{Binding MontantOpe}"
FontAttributes="Bold"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Grid.Row="3" Grid.ColumnSpan="2" Text="Liste des Comptes favoris :" FontAttributes="Bold" FontSize="Body" Padding="20,0,0,0"/>
<CollectionView Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding ComptesFav}" ItemsLayout="HorizontalList">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Text="{Binding Banque}"
FontAttributes="Bold"/>
<Label Grid.Row="0" Grid.Column="1"
Text="{Binding Type}"
FontAttributes="Italic"/>
<Label Grid.Row="1" Grid.Column="1"
Text="{Binding Solde}"
FontAttributes="Bold"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateMaJ}"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>

@ -1,6 +1,6 @@
using Model; using Model;
namespace IHM; namespace IHM.Mobile;
public partial class DashBoard : ContentPage public partial class DashBoard : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.ForgetPassword" x:Class="IHM.Mobile.ForgetPassword"
Title="ForgetPassword"> Title="ForgetPassword">
<VerticalStackLayout <VerticalStackLayout
Margin="20" Margin="20"

@ -1,7 +1,7 @@
using Model; using Model;
using Email = Model.Email; using Email = Model.Email;
namespace IHM; namespace IHM.Mobile;
public partial class ForgetPassword : ContentPage public partial class ForgetPassword : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Inscription" x:Class="IHM.Mobile.Inscription"
Title="Inscription"> Title="Inscription">
<ScrollView> <ScrollView>
<VerticalStackLayout <VerticalStackLayout

@ -1,7 +1,7 @@
using Model; using Model;
using Email = Model.Email; using Email = Model.Email;
namespace IHM; namespace IHM.Mobile;
public partial class Inscription : ContentPage public partial class Inscription : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.MainPage"> x:Class="IHM.Mobile.MainPage">
<ScrollView> <ScrollView>
<VerticalStackLayout <VerticalStackLayout
@ -16,7 +16,7 @@
Text="Welcome To Cons'Eco" Text="Welcome To Cons'Eco"
FontSize="30"/> FontSize="30"/>
<Image Source="{AppThemeBinding Light=Resources/Images/logo_sans_fond_black.png, Dark=Resources/Images/logo_sans_fond.png}" <Image Source="{AppThemeBinding Light=logo_sans_fond_black.png, Dark=logo_sans_fond.png}"
HorizontalOptions="Center" HeightRequest="200"/> HorizontalOptions="Center" HeightRequest="200"/>
<Border StrokeShape="RoundRectangle 20" BackgroundColor="White" Padding="7"> <Border StrokeShape="RoundRectangle 20" BackgroundColor="White" Padding="7">

@ -1,7 +1,7 @@
using Model; using Model;
using System.Windows.Input; using System.Windows.Input;
namespace IHM namespace IHM.Mobile
{ {
public partial class MainPage : ContentPage public partial class MainPage : ContentPage
{ {

@ -1,4 +1,4 @@
namespace IHM; namespace IHM.Mobile;
public partial class Operations : ContentPage public partial class Operations : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Planification"> x:Class="IHM.Mobile.Planification">
<VerticalStackLayout> <VerticalStackLayout>
<Label <Label
Text="Planification" Text="Planification"

@ -1,4 +1,4 @@
namespace IHM; namespace IHM.Mobile;
public partial class Planification : ContentPage public partial class Planification : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Settings"> x:Class="IHM.Mobile.Settings">
<VerticalStackLayout> <VerticalStackLayout>
<Label <Label
Text="Paramètre" Text="Paramètre"

@ -1,4 +1,4 @@
namespace IHM; namespace IHM.Mobile;
using Model; using Model;
public partial class Settings : ContentPage public partial class Settings : ContentPage
{ {

@ -1,11 +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="IHM.Operations">
<VerticalStackLayout>
<Label
Text="Operations"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

@ -11,7 +11,7 @@ namespace Model
public List<Banque> Banques = new(); public List<Banque> Banques = new();
public List<Inscrit> Inscrits = new(); public List<Inscrit> Inscrits = new();
public List<Compte> Comptes = new(); public List<Compte> Comptes = new();
//
// ajouter load all pour tout les inscrits // ajouter load all pour tout les inscrits

Loading…
Cancel
Save