Liam MONCHANIN 2 years ago
parent 2f0035dabe
commit 56fda17342

@ -0,0 +1,12 @@
[![Build Status](https://codefirst.iut.uca.fr/api/badges/matheo.thierry/notus/status.svg)](https://codefirst.iut.uca.fr/matheo.thierry/notus)
[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=alert_status&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo)
[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=coverage&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo)
[![Lines of Code](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=ncloc&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo)
# SAE 2.01 - Développement d'une application
## Présentation
Dans le cadre de la SAE, notre mission consiste à développer une application de prise de notes. Cette application sera un outil pratique pour les personnes qui cherchent à organiser leurs idées et leurs pensées.
Notre application sera facile à utiliser et intuitive, avec une interface simple et épurée qui permettra à l'utilisateur de s'orienter facilement. Elle permettra de partager les notes avec d'autres utilisateurs et de les gérer avec des tags. Lapplication sera personnalisable grâce à la possibilité de choisir parmi plusieurs thèmes et logos fournis. Les utilisateurs pourront également créer leurs propres thèmes.

@ -6,4 +6,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="NHibernate" Version="5.4.2" />
</ItemGroup>
</Project> </Project>

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.Design; using System.ComponentModel.Design;
using System.Data;
using System.Linq; using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
@ -9,7 +10,7 @@ using System.Threading.Tasks;
namespace Biblioteque_de_Class namespace Biblioteque_de_Class
{ {
[DataContract] [DataContract(IsReference = true)]
public class Database public class Database
{ {
[DataMember] [DataMember]
@ -18,17 +19,24 @@ namespace Biblioteque_de_Class
private List<Theme> ThemeList; private List<Theme> ThemeList;
[DataMember] [DataMember]
private List<User> UserList; private List<User> UserList;
[DataMember]
private Dictionary<User, List<Theme>> AddedThemeList;
public Database() public Database()
{ {
DefaultLogoList = new List<Logo>(); DefaultLogoList = new List<Logo>();
ThemeList = new List<Theme>(); ThemeList = new List<Theme>();
UserList = new List<User>(); UserList = new List<User>();
AddedThemeList = new Dictionary<User, List<Theme>>();
} }
public List<Logo> GetDefaultLogoList() { return DefaultLogoList; } public List<Logo> GetDefaultLogoList() { return DefaultLogoList; }
public List<Theme> GetThemeList() { return ThemeList; } public List<Theme> GetThemeList() { return ThemeList; }
public List<User> GetUserList() { return UserList; } public List<User> GetUserList() { return UserList; }
public Dictionary<User,List<Theme>> GetAddedThemeFromUser() { return AddedThemeList; }
public void SetDefaultLogoList(List<Logo> defaultLogoList) { DefaultLogoList = defaultLogoList; }
public void SetDefaultThemeList(List<Theme> defaultThemeList) { ThemeList = defaultThemeList; }
/// <summary> /// <summary>
/// recherche un utilisateur dans la liste d'utilisateur /// recherche un utilisateur dans la liste d'utilisateur
@ -204,5 +212,10 @@ namespace Biblioteque_de_Class
} }
} }
} }
public List<Theme> AddedThemeOfOneUser(User user)
{
return GetAddedThemeFromUser()[user];
}
} }
} }

@ -8,8 +8,11 @@ namespace Biblioteque_de_Class
{ {
public interface IManager public interface IManager
{ {
public void SaveDatabaseData(Database database); public void SaveDatabaseData(List<User> UserList, Dictionary<User, List<Theme>> AddedThemeFromUser);
public Database LoadDatabaseData(); public Database LoadDatabaseData();
public List<Theme> LoadDefaultTheme();
public List<Logo> LoadDefaultLogo();
} }
} }

