Lot de vues windows

UI_Windows
Raphael LACOTE 2 years ago
parent 401521723b
commit 4a473fdf43

@ -5,19 +5,6 @@
x:Class="IHM.App"> x:Class="IHM.App">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<Style TargetType="Border" x:Key="bordureBlanche">
<Setter Property="StrokeShape" Value="RoundRectangle 40"/>
<Setter Property="BackgroundColor" Value="White"/>
</Style>
<Style TargetType="Entry" x:Key="zoneDeTexte">
<Setter Property="TextColor" Value="Black"/>
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="FontSize" Value="15"/>
</Style>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" /> <ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" /> <ResourceDictionary Source="Resources/Styles/Styles.xaml" />

@ -1,6 +1,8 @@
using IHM.Desktop; using IHM.Desktop;
using IHM.Mobile; using IHM.Mobile;
using Model; using Model;
using ChangePassword = IHM.Desktop.ChangePassword;
using Compte = IHM.Desktop.Compte;
using ForgetPassword = IHM.Desktop.ForgetPassword; using ForgetPassword = IHM.Desktop.ForgetPassword;
namespace IHM namespace IHM
@ -13,6 +15,9 @@ namespace IHM
{ {
InitializeComponent(); InitializeComponent();
Routing.RegisterRoute("ForgetPassword", typeof(ForgetPassword)); Routing.RegisterRoute("ForgetPassword", typeof(ForgetPassword));
Routing.RegisterRoute("ChangePassword", typeof(ChangePassword));
Routing.RegisterRoute("Compte", typeof(Compte));
} }
} }

@ -0,0 +1,35 @@
<?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.ChangePassword"
Title="ChangePassword"
BackgroundColor="{StaticResource Primary}">
<VerticalStackLayout VerticalOptions="CenterAndExpand">
<Label
Text="Changer votre mot de passe"
VerticalOptions="Fill"
HorizontalOptions="Center"
FontSize="20"
Margin="20"/>
<Border Style="{StaticResource bordureBlanche}" Padding="7" Margin="40">
<Entry Style="{StaticResource zoneDeTexte}"
Placeholder="Nouveau mot de passe"
x:Name="EntryNewMdp"
IsPassword="True"/>
</Border>
<Border Style="{StaticResource bordureBlanche}" Padding="7" Margin="40,0,40,40">
<Entry Style="{StaticResource zoneDeTexte}"
Placeholder="Confirmer mot de passe"
x:Name="EntryNewMdpConfirmation"
IsPassword="True"/>
</Border>
<Button VerticalOptions="End"
x:Name="ValidationButton"
Text="valider"
Clicked="ValidationButton_Clicked"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,45 @@
using Model;
namespace IHM.Desktop;
public partial class ChangePassword : ContentPage
{
public Manager Mgr => (App.Current as App).Manager;
private string MailUser;
public ChangePassword(string mailUser)
{
InitializeComponent();
MailUser = mailUser;
}
private void ValidationButton_Clicked(object sender, EventArgs e)
{
if (EntryNewMdp.Text == null || EntryNewMdpConfirmation.Text == null)
{
AffichError("Champ non valide", "Veuillez remplir tout les champs", "OK");
}
else
{
if (!EntryNewMdp.Text.Equals(EntryNewMdpConfirmation.Text))
{
AffichError("mot de passe non identique", "veuillez entrer des mots de passe identique", "OK");
}
else
{
Mgr.changePasswordBdd(MailUser, EntryNewMdp.Text);
AffichError("mdp changé", "mot de passe bien changé", "ok");
NavigateTo("../..");
}
}
}
private async void NavigateTo(string path)
{
await Shell.Current.GoToAsync(path);
}
private async void AffichError(string s, string s1, string s2)
{
await DisplayAlert(s, s1, s2);
}
}

