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\Logo\*" />
<MauiImage Include="Resources\Images\Pc\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

@ -29,7 +29,7 @@ namespace CanYouBuildIt.Model
{
var donnee = Persi.chargeDonnee();
listUtil.AddRange(donnee.Item1);
listComp.AddRange(donnee.Item2);
//listComp.AddRange(donnee.Item2);
}
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"
x:Class="CanYouBuildIt.Views.Acceuil"
Title="Can You Build It"
BackgroundColor="DarkTurquoise">
BackgroundColor="#26B4BE">
<VerticalStackLayout>
@ -118,5 +118,15 @@
</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>
</ContentPage>

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

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

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

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

@ -38,11 +38,11 @@ public partial class Login : ContentPage
valide.IsVisible = true;
await Task.Delay(1000);
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();
}

Loading…
Cancel
Save