@ -1,34 +1,47 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.Serialization;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Biblioteque_de_Class namespace Biblioteque_de_Class
{ {
[DataContract(IsReference = true)]
public class Note public class Note
{ {
[DataMember]
private string name; private string name;
[DataMember]
public string Name public string Name
{ {
get { return name; } get { return name; }
private set { if (value == null) { name = "Unnamed Note"; } else { name = value; } } private set { if (value == null) { name = "Unnamed Note"; } else { name = value; } }
} }
[DataMember]
private string Text { get; set; } = ""; private string Text { get; set; } = "";
[DataMember]
private string logoPath; private string logoPath;
[DataMember]
public string LogoPath public string LogoPath
{ {
get { return logoPath; } get { return logoPath; }
private set { if (value == null) { logoPath = "PATH TO DEFAULT LOGO"; } else { logoPath = value; } } private set { if (value == null) { logoPath = "PATH TO DEFAULT LOGO"; } else { logoPath = value; } }
} }
[DataMember]
private DateOnly CreationDate { get; } private DateOnly CreationDate { get; }
[DataMember]
private DateOnly ModificationDate { get; set; } private DateOnly ModificationDate { get; set; }
[DataMember]
private readonly List<NoteImage> ImageList; private readonly List<NoteImage> ImageList;
[DataMember]
private readonly List<User> Collaborators; private readonly List<User> Collaborators;
[DataMember]
private readonly List<User> Editors; private readonly List<User> Editors;
[DataMember]
private readonly User Owner; private readonly User Owner;
public Note(string name, string logoPath, User owner) public Note(string name, string logoPath, User owner)
@ -58,7 +71,6 @@ namespace Biblioteque_de_Class
public void SetName(string name) { Name = name; } public void SetName(string name) { Name = name; }
public void SetLogoPath(string logoPath) { LogoPath = logoPath; } public void SetLogoPath(string logoPath) { LogoPath = logoPath; }
public void SetModificationDate() { ModificationDate = DateOnly.FromDateTime(DateTime.Now); } public void SetModificationDate() { ModificationDate = DateOnly.FromDateTime(DateTime.Now); }
/// <summary> /// <summary>
/// vérifier si l'utilisateur est le propriétaire de la note /// vérifier si l'utilisateur est le propriétaire de la note

@ -4,6 +4,8 @@ namespace Biblioteque_de_Class
{ {
public class PersistenceManager public class PersistenceManager
{ {
private Database db = new();
private readonly IManager persistence; private readonly IManager persistence;
public PersistenceManager(IManager pers) public PersistenceManager(IManager pers)
@ -11,14 +13,17 @@ namespace Biblioteque_de_Class
persistence = pers; persistence = pers;
} }
public void SaveDatabaseData(Database database) public void SaveDatabaseData(Database database)
{ {
persistence.SaveDatabaseData(database); persistence.SaveDatabaseData(database.GetUserList(), database.GetAddedThemeFromUser());
} }
public Database LoadDatabaseData() public Database LoadDatabaseData()
{ {
return persistence.LoadDatabaseData(); db = persistence.LoadDatabaseData();
db.SetDefaultThemeList(persistence.LoadDefaultTheme());
db.SetDefaultLogoList(persistence.LoadDefaultLogo());
return db;
} }
} }
} }

@ -5,7 +5,7 @@ using System.Runtime.Serialization;
namespace Biblioteque_de_Class namespace Biblioteque_de_Class
{ {
[DataContract] [DataContract(IsReference = true)]
public class User public class User
{ {
[DataMember] [DataMember]
@ -14,6 +14,9 @@ namespace Biblioteque_de_Class
private string Email { get; set; } private string Email { get; set; }
[DataMember] [DataMember]
private string Password { get; set; } private string Password { get; set; }
[DataMember]
private string Picture { get; set; }
[DataMember]
private Theme Theme; private Theme Theme;
[DataMember] [DataMember]
private List<Note> NoteList; private List<Note> NoteList;
@ -21,7 +24,7 @@ namespace Biblioteque_de_Class
private List<Tags> TagList; private List<Tags> TagList;
[DataMember] [DataMember]
private List<Note> FavList; private List<Note> FavList;
[DataMember] [DataMember(EmitDefaultValue = false)]
private bool IsConnected { get; set; } private bool IsConnected { get; set; }
[DataMember] [DataMember]
private Dictionary<Note, List<Tags>> NoteTagged; private Dictionary<Note, List<Tags>> NoteTagged;
@ -31,6 +34,7 @@ namespace Biblioteque_de_Class
Username = username; Username = username;
Email = email; Email = email;
Password = password; Password = password;
Picture = "defaultpicture.png";
NoteList = new List<Note>(); NoteList = new List<Note>();
TagList = new List<Tags>(); TagList = new List<Tags>();
FavList = new List<Note>(); FavList = new List<Note>();
@ -40,6 +44,7 @@ namespace Biblioteque_de_Class
public string GetUsername() { return Username; } public string GetUsername() { return Username; }
public string GetEmail() { return Email; } public string GetEmail() { return Email; }
public string GetPassword() { return Password; } public string GetPassword() { return Password; }
public string GetPicture() { return Picture;}
public Theme GetTheme() { return Theme; } public Theme GetTheme() { return Theme; }
public List<Note> GetNoteList() { return NoteList; } public List<Note> GetNoteList() { return NoteList; }
public List<Tags> GetTagList() { return TagList; } public List<Tags> GetTagList() { return TagList; }
@ -51,6 +56,7 @@ namespace Biblioteque_de_Class
public void SetUsername(string username) { Username = username; } public void SetUsername(string username) { Username = username; }
public void SetEmail(string email) { Email = email; } public void SetEmail(string email) { Email = email; }
public void SetPassword(string password) { Password = password; } public void SetPassword(string password) { Password = password; }
public void SetPicture(string picture) { Picture = picture; }
public void SetTheme(Theme theme) { Theme = theme; } public void SetTheme(Theme theme) { Theme = theme; }
public void SetIsConnected(bool isConnected) { IsConnected = isConnected; } public void SetIsConnected(bool isConnected) { IsConnected = isConnected; }

@ -7,10 +7,6 @@ using System.Text;
// load database // load database
PersistenceManager manager = new(new Stub()); PersistenceManager manager = new(new Stub());
Database db = manager.LoadDatabaseData(); Database db = manager.LoadDatabaseData();
foreach(User user in db.GetUserList())
{
user.SetPassword(GetSHA256Hash(user.GetPassword()));
}
// initialization zone============================================================================== // initialization zone==============================================================================
@ -139,22 +135,6 @@ List<string>? choix_couleur()
return colorList; return colorList;
} }
static string GetSHA256Hash(string input)
{
using (SHA256 sha256Hash = SHA256.Create())
{
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder builder = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
}
return builder.ToString();
}
}
while (menu) while (menu)
{ {
Console.WriteLine("\n|--------------------------------------|"); Console.WriteLine("\n|--------------------------------------|");
@ -190,7 +170,6 @@ while (menu)
Console.WriteLine("\nEntrez un password :"); Console.WriteLine("\nEntrez un password :");
string? password = Console.ReadLine(); string? password = Console.ReadLine();
if (password == null) { continue; } if (password == null) { continue; }
password = GetSHA256Hash(password);
try try
{ {
u = db.GetUser(nom); u = db.GetUser(nom);
@ -202,7 +181,7 @@ while (menu)
} }
if (!connection) if (!connection)
{ {
if (Database.ComparePassword(u, password)) if (Database.ComparePassword(u, password.GetHashCode().ToString()))
{ {
u.SetIsConnected(true); u.SetIsConnected(true);
Console.WriteLine("\nConnection réussie !\n"); Console.WriteLine("\nConnection réussie !\n");
@ -234,8 +213,7 @@ while (menu)
} }
catch (AlreadyUsedException) catch (AlreadyUsedException)
{ {
password = GetSHA256Hash(password); u = new User(nom, "", password.GetHashCode().ToString());
u = new User(nom, "", password);
db.AddUser(u); db.AddUser(u);
db.GetUser(nom).SetIsConnected(true); db.GetUser(nom).SetIsConnected(true);
Console.WriteLine("\nConnection réussie !\n"); Console.WriteLine("\nConnection réussie !\n");
@ -548,8 +526,7 @@ while (u.GetIsConnected())
Console.WriteLine("\nLe mot de passe doit contenir au moins 8 caractères.\n"); Console.WriteLine("\nLe mot de passe doit contenir au moins 8 caractères.\n");
break; break;
} }
wantedNewPassword = GetSHA256Hash(wantedNewPassword); if(wantedNewPassword.GetHashCode().ToString() == u.GetPassword()){
if(wantedNewPassword == u.GetPassword()){
Console.WriteLine("\nLe nouveau mot de passe doit être différent de l'ancien.\n"); Console.WriteLine("\nLe nouveau mot de passe doit être différent de l'ancien.\n");
break; break;
} }

@ -4,13 +4,15 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.Serialization.Json; using System.Runtime.Serialization.Json;
using System.Text; using System.Text;
using System.Security.Cryptography;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Notus_Persistance namespace Notus_Persistance
{ {
public class Stub : IManager public class Stub : IManager
{ {
public void SaveDatabaseData(Database database) public void SaveDatabaseData(List<User> UserList, Dictionary<User, List<Theme>> AddedThemeFromUser)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -39,7 +41,7 @@ namespace Notus_Persistance
} }
// add note to user for sharing note test mixed with tag // add note to user for sharing note test mixed with tag
uselect = (User)database.GetUserList().Where(x => x.GetUsername() == "Nicolas"); uselect = (User)database.GetUserList().Where(x => x.GetUsername() == "Nicolas");
uselect.CreateNote("Note 4", "Logo_1"); uselect.CreateNote("Note 4", "Logo_1");
uselect.CreateTag("Tag 3", "#00FF00"); uselect.CreateTag("Tag 3", "#00FF00");
nselect = (Note)uselect.GetNoteList().Where(x => x.GetName() == "Note 4"); nselect = (Note)uselect.GetNoteList().Where(x => x.GetName() == "Note 4");
@ -59,10 +61,23 @@ namespace Notus_Persistance
colorListHexaCode = new("000000,FFFFFF,000000".Split(',')); colorListHexaCode = new("000000,FFFFFF,000000".Split(','));
database.AddTheme(new Theme("Theme_3", colorListHexaCode)); database.AddTheme(new Theme("Theme_3", colorListHexaCode));
foreach (User user in database.GetUserList())
{
user.SetPassword(user.GetPassword().GetHashCode().ToString());
}
return database; return database;
} }
public List<Theme> LoadDefaultTheme()
{
throw new NotImplementedException();
}
public List<Logo> LoadDefaultLogo()
{
throw new NotImplementedException();
}
} }
} }

@ -9,26 +9,18 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization;
namespace Notus_Persistance namespace Notus_Persistance
{ {
public class ToJSON : IManager public class ToJSON : IManager
{ {
private const string DatabaseDataFilePath = "data.json"; private const string DatabaseDataFilePath = "data.json";
private const string UserDataFilePath = "userdata.json"; private const string DefaultThemePath = "";
private const string NoteDataFilePath = "notedata.json"; private const string DefaultLogoPath = "";
private const string ThemeDataFilePath = "themedata.json"; private static readonly DataContractJsonSerializer DatabasejsonSerializer = new(typeof(Database));
private const string LogoDataFilePath = "logodata.json";
private const string TagsDataFilePath = "tagsdata.json"; public void SaveDatabaseData(List<User> UserList, Dictionary<User, List<Theme>> AddedThemeFromUser)
private const string NoteImageDataFilePath = "noteImagedata.json";
private static DataContractJsonSerializer DatabasejsonSerializer = new DataContractJsonSerializer(typeof(Database));
private static DataContractJsonSerializer UserjsonSerializer = new DataContractJsonSerializer(typeof(User));
private static DataContractJsonSerializer NotejsonSerializer = new DataContractJsonSerializer(typeof(Note));
private static DataContractJsonSerializer ThemejsonSerializer = new DataContractJsonSerializer(typeof(Theme));
private static DataContractJsonSerializer LogojsonSerializer = new DataContractJsonSerializer(typeof(Logo));
private static DataContractJsonSerializer TagsjsonSerializer = new DataContractJsonSerializer(typeof(Tags));
private static DataContractJsonSerializer NoteImagejsonSerializer = new DataContractJsonSerializer(typeof(NoteImage));
public void SaveDatabaseData(Database database)
{ {
using (FileStream fileStream = File.Create(DatabaseDataFilePath)) using (FileStream fileStream = File.Create(DatabaseDataFilePath))
{ {
@ -38,7 +30,8 @@ namespace Notus_Persistance
false, false,
true))//<- this boolean says that we sant indentation true))//<- this boolean says that we sant indentation
{ {
DatabasejsonSerializer.WriteObject(writer, database); DatabasejsonSerializer.WriteObject(writer, UserList);
DatabasejsonSerializer.WriteObject(writer, AddedThemeFromUser);
} }
} }
} }
@ -65,5 +58,50 @@ namespace Notus_Persistance
throw new FileException("No data file found."); throw new FileException("No data file found.");
} }
} }
public List<Theme> LoadDefaultTheme()
{
if (File.Exists(DefaultThemePath))
{
using (FileStream fileStream = File.OpenRead(DefaultThemePath))
{
List<Theme>? DefaultThemeList = (List<Theme>?)DatabasejsonSerializer.ReadObject(fileStream);
if (DefaultThemeList == null)
{
throw new FileException("Failed to Default Theme. The loaded object is null.");
}
else
{
return DefaultThemeList;
}
}
}
else
{
throw new FileException("No data file found.");
}
}
public List<Logo> LoadDefaultLogo()
{
if (File.Exists(DefaultLogoPath))
{
using (FileStream fileStream = File.OpenRead(DefaultLogoPath))
{
List<Logo>? DefaultLogoList = (List<Logo>?)DatabasejsonSerializer.ReadObject(fileStream);
if (DefaultLogoList == null)
{
throw new FileException("Failed to Default Logo. The loaded object is null.");
}
else
{
return DefaultLogoList;
}
}
}
else
{
throw new FileException("No data file found.");
}
}
} }
} }