@ -0,0 +1,26 @@
<?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.Compte"
Title="Compte"
BackgroundColor="{StaticResource Yellow100Accent}">
<VerticalStackLayout HorizontalOptions="Center">
<Label
FontAttributes="Bold"
Text="Votre compte"
FontSize="30"/>
<Label
FontAttributes="Bold"
Text="Compte courant --- ???"
FontSize="30"/>
<Button
x:Name="ConnexionButton"
Text="Modifier votre solde"
BackgroundColor="Green"/>
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,9 @@
namespace IHM.Desktop;
public partial class Compte : ContentPage
{
public Compte()
{
InitializeComponent();
}
}

@ -2,9 +2,10 @@
<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.Desktop.ForgetPassword" x:Class="IHM.Desktop.ForgetPassword"
Title="ForgetPassword"> Title="ForgetPassword"
BackgroundColor="{StaticResource Primary}">
<VerticalStackLayout BackgroundColor="{StaticResource Primary}" Margin="20" Padding="30"> <VerticalStackLayout Margin="20" Padding="30" VerticalOptions="CenterAndExpand">
<Label <Label
Text="Rentrez votre adresse email :" Text="Rentrez votre adresse email :"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
@ -21,22 +22,24 @@
Clicked="SearchEmail" Clicked="SearchEmail"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
<VerticalStackLayout x:Name="ValidateReceptCode" IsVisible="false" Margin="20"> <VerticalStackLayout x:Name="ValidateReceptCode" IsVisible="false" Margin="20" VerticalOptions="End">
<Label Text="Veuillez rentrer le code à 6 chiffres reçus par mail" <Label Text="Veuillez rentrer le code à 6 chiffres reçus par mail"
HorizontalOptions="Center"/> HorizontalOptions="Center"/>
<Border Style="{StaticResource bordureBlanche}" Padding="7" Margin="40"> <Border Style="{StaticResource bordureBlanche}" Padding="7" Margin="40" >
<Entry Style="{StaticResource zoneDeTexte}" <Entry Style="{StaticResource zoneDeTexte}"
Placeholder="6 Chiffres" Placeholder="6 Chiffres"
Keyboard="Numeric" Keyboard="Numeric"
x:Name="EntryCodeRecept"/> x:Name="EntryCodeRecept"/>
</Border> </Border>
<Button <Button
x:Name="ValidationButton" x:Name="ValidationButton"
Text="valider" Text="valider"
Clicked="ValideCode" Clicked="ValideCode"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
</VerticalStackLayout> </VerticalStackLayout>
</VerticalStackLayout> </VerticalStackLayout>

@ -63,6 +63,6 @@ public partial class ForgetPassword : ContentPage
public async void NavigateTo() public async void NavigateTo()
{ {
//await Navigation.PushModalAsync(new ForgetPassword(EntryMail.Text)); await Navigation.PushModalAsync(new ChangePassword(EntryMail.Text));
} }
} }

@ -81,6 +81,9 @@
<Compile Update="Desktop\MainPage.xaml.cs"> <Compile Update="Desktop\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon> <DependentUpon>MainPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Desktop\Compte.xaml.cs">
<DependentUpon>Compte.xaml</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -90,6 +93,9 @@
<MauiXaml Update="ChangePassword.xaml"> <MauiXaml Update="ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Desktop\ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\DashBoard.xaml"> <MauiXaml Update="Desktop\DashBoard.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
@ -99,6 +105,9 @@
<MauiXaml Update="Desktop\Inscription.xaml"> <MauiXaml Update="Desktop\Inscription.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Desktop\Compte.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\Operations.xaml"> <MauiXaml Update="Desktop\Operations.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

@ -145,6 +145,20 @@
</Setter> </Setter>
</Style> </Style>
<Style TargetType="Border" x:Key="bordureBlanche">
<Setter Property="StrokeShape" Value="RoundRectangle 40"/>
<Setter Property="BackgroundColor" Value="White"/>
</Style>
<Style TargetType="Entry" x:Key="zoneDeTexte">
<Setter Property="TextColor" Value="Black"/>
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="FontSize" Value="15"/>
</Style>
<Style TargetType="Label"> <Style TargetType="Label">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="FontFamily" Value="OpenSansRegular" /> <Setter Property="FontFamily" Value="OpenSansRegular" />

Loading…
Cancel
Save