Merge branch 'UI_Windows' of https://codefirst.iut.uca.fr/git/ConsEcoTeam/ConsEco into UI_Windows
continuous-integration/drone/push Build is passing Details

UI_Windows
Nicolas MAYE 2 years ago
commit e104f4a49a

@ -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" />

@ -8,7 +8,7 @@
Shell.NavBarIsVisible="False">
<ShellContent
ContentTemplate="{DataTemplate local:MainPage}"
ContentTemplate="{DataTemplate local:Compte}"
Route="Inscription" />
</Shell>

@ -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);
}
}

@ -2,11 +2,29 @@
<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">
<VerticalStackLayout>
Title="Compte"
BackgroundColor="{StaticResource Yellow300Accent}">
<StackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
FontAttributes="Bold"
Text="Votre compte"
VerticalOptions="Start"
FontSize="30"/>
<Label
FontAttributes="Bold"
Text="Compte courant --- ???"
VerticalOptions="Center"
FontSize="30"/>
<Button
x:Name="ConnexionButton"
Text="Modifier votre solde"
VerticalOptions="End"
BackgroundColor="Brown"/>
</StackLayout>
</ContentPage>

@ -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,22 +22,24 @@
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"/>
<Border Style="{StaticResource bordureBlanche}" Padding="7" Margin="40">
<Border Style="{StaticResource bordureBlanche}" Padding="7" Margin="40" >
<Entry Style="{StaticResource zoneDeTexte}"
Placeholder="6 Chiffres"
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,7 +93,7 @@
<MauiXaml Update="ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\Compte.xaml">
<MauiXaml Update="Desktop\ChangePassword.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\DashBoard.xaml">
@ -105,6 +108,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