@ -7,22 +7,76 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Notus_Persistance namespace Notus_Persistance
{ {
public class ToXML : IManager public class ToXML : IManager
{ {
private const string DataFilePath = "data.xml"; private const string DataFilePath = "data.xml";
private const string XmlDataFilePath = "userdata.xml"; private const string DefaultThemePath = "";
private const string DefaultLogoPath = "";
private static readonly DataContractSerializer DatabaseXmlSerializer = new(typeof(Database));
public void SaveDatabaseData(Database database) public void SaveDatabaseData(List<User> UserList, Dictionary<User, List<Theme>> AddedThemeFromUser)
{ {
throw new NotImplementedException(); XmlWriterSettings settings = new() { Indent = true };
using TextWriter tw = File.CreateText(DataFilePath);
using XmlWriter writer = XmlWriter.Create(tw, settings);
DatabaseXmlSerializer.WriteObject(writer, UserList);
DatabaseXmlSerializer.WriteObject(writer, AddedThemeFromUser);
} }
public Database LoadDatabaseData() public Database LoadDatabaseData()
{ {
throw new NotImplementedException(); if (File.Exists(DataFilePath))
{
using (FileStream fileStream = File.OpenRead(DataFilePath))
{
return DatabaseXmlSerializer.ReadObject(fileStream) is not Database database
? throw new FileException("Failed to load the database. The loaded object is null.")
: database;
}
}
else
{
throw new FileException("No data file found.");
}
} }
public List<Theme> LoadDefaultTheme()
{
if (File.Exists(DefaultThemePath))
{
using (FileStream fileStream = File.OpenRead(DefaultThemePath))
{
return DatabaseXmlSerializer.ReadObject(fileStream) is not List<Theme> DefaultThemeList
? throw new FileException("Failed to load Default Theme. The loaded object is null.")
: DefaultThemeList;
}
}
else
{
throw new FileException("No data file found.");
}
}
public List<Logo> LoadDefaultLogo()
{
if (File.Exists(DefaultLogoPath))
{
using (FileStream fileStream = File.OpenRead(DefaultLogoPath))
{
return DatabaseXmlSerializer.ReadObject(fileStream) is not List<Logo> DefaultLogoList
? throw new FileException("Failed to load Default Logo. The loaded object is null.")
: DefaultLogoList;
}
}
else
{
throw new FileException("No data file found.");
}
}
} }
} }

