Page de login à moitié fonctionelle

pull/9/head
Clement LESME 2 years ago
parent 2a16ff44f8
commit 0d9c263dec

@ -41,7 +41,6 @@
<MauiImage Include="Resources\Images\*" /> <MauiImage Include="Resources\Images\*" />
<MauiImage Include="Resources\Images\Logo\*" /> <MauiImage Include="Resources\Images\Logo\*" />
<MauiImage Include="Resources\Images\Pc\*" /> <MauiImage Include="Resources\Images\Pc\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts --> <!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" /> <MauiFont Include="Resources\Fonts\*" />

@ -29,7 +29,7 @@ namespace CanYouBuildIt.Model
{ {
var donnee = Persi.chargeDonnee(); var donnee = Persi.chargeDonnee();
listUtil.AddRange(donnee.Item1); listUtil.AddRange(donnee.Item1);
listComp.AddRange(donnee.Item2); //listComp.AddRange(donnee.Item2);
} }
public void sauvegardeDonnee() public void sauvegardeDonnee()

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CanYouBuildIt.Views.Acceuil" x:Class="CanYouBuildIt.Views.Acceuil"
Title="Can You Build It" Title="Can You Build It"
BackgroundColor="DarkTurquoise"> BackgroundColor="#26B4BE">
<VerticalStackLayout> <VerticalStackLayout>
@ -118,5 +118,15 @@
</Grid> </Grid>
<Label Text="Vous devez vous connecter pour acceder au favoris."
IsVisible="false"
x:Name="aConnecter"
BackgroundColor="Green"
FontAttributes="Bold"
Padding="30"
Margin="0,30,0,0"
HorizontalOptions="Center"
WidthRequest="500"/>
</VerticalStackLayout> </VerticalStackLayout>
</ContentPage> </ContentPage>

