Merge branch 'test_du_prof'

dictionnaire
Vianney JOURDY 2 years ago
commit e5df8741c2

@ -1,9 +1,12 @@
using MangaMap.Views; using MangaMap.Model;
using MangaMap.Views;
namespace MangaMap; namespace MangaMap;
public partial class App : Application public partial class App : Application
{ {
public Manager MyManager { get; private set; } = new Manager();
public App() public App()
{ {
InitializeComponent(); InitializeComponent();

@ -7,6 +7,7 @@
<ImageButton Source="logo.png" <ImageButton Source="logo.png"
MaximumHeightRequest="30" MaximumHeightRequest="30"
MaximumWidthRequest="30" MaximumWidthRequest="30"
VerticalOptions="Center"/> VerticalOptions="Center"
Clicked="ImageButton_Clicked"/>
</Grid> </Grid>
</ContentView> </ContentView>

@ -1,9 +1,15 @@
namespace MangaMap; using MangaMap.Views;
namespace MangaMap;
public partial class NewContent1 : ContentView
{ public partial class NewContent1 : ContentView
public NewContent1() {
{ public NewContent1()
InitializeComponent(); {
} InitializeComponent();
}
void ImageButton_Clicked(System.Object sender, System.EventArgs e)
{
Navigation.PushAsync(new homePage());
}
} }

@ -1,24 +1,27 @@
using MangaMap.Views; using MangaMap.Views;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MangaMap.Model namespace MangaMap.Model
{ {
public class Admin : Personne public class Admin : Personne
{ {
public Admin(string mdp, string email, string pseudo) : base(mdp, email, pseudo) public Admin(string motDePasse, string email, string pseudo)
{ {
MotDePasse = motDePasse;
Email = email;
Pseudo = pseudo;
} }
public int Id { get; private set; } public int Id { get; private set; }
public void ajouterAnime() { } public void ajouterAnime() { }
public void supprimerAnime() { } public void supprimerAnime() { }
} }
} }

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MangaMap.Model
{
public class Manager
{
public List<Admin> Admins { get; private set; }
public List<Utilisateur> Utilisateurs { get; private set; }
public List<Oeuvre> Oeuvres { get; private set; }
public Manager() {
Admins = new List<Admin>();
Utilisateurs = new List<Utilisateur>();
Oeuvres = new List<Oeuvre>();
}
public void ajouterUtilisateur(Utilisateur u)
{
Utilisateurs.Add(u);
}
}
}

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace MangaMap.Model namespace MangaMap.Model
{ {
class Oeuvre public class Oeuvre
{ {
public string Nom { get; private set; } public string Nom { get; private set; }
public List <string> Genre { get; private set; } public List <string> Genre { get; private set; }

@ -8,18 +8,9 @@ namespace MangaMap.Model
{ {
public class Personne public class Personne
{ {
public string MotDePasse { get; private set; } public string MotDePasse { get; set; }
public string Email { get; private set; } public string Email { get; set; }
public string Pseudo { get; private set; } public string Pseudo { get; set; }
/*public Liste[] Listes { get; private set; }*/
public Personne(string mdp, string email, string pseudo)
{
Email = email;
Pseudo = pseudo;
MotDePasse = mdp;
}
public bool MofifierMotDePasse(string MotDePasse) public bool MofifierMotDePasse(string MotDePasse)
{ {
@ -62,9 +53,5 @@ namespace MangaMap.Model
return false; return false;
} }
} }
} }

@ -6,14 +6,21 @@ using System.Threading.Tasks;
namespace MangaMap.Model namespace MangaMap.Model
{ {
public class Utilisateur public class Utilisateur : Personne
{ {
public string nom { get; private set; } public string nom { get; private set; }
public string prenom { get; private set; } public string prenom { get; private set; }
public int age { get; private set; } public int age { get; private set; }
public List<Oeuvre> ListeOeuvreEnVisionnage { get; private set; }
public List<Oeuvre> ListeOeuvreDejaVu { get; private set; }
public List<Oeuvre> ListeOeuvrePourPlusTard { get; private set; }
public List<Oeuvre> ListeOeuvreFavorites { get; private set; }
public Utilisateur(string nom, string prenom, int age) public Utilisateur(string email, string pseudo, string mdp, string nom, string prenom, int age)
{ {
Email = email;
Pseudo = pseudo;
MotDePasse = mdp;
this.nom = nom; this.nom = nom;
this.prenom = prenom; this.prenom = prenom;
this.age = age; this.age = age;

@ -10,6 +10,12 @@
<Label Text="S'inscrire a MapManga" FontSize="Large" Margin="0,0,0,20" TextColor="#ffffff"/> <Label Text="S'inscrire a MapManga" FontSize="Large" Margin="0,0,0,20" TextColor="#ffffff"/>
<Entry x:Name="nameEntry" Placeholder="Nom" Margin="0,0,0,10" Background="#EFF0F2" TextColor="{StaticResource Black}"/>
<Entry x:Name="firstNameEntry" Placeholder="Prénom" Margin="0,0,0,10" Background="#EFF0F2" TextColor="{StaticResource Black}"/>
<Entry x:Name="ageEntry" Placeholder="Âge" Margin="0,0,0,10" Background="#EFF0F2" TextColor="{StaticResource Black}"/>
<Entry x:Name="emailEntry" Placeholder="Email" Margin="0,0,0,10" BackgroundColor="#EFF0F2" TextColor="{StaticResource Black}"/> <Entry x:Name="emailEntry" Placeholder="Email" Margin="0,0,0,10" BackgroundColor="#EFF0F2" TextColor="{StaticResource Black}"/>
<Entry x:Name="usernameEntry" Placeholder="Nom d'utilisateur" Margin="0,0,0,10" BackgroundColor="#EFF0F2" TextColor="{StaticResource Black}"/> <Entry x:Name="usernameEntry" Placeholder="Nom d'utilisateur" Margin="0,0,0,10" BackgroundColor="#EFF0F2" TextColor="{StaticResource Black}"/>

@ -1,8 +1,13 @@
namespace MangaMap.Views; namespace MangaMap.Views;
using MangaMap.Model;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
public partial class signUpPage : ContentPage public partial class signUpPage : ContentPage
{ {
public Manager my_manager => (App.Current as App).MyManager;
public signUpPage() public signUpPage()
{ {
InitializeComponent(); InitializeComponent();
@ -11,7 +16,11 @@ public partial class signUpPage : ContentPage
async void OnSignUpClicked(object sender, System.EventArgs e) async void OnSignUpClicked(object sender, System.EventArgs e)
{ {
// Récupérer les valeurs des entrées // Récupérer les valeurs des entrées
string nom = nameEntry.Text;
string prénom = firstNameEntry.Text;
int age = Convert.ToInt32(ageEntry.Text);
string email = emailEntry.Text; string email = emailEntry.Text;
string pseudo = usernameEntry.Text;
string password = passwordEntry.Text; string password = passwordEntry.Text;
string confirmPassword = confirmPasswordEntry.Text; string confirmPassword = confirmPasswordEntry.Text;
@ -47,6 +56,9 @@ public partial class signUpPage : ContentPage
await Navigation.PushAsync(new homePage()); await Navigation.PushAsync(new homePage());
} }
Utilisateur util = new Utilisateur(email, pseudo, password, nom, prénom, age);
my_manager.ajouterUtilisateur(util);
} }
bool IsPasswordStrong(string password) bool IsPasswordStrong(string password)

Loading…
Cancel
Save