@ -5,12 +5,8 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Vue", "notus_vue\Notus_Vue.csproj", "{561264A1-4611-40FB-A662-3EF65550CA71}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Vue", "notus_vue\Notus_Vue.csproj", "{561264A1-4611-40FB-A662-3EF65550CA71}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{0A5E5F33-6B39-42BF-A46D-0752EDB666FB} = {0A5E5F33-6B39-42BF-A46D-0752EDB666FB}
{184478A9-E14F-42E0-B963-B3A4474C9C1C} = {184478A9-E14F-42E0-B963-B3A4474C9C1C} {184478A9-E14F-42E0-B963-B3A4474C9C1C} = {184478A9-E14F-42E0-B963-B3A4474C9C1C}
{7B7F1062-9498-44E5-AC77-84BC90A3B730} = {7B7F1062-9498-44E5-AC77-84BC90A3B730}
{92DD50C5-EEAD-44ED-AEFF-E21935725477} = {92DD50C5-EEAD-44ED-AEFF-E21935725477} {92DD50C5-EEAD-44ED-AEFF-E21935725477} = {92DD50C5-EEAD-44ED-AEFF-E21935725477}
{AFCEAA99-3A25-4E9E-B498-72DD76A6B7FF} = {AFCEAA99-3A25-4E9E-B498-72DD76A6B7FF}
{EE443C17-B31D-4AD0-9141-920876E7DF79} = {EE443C17-B31D-4AD0-9141-920876E7DF79}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}"

