parent
401521723b
commit
4a473fdf43
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue