Lot de vues windows

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

@ -5,19 +5,6 @@
x:Class="IHM.App">
<Application.Resources>
<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 Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />

@ -1,6 +1,8 @@
using IHM.Desktop;
using IHM.Mobile;
using Model;
using ChangePassword = IHM.Desktop.ChangePassword;
using Compte = IHM.Desktop.Compte;
using ForgetPassword = IHM.Desktop.ForgetPassword;
namespace IHM
@ -13,6 +15,9 @@ namespace IHM
{
InitializeComponent();
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"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
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
Text="Rentrez votre adresse email :"
HorizontalOptions="Center" />
@ -21,7 +22,7 @@
Clicked="SearchEmail"
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"
HorizontalOptions="Center"/>
@ -32,11 +33,13 @@
Keyboard="Numeric"
x:Name="EntryCodeRecept"/>
</Border>
<Button
x:Name="ValidationButton"
Text="valider"
Clicked="ValideCode"
HorizontalOptions="Center" />
</VerticalStackLayout>
</VerticalStackLayout>

@ -63,6 +63,6 @@ public partial class ForgetPassword : ContentPage
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">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Update="Desktop\Compte.xaml.cs">
<DependentUpon>Compte.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@ -90,6 +93,9 @@
<MauiXaml Update="ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\DashBoard.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
@ -99,6 +105,9 @@
<MauiXaml Update="Desktop\Inscription.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\Compte.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\Operations.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -145,6 +145,20 @@
</Setter>
</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">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />

Loading…
Cancel
Save