@ -27,6 +27,10 @@
Title="Inscription_Page" Title="Inscription_Page"
ContentTemplate="{DataTemplate local:InscrPage}" ContentTemplate="{DataTemplate local:InscrPage}"
Route="InscrPage"/> Route="InscrPage"/>
<ShellContent
Title="ProfilPage"
ContentTemplate="{DataTemplate local:ProfilPage}"
Route="ProfilPage"/>
</Shell> </Shell>

@ -18,6 +18,7 @@
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="4*"/> <RowDefinition Height="4*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/> <ColumnDefinition Width="4*"/>
<ColumnDefinition Width="4*"/> <ColumnDefinition Width="4*"/>
@ -35,40 +36,41 @@
Text="Connection" Text="Connection"
TextColor="#74fabd" TextColor="#74fabd"
FontSize="80" FontSize="80"
FontFamily="strong"/> FontFamily="strong"
/>
<Entry <Entry
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Grid.Row="3" Grid.Row="3"
FontSize="22" FontSize="22"
Placeholder="entrer votre e-mail" Placeholder="entrer votre e-mail"
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
TextColor="#74fabd" TextColor="#74fabd"
BackgroundColor="#4A4A4A"/> BackgroundColor="#4A4A4A"
/>
<Entry <Entry
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Grid.Row="5" Grid.Row="5"
FontSize="22" FontSize="22"
Placeholder="entrer votre mot de passe" Placeholder="entrer votre mot de passe"
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
TextColor="#74fabd" TextColor="#74fabd"
IsPassword="true" IsPassword="true"
BackgroundColor="#4A4A4A"/> BackgroundColor="#4A4A4A"
/>
<Button <Button
Grid.Column="2" Grid.Column="2"
Grid.ColumnSpan="1" Grid.ColumnSpan="1"
Grid.Row="7" Grid.Row="7"
Text="Valider" Text="Valider"
TextColor="Black" TextColor="Black"
BackgroundColor="#74fabd"/> BackgroundColor="#74fabd"
/>
</Grid> </Grid>
</ContentPage> </ContentPage>