@ -1,26 +1,46 @@
using CanYouBuildIt.Model; using CanYouBuildIt.Model;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection;
namespace CanYouBuildIt.Views; namespace CanYouBuildIt.Views;
public partial class Acceuil : ContentPage public partial class Acceuil : ContentPage
{ {
public Manager manager=> (App.Current as App).manager; public Manager manager=> (App.Current as App).manager;
bool connecte = false;
int user;
public Acceuil() public Acceuil()
{ {
InitializeComponent(); InitializeComponent();
BindingContext = manager; BindingContext = manager;
} }
private void AddUtilisater(object sender, EventArgs e) public Acceuil(int iduser)
{
InitializeComponent();
BindingContext = manager;
connecte = true;
user = iduser;
}
//Ancien test
/*private void AddUtilisater(object sender, EventArgs e)
{ {
Utilisateur utilisateur = new Utilisateur("Util1","pdm1"); Utilisateur utilisateur = new Utilisateur("Util1","pdm1");
Debug.WriteLine("Utilisateur créé"); Debug.WriteLine("Utilisateur créé");
} }*/
private async void NavFav(object sender, EventArgs e) private async void NavFav(object sender, EventArgs e)
{ {
if (connecte)
await Navigation.PushAsync(new Favoris()); await Navigation.PushAsync(new Favoris());
else
{
aConnecter.IsVisible = true;
await Task.Delay(1000);
aConnecter.IsVisible = false;
}
} }
private async void NavCreds(object sender, EventArgs e) private async void NavCreds(object sender, EventArgs e)

@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CanYouBuildIt.Views.Credits" x:Class="CanYouBuildIt.Views.Credits"
Title="Credits" Title="Credits"
BackgroundColor="DarkTurquoise"> BackgroundColor="#26B4BE">
<VerticalStackLayout> <VerticalStackLayout>
<ImageButton Source="logoapp.png" <ImageButton Source="logoapp.png"

@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CanYouBuildIt.Views.Favoris" x:Class="CanYouBuildIt.Views.Favoris"
Title="Favoris" Title="Favoris"
BackgroundColor="DarkTurquoise"> BackgroundColor="#26B4BE">
<VerticalStackLayout> <VerticalStackLayout>
@ -28,6 +28,7 @@
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Frame Grid.Column="0"> <Frame Grid.Column="0">
<Image Source="pc3.png" <Image Source="pc3.png"
HeightRequest="200" HeightRequest="200"
@ -55,8 +56,8 @@
<Image Source="pc3.png" <Image Source="pc3.png"
HeightRequest="200"/> HeightRequest="200"/>
</Frame> </Frame>
</Grid>
</Grid>
<Button <Button
@ -66,8 +67,7 @@
Margin="0,75" Margin="0,75"
Text="Home" Text="Home"
TextColor="Snow" TextColor="Snow"
x:Name="FavToHome" x:Name="FavToHome"/>
/>
</VerticalStackLayout> </VerticalStackLayout>
</ContentPage> </ContentPage>

@ -2,17 +2,16 @@
<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="CanYouBuildIt.Views.Login" x:Class="CanYouBuildIt.Views.Login"
Title="Login"> Title="Login"
BackgroundColor="#26B4BE">
<AbsoluteLayout> <AbsoluteLayout>
<Image Source="fond.jpg"/>
<VerticalStackLayout <VerticalStackLayout
BackgroundColor="#320639" BackgroundColor="#408097"
AbsoluteLayout.LayoutBounds="0.5,0.5,500,700" AbsoluteLayout.LayoutBounds="0.5,0.5,500,700"
AbsoluteLayout.LayoutFlags="PositionProportional"> AbsoluteLayout.LayoutFlags="PositionProportional">
<Image Source="logo.png" <Image Source="logocybi.png"
MaximumWidthRequest="90"
Margin="25,60,25,0"/> Margin="25,60,25,0"/>
<Label Text="Connexion" <Label Text="Connexion"
@ -22,32 +21,32 @@
FontAttributes="Bold" FontAttributes="Bold"
FontSize="30" FontSize="30"
WidthRequest="500"/> WidthRequest="500"/>
<Entry
<Entry BackgroundColor="#EEEEFF"
Margin="25,60,25,0" Margin="25,60,25,0"
x:Name="Nom" x:Name="Nom"
Placeholder="Nom" Placeholder="Nom"
PlaceholderColor="#BF730A" PlaceholderColor="Black"
HeightRequest="20" HeightRequest="20"/>
BackgroundColor="#BDA7C1" />
<Entry <Entry BackgroundColor="#EEEEFF"
Margin="25,60,25,0" Margin="25,60,25,0"
x:Name="Mdp" x:Name="Mdp"
IsPassword="True" IsPassword="True"
Placeholder="Mot de Passe" Placeholder="Mot de Passe"
PlaceholderColor="#BF730A" PlaceholderColor="Black"
HeightRequest="20" HeightRequest="20"/>
BackgroundColor="#BDA7C1"/>
<Entry <Entry BackgroundColor="#EEEEFF"
BackgroundColor="#BDA7C1"
Margin="25,60,25,0" Margin="25,60,25,0"
x:Name="Adresse" x:Name="Adresse"
Placeholder="Mail" Placeholder="Mail"
PlaceholderColor="#BF730A" PlaceholderColor="Black"
HeightRequest="20"/> HeightRequest="20"/>
<HorizontalStackLayout> <HorizontalStackLayout>
<Button <Button BackgroundColor="DimGrey"
BackgroundColor="#882297"
Margin="220,60,0,0" Margin="220,60,0,0"
x:Name="BtnValider" x:Name="BtnValider"
Text="LOGIN" Text="LOGIN"
@ -55,7 +54,9 @@
TextColor="White" TextColor="White"
Clicked="BoutonValider" Clicked="BoutonValider"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
<Button Margin="90,60,0,0"
<Button BackgroundColor="DimGrey"
Margin="90,60,0,0"
x:Name="btn_insc" x:Name="btn_insc"
Text="inscription" Text="inscription"
FontAttributes="Bold" FontAttributes="Bold"
@ -66,7 +67,7 @@
<HorizontalStackLayout> <HorizontalStackLayout>
<Label Text="ERREUR ! les cases Nom et Mot de Passe doivent etre remplie." <Label Text="WARNING ! Les champs Nom et Mot de Passe sont obligatoire."
IsVisible="false" IsVisible="false"
x:Name="error" x:Name="error"
BackgroundColor="Red" BackgroundColor="Red"
@ -76,7 +77,7 @@
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="500"/> WidthRequest="500"/>
<Label Text="ERREUR ! mauvais mdp et nom." <Label Text="Le Nom et/ou le mdp sont erroné."
IsVisible="false" IsVisible="false"
x:Name="wrong" x:Name="wrong"
BackgroundColor="Red" BackgroundColor="Red"
@ -86,7 +87,7 @@
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="500"/> WidthRequest="500"/>
<Label Text="mot de passe et nom VALIDE." <Label Text="Nom et MDP valide."
IsVisible="false" IsVisible="false"
x:Name="valide" x:Name="valide"
BackgroundColor="Green" BackgroundColor="Green"

@ -38,11 +38,11 @@ public partial class Login : ContentPage
valide.IsVisible = true; valide.IsVisible = true;
await Task.Delay(1000); await Task.Delay(1000);
valide.IsVisible = false; valide.IsVisible = false;
//await Navigation.PushAsync(new Accueil(idname)); await Navigation.PushAsync(new Acceuil(idname));
} }
} }
private void btninsc(object sender, EventArgs e) private async void btninsc(object sender, EventArgs e)
{ {
await Navigation.PopAsync(); await Navigation.PopAsync();
} }

Loading…
Cancel
Save