diff --git a/CanYouBuildIt/App.xaml.cs b/CanYouBuildIt/App.xaml.cs index 046846a..3a958ee 100644 --- a/CanYouBuildIt/App.xaml.cs +++ b/CanYouBuildIt/App.xaml.cs @@ -1,7 +1,10 @@ -namespace CanYouBuildIt; +using CanYouBuildIt.Model; + +namespace CanYouBuildIt; public partial class App : Application { + public Manager Manager { get; private set; } = new Manager(); public App() { InitializeComponent(); diff --git a/CanYouBuildIt/Model/Build.cs b/CanYouBuildIt/Model/Build.cs new file mode 100644 index 0000000..9d6ea34 --- /dev/null +++ b/CanYouBuildIt/Model/Build.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Intrinsics.X86; +using System.Text; +using System.Threading.Tasks; + +namespace CanYouBuildIt.Model +{ + public class Build + { + public int id { get; private set; } + public float prix { get; private set; } + public List listComp { get; private set; } + + + public Build(int idBuild, float prixBuild, Composant boitier, Composant processeur, Composant ventirad, Composant cartemere, Composant memoirevive, Composant cartegraphique, Composant alimentation, Composant ventilateur, Composant ssd = null, Composant hdd = null) + { + id = idBuild; + prix = prixBuild; + listComp.Add(boitier); + listComp.Add(processeur); + listComp.Add(ventirad); + listComp.Add(cartemere); + listComp.Add(memoirevive); + listComp.Add(cartegraphique); + listComp.Add(alimentation); + listComp.Add(ventilateur); + if(ssd != null) + { + listComp.Add(ssd); + } + if(hdd != null) + { + listComp.Add(hdd); + } + + } + + } +} diff --git a/CanYouBuildIt/Model/Composant.cs b/CanYouBuildIt/Model/Composant.cs new file mode 100644 index 0000000..7b09272 --- /dev/null +++ b/CanYouBuildIt/Model/Composant.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CanYouBuildIt.Model +{ + public enum TypeComposant + { + Boitier, + Processeur, + Ventirad, + CarteMere, + MemoireVive, + CarteGraphique, + Alimentation, + Ventilateur, + SSD, + HDD + } + + public class Composant + { + public string id { get; private set; } + public TypeComposant type { get; private set; } + public float prix { get; private set; } + public string lien { get; private set; } + + + public Composant( string idComp, TypeComposant typeComp, float prixCompo, string lienComp) + { + id = idComp; + type = typeComp; + prix = prixCompo; + lien = lienComp; + } + } +} diff --git a/CanYouBuildIt/Model/Manager.cs b/CanYouBuildIt/Model/Manager.cs new file mode 100644 index 0000000..ec0579e --- /dev/null +++ b/CanYouBuildIt/Model/Manager.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CanYouBuildIt.Model +{ + public class Manager + { + public List listUtil { get; private set; } + + public Manager() + { + listUtil = new List(); + } + + public void ajouterUtilisateur(Utilisateur utilisateur) + { + listUtil.Add(utilisateur); + } + + } +} diff --git a/CanYouBuildIt/Model/Utilisateur.cs b/CanYouBuildIt/Model/Utilisateur.cs new file mode 100644 index 0000000..9689c7e --- /dev/null +++ b/CanYouBuildIt/Model/Utilisateur.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CanYouBuildIt.Model +{ + public class Utilisateur + { + public string username; + public string password; + public List listBuild; + + + public Utilisateur(string name, string pasword, List listBuild = null) + { + username = name; + password = pasword; + } + } +} diff --git a/CanYouBuildIt/Resources/Images/pc4.png.jpg b/CanYouBuildIt/Resources/Images/pc4.png.jpg deleted file mode 100644 index fa16127..0000000 Binary files a/CanYouBuildIt/Resources/Images/pc4.png.jpg and /dev/null differ diff --git a/CanYouBuildIt/Views/Acceuil.xaml b/CanYouBuildIt/Views/Acceuil.xaml index 1aaab2a..964ec3e 100644 --- a/CanYouBuildIt/Views/Acceuil.xaml +++ b/CanYouBuildIt/Views/Acceuil.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="CanYouBuildIt.Views.Acceuil" Title="Can You Build It"> - + @@ -21,32 +21,26 @@ @@ -71,13 +65,16 @@ x:Name="Config" Text="Configurateur" SemanticProperties.Hint="Counts the number of times you click" - HorizontalOptions="Center" /> + HorizontalOptions="Center" + Clicked="AddUtilisater"/> +