@ -6,19 +6,18 @@
<Grid BackgroundColor="#1C1C1C"> <Grid BackgroundColor="#1C1C1C">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="350"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="700"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="500"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="150"/> <RowDefinition Height="150"/>
<RowDefinition Height="150"/> <RowDefinition Height="150"/>
<RowDefinition Height="150"/> <RowDefinition Height="150"/>
<RowDefinition Height="150"/> <RowDefinition Height="1*"/>
<RowDefinition Height="200"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Entry <Entry
Placeholder="Pseudo" Placeholder="Pseudo"
@ -49,7 +48,6 @@
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
/> />
<Entry <Entry
Placeholder ="Verif mot de passe" Placeholder ="Verif mot de passe"
HorizontalOptions="Center" HorizontalOptions="Center"
@ -80,5 +78,4 @@
</Grid> </Grid>
</ContentPage> </ContentPage>

@ -14,6 +14,7 @@
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/> <ColumnDefinition Width="3*"/>
<ColumnDefinition Width="4*"/> <ColumnDefinition Width="4*"/>
@ -29,7 +30,8 @@
TextColor="#74fabd" TextColor="#74fabd"
FontSize="120" FontSize="120"
FontAttributes="Bold" FontAttributes="Bold"
FontFamily="strong"/> FontFamily="strong"
/>
<Button <Button
CornerRadius="50" CornerRadius="50"
@ -39,7 +41,8 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
HeightRequest="75" HeightRequest="75"
BackgroundColor="#4A4A4A"/> BackgroundColor="#4A4A4A"
/>
<Button <Button
CornerRadius="50" CornerRadius="50"
@ -49,7 +52,8 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
HeightRequest="75" HeightRequest="75"
BackgroundColor="#4A4A4A"/> BackgroundColor="#4A4A4A"
/>
</Grid> </Grid>

@ -0,0 +1,74 @@
<?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"
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
x:Class="notus.ProfilPage"
Title="ProfilPage"
BackgroundColor="#1C1C1C">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button
Text="Modifier Profil"
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
Grid.Column="1"
Grid.Row="4"
VerticalOptions="Center"
HeightRequest="80"
FontSize="30"
/>
<Button
Text="Modifier Theme"
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
Grid.Column="1"
Grid.Row="5"
FontSize="30"
VerticalOptions="Start"
HeightRequest="80"
/>
<Label
Text="Profil"
FontSize="30"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
Grid.Column="1"
Grid.Row="3"
VerticalOptions="End"
HeightRequest="80"
/>
<ImageButton
Source="profil.png"
Aspect="AspectFit"
Grid.Column="1"
Grid.Row="2"
WidthRequest="550"
HeightRequest="250"
BackgroundColor="#6E6E6E"
CornerRadius="10"
Clicked="ProfilClicked"
/>
</Grid>
</ContentPage>

@ -0,0 +1,17 @@
using Microsoft.Maui.Controls;
using Biblioteque_de_Class;
using Notus_Persistance;
namespace notus;
public partial class ProfilPage : ContentPage
{
public ProfilPage()
{
InitializeComponent();
}
void ProfilClicked(System.Object sender, System.EventArgs e)
{
}
}

@ -5,10 +5,10 @@
x:Class="notus.RecherPage" x:Class="notus.RecherPage"
Title="RecherPage" Title="RecherPage"
BackgroundColor="#1C1C1C"> BackgroundColor="#1C1C1C">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="2*"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="1.5*"/> <RowDefinition Height="1.5*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1.8*"/> <RowDefinition Height="1.8*"/>
@ -18,12 +18,13 @@
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="4*"/> <RowDefinition Height="4*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="380"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="4*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.9*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.2*"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="190"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border <Border
@ -33,7 +34,7 @@
/> />
<ImageButton <ImageButton
Source="Profil.png" Source="profil.png"
Aspect="AspectFit" Aspect="AspectFit"
Grid.Column="4" Grid.Column="4"
Grid.Row="0" Grid.Row="0"
@ -43,23 +44,25 @@
HeightRequest="120" HeightRequest="120"
BackgroundColor="#6E6E6E" BackgroundColor="#6E6E6E"
CornerRadius="10" CornerRadius="10"
Clicked="Profil_Clicked"
/> />
<ImageButton <ImageButton
Source="Supp.png" Source="supp.png"
Aspect="AspectFit" Aspect="AspectFill"
Grid.Column="2" Grid.Column="2"
Grid.Row="0" Grid.Row="0"
Margin="20" Margin="20"
HorizontalOptions="Center" HorizontalOptions="End"
VerticalOptions="Start" VerticalOptions="Start"
WidthRequest="50" WidthRequest="50"
HeightRequest="50" HeightRequest="50"
BackgroundColor="#4A4A4A" BackgroundColor="#4A4A4A"
CornerRadius="50" CornerRadius="50"
/> />
<Label <Label
Text="{Binding Note.name}" Text="Nom de la note"
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
TextColor="#74fabd" TextColor="#74fabd"
@ -68,24 +71,25 @@
BackgroundColor="#4A4A4A" BackgroundColor="#4A4A4A"
WidthRequest="250" WidthRequest="250"
HeightRequest="50" HeightRequest="50"
HorizontalOptions="Start" HorizontalOptions="Center"
VerticalOptions="Start" VerticalOptions="Start"
BindingContext="NomDeLaNoteSelected"
/> />
<ImageButton <ImageButton
x:Name="Edit" Source="edit.png"
Source="Edit.png"
Aspect="AspectFit" Aspect="AspectFit"
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
Margin="20" Margin="20"
HorizontalOptions="Center" HorizontalOptions="Start"
VerticalOptions="Start" VerticalOptions="Start"
WidthRequest="50" WidthRequest="50"
HeightRequest="50" HeightRequest="50"
BackgroundColor="#4A4A4A" BackgroundColor="#4A4A4A"
CornerRadius="50" CornerRadius="50"
/> />
<Entry <Entry
Placeholder="Rechercher" Placeholder="Rechercher"
HorizontalOptions="Start" HorizontalOptions="Start"
@ -93,7 +97,7 @@
VerticalOptions="Center" VerticalOptions="Center"
WidthRequest="300" WidthRequest="300"
HeightRequest="50" HeightRequest="50"
FontSize="32" FontSize="25"
Grid.Column="0" Grid.Column="0"
Grid.Row="0" Grid.Row="0"
TextColor="#74fabd" TextColor="#74fabd"
@ -101,20 +105,31 @@
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
/> />
<ListView
Grid.Column="0"
Grid.RowSpan="5"
ItemsSource="{Binding NoteList}"
x:Name="ListNote"
/>
<Editor <Editor
Placeholder="Texte" Placeholder="Texte"
IsSpellCheckEnabled="True"
FontSize="20"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
Margin="20" Margin="20"
WidthRequest="670" WidthRequest="800"
HeightRequest="670" HeightRequest="750"
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="4" Grid.ColumnSpan="4"
Grid.Row="4" Grid.Row="4"
Grid.RowSpan="3" Grid.RowSpan="3"
TextColor="Black" TextColor="White"
BackgroundColor="#4A4A4A" BackgroundColor="#4A4A4A"
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
/> />
</Grid> </Grid>
</ContentPage> </ContentPage>

@ -1,22 +1,22 @@
using Microsoft.Maui.Controls;
using Biblioteque_de_Class; using Biblioteque_de_Class;
using Notus_Persistance; using Notus_Persistance;
using System.Runtime.InteropServices;
namespace notus; namespace notus;
public partial class RecherPage : ContentPage public partial class RecherPage : ContentPage
{ {
public PersistenceManager mana { get; private set; } = new (new Stub()); public PersistenceManager manager { get; private set; } = new PersistenceManager(new Stub());
public RecherPage() public RecherPage()
{ {
manager.LoadDatabaseData();
InitializeComponent(); InitializeComponent();
BindingContext = this; ListNote.BindingContext = manager;
Edit.Clicked += Edit_Clicked;
} }
private void Edit_Clicked(object sender, EventArgs e) void Profil_Clicked(System.Object sender, System.EventArgs e)
{ {
throw new NotImplementedException();
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -68,6 +68,9 @@
<Compile Update="InscrPage.xaml.cs"> <Compile Update="InscrPage.xaml.cs">
<DependentUpon>InscrPage.xaml</DependentUpon> <DependentUpon>InscrPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="ProfilPage.xaml.cs">
<DependentUpon>ProfilPage.xaml</DependentUpon>
</Compile>
<Compile Update="RecherPage.xaml.cs"> <Compile Update="RecherPage.xaml.cs">
<DependentUpon>RecherPage.xaml</DependentUpon> <DependentUpon>RecherPage.xaml</DependentUpon>
</Compile> </Compile>
@ -80,6 +83,9 @@
<MauiXaml Update="InscrPage.xaml"> <MauiXaml Update="InscrPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="ProfilPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="RecherPage.xaml"> <MauiXaml Update="RecherPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

Loading…
Cancel
Save