From 36396ca4df270def33feb4910e611a6442fb4eea Mon Sep 17 00:00:00 2001 From: Leana BESSON Date: Thu, 27 Apr 2023 09:55:34 +0200 Subject: [PATCH] Ajout des menus et modifications --- essai1/ConceptionUML.mdj | 646 +++++++++++++++++- .../Console.csproj} | 3 +- essai1/Console/Program.cs | 105 +++ essai1/ConsoleApp1/Program.cs | 42 -- essai1/Model/Animal.cs | 20 +- essai1/Model/Compte.cs | 42 -- essai1/Model/Espece.cs | 23 + essai1/Model/Model.csproj | 1 - essai1/Model/Option.cs | 36 - essai1/Model/Race.cs | 8 +- essai1/Model/System.cs | 10 +- essai1/essai1.sln | 23 +- essai1/essai1/MainPage.xaml.cs | 22 - 13 files changed, 784 insertions(+), 197 deletions(-) rename essai1/{ConsoleApp1/ConsoleApp1.csproj => Console/Console.csproj} (72%) create mode 100644 essai1/Console/Program.cs delete mode 100644 essai1/ConsoleApp1/Program.cs delete mode 100644 essai1/Model/Compte.cs create mode 100644 essai1/Model/Espece.cs delete mode 100644 essai1/Model/Option.cs diff --git a/essai1/ConceptionUML.mdj b/essai1/ConceptionUML.mdj index fbdd398..781d40f 100644 --- a/essai1/ConceptionUML.mdj +++ b/essai1/ConceptionUML.mdj @@ -839,7 +839,7 @@ "top": 1848, "width": 135, "height": 13, - "text": "+AfficherConseil()", + "text": "+\"()", "horizontalAlignment": 0 }, { @@ -1908,6 +1908,544 @@ "headQualifiersCompartment": { "$ref": "AAAAAAGHs3T0XLLQKNo=" } + }, + { + "_type": "UMLAssociationView", + "_id": "AAAAAAGHwWWRkb1RQVU=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ny9c=" + }, + "subViews": [ + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1SJMA=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ny9c=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 907, + "top": 1658, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1TrNw=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ny9c=" + }, + "visible": null, + "font": "Arial;13;0", + "left": 906, + "top": 1673, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1UYIw=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ny9c=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 908, + "top": 1629, + "height": 13, + "alpha": -1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1VVBc=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ohjc=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 948, + "top": 1661, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1WFF0=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ohjc=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 945, + "top": 1674, + "height": 13, + "alpha": 0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1X1vc=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ohjc=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 954, + "top": 1634, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1YXdk=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Pa9U=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 866, + "top": 1656, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1ZzVA=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Pa9U=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 867, + "top": 1669, + "height": 13, + "alpha": -0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWRkb1aEbY=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Pa9U=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 863, + "top": 1628, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + } + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGHwWWRkb1bo/c=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Ohjc=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGHwWWRkb1caK0=", + "_parent": { + "$ref": "AAAAAAGHwWWRkb1RQVU=" + }, + "model": { + "$ref": "AAAAAAGHwWWRkL1Pa9U=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + } + ], + "font": "Arial;13;0", + "head": { + "$ref": "AAAAAAGHRzYm9nfEnm8=" + }, + "tail": { + "$ref": "AAAAAAGHs05THaD/tWQ=" + }, + "lineStyle": 1, + "points": "975:1654;841:1646", + "showVisibility": true, + "nameLabel": { + "$ref": "AAAAAAGHwWWRkb1SJMA=" + }, + "stereotypeLabel": { + "$ref": "AAAAAAGHwWWRkb1TrNw=" + }, + "propertyLabel": { + "$ref": "AAAAAAGHwWWRkb1UYIw=" + }, + "tailRoleNameLabel": { + "$ref": "AAAAAAGHwWWRkb1VVBc=" + }, + "tailPropertyLabel": { + "$ref": "AAAAAAGHwWWRkb1WFF0=" + }, + "tailMultiplicityLabel": { + "$ref": "AAAAAAGHwWWRkb1X1vc=" + }, + "headRoleNameLabel": { + "$ref": "AAAAAAGHwWWRkb1YXdk=" + }, + "headPropertyLabel": { + "$ref": "AAAAAAGHwWWRkb1ZzVA=" + }, + "headMultiplicityLabel": { + "$ref": "AAAAAAGHwWWRkb1aEbY=" + }, + "tailQualifiersCompartment": { + "$ref": "AAAAAAGHwWWRkb1bo/c=" + }, + "headQualifiersCompartment": { + "$ref": "AAAAAAGHwWWRkb1caK0=" + } + }, + { + "_type": "UMLAssociationView", + "_id": "AAAAAAGHwWWrML3EbEk=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3A4j4=" + }, + "subViews": [ + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3FCmY=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3A4j4=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 898, + "top": 1748, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3Gzpg=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3A4j4=" + }, + "visible": null, + "font": "Arial;13;0", + "left": 905, + "top": 1761, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3HMiU=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3A4j4=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 885, + "top": 1721, + "height": 13, + "alpha": -1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3IHHo=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3BUYE=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 958, + "top": 1718, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3Jfmw=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3BUYE=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 962, + "top": 1731, + "height": 13, + "alpha": 0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3K/Co=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3BUYE=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 950, + "top": 1691, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3LQ0A=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3CdMA=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 838, + "top": 1778, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3MWbI=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3CdMA=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 847, + "top": 1789, + "height": 13, + "alpha": -0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGHwWWrML3NL+c=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3CdMA=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 822, + "top": 1756, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + } + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGHwWWrML3Ogc8=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3BUYE=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGHwWWrML3P9b8=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3EbEk=" + }, + "model": { + "$ref": "AAAAAAGHwWWrML3CdMA=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + } + ], + "font": "Arial;13;0", + "head": { + "$ref": "AAAAAAGHWv9inrkU+cQ=" + }, + "tail": { + "$ref": "AAAAAAGHs05THaD/tWQ=" + }, + "lineStyle": 1, + "points": "975:1699;809:1783", + "showVisibility": true, + "nameLabel": { + "$ref": "AAAAAAGHwWWrML3FCmY=" + }, + "stereotypeLabel": { + "$ref": "AAAAAAGHwWWrML3Gzpg=" + }, + "propertyLabel": { + "$ref": "AAAAAAGHwWWrML3HMiU=" + }, + "tailRoleNameLabel": { + "$ref": "AAAAAAGHwWWrML3IHHo=" + }, + "tailPropertyLabel": { + "$ref": "AAAAAAGHwWWrML3Jfmw=" + }, + "tailMultiplicityLabel": { + "$ref": "AAAAAAGHwWWrML3K/Co=" + }, + "headRoleNameLabel": { + "$ref": "AAAAAAGHwWWrML3LQ0A=" + }, + "headPropertyLabel": { + "$ref": "AAAAAAGHwWWrML3MWbI=" + }, + "headMultiplicityLabel": { + "$ref": "AAAAAAGHwWWrML3NL+c=" + }, + "tailQualifiersCompartment": { + "$ref": "AAAAAAGHwWWrML3Ogc8=" + }, + "headQualifiersCompartment": { + "$ref": "AAAAAAGHwWWrML3P9b8=" + } } ] }, @@ -2445,7 +2983,8 @@ "_parent": { "$ref": "AAAAAAGHRzYm9nfClwY=" }, - "name": "nom string" + "name": "nom string", + "type": "" }, { "_type": "UMLAttribute", @@ -2453,7 +2992,8 @@ "_parent": { "$ref": "AAAAAAGHRzYm9nfClwY=" }, - "name": "info string" + "name": "info string", + "type": "" }, { "_type": "UMLAttribute", @@ -2461,7 +3001,8 @@ "_parent": { "$ref": "AAAAAAGHRzYm9nfClwY=" }, - "name": "conseil string" + "name": "conseil string", + "type": "" }, { "_type": "UMLAttribute", @@ -2469,7 +3010,8 @@ "_parent": { "$ref": "AAAAAAGHRzYm9nfClwY=" }, - "name": "listeRace race" + "name": "listeRace race", + "type": "" } ], "operations": [ @@ -2813,7 +3355,8 @@ "_parent": { "$ref": "AAAAAAGHWvmA35YVlJg=" }, - "name": "listeEspece Espece" + "name": "listeEspece Espece", + "type": "" }, { "_type": "UMLAttribute", @@ -2821,7 +3364,8 @@ "_parent": { "$ref": "AAAAAAGHWvmA35YVlJg=" }, - "name": "listeAnimaux Animal" + "name": "listeAnimaux Animal", + "type": "" } ], "operations": [ @@ -3054,7 +3598,8 @@ "_parent": { "$ref": "AAAAAAGHWv9inrkSw6I=" }, - "name": "nom string" + "name": "nom string", + "type": "" }, { "_type": "UMLAttribute", @@ -3062,7 +3607,8 @@ "_parent": { "$ref": "AAAAAAGHWv9inrkSw6I=" }, - "name": "conseil string" + "name": "conseil string", + "type": "" } ], "operations": [ @@ -3080,7 +3626,7 @@ "_parent": { "$ref": "AAAAAAGHWv9inrkSw6I=" }, - "name": "AfficherConseil" + "name": "\"" }, { "_type": "UMLOperation", @@ -3269,6 +3815,62 @@ "$ref": "AAAAAAGHWvmA35YVlJg=" } } + }, + { + "_type": "UMLAssociation", + "_id": "AAAAAAGHwWWRkL1Ny9c=", + "_parent": { + "$ref": "AAAAAAGHs05THaD99yA=" + }, + "end1": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGHwWWRkL1Ohjc=", + "_parent": { + "$ref": "AAAAAAGHwWWRkL1Ny9c=" + }, + "reference": { + "$ref": "AAAAAAGHs05THaD99yA=" + }, + "navigable": false + }, + "end2": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGHwWWRkL1Pa9U=", + "_parent": { + "$ref": "AAAAAAGHwWWRkL1Ny9c=" + }, + "reference": { + "$ref": "AAAAAAGHRzYm9nfClwY=" + } + } + }, + { + "_type": "UMLAssociation", + "_id": "AAAAAAGHwWWrML3A4j4=", + "_parent": { + "$ref": "AAAAAAGHs05THaD99yA=" + }, + "end1": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGHwWWrML3BUYE=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3A4j4=" + }, + "reference": { + "$ref": "AAAAAAGHs05THaD99yA=" + }, + "navigable": false + }, + "end2": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGHwWWrML3CdMA=", + "_parent": { + "$ref": "AAAAAAGHwWWrML3A4j4=" + }, + "reference": { + "$ref": "AAAAAAGHWv9inrkSw6I=" + } + } } ], "attributes": [ @@ -3278,7 +3880,8 @@ "_parent": { "$ref": "AAAAAAGHs05THaD99yA=" }, - "name": "nom string" + "name": "nom string", + "type": "" }, { "_type": "UMLAttribute", @@ -3286,7 +3889,8 @@ "_parent": { "$ref": "AAAAAAGHs05THaD99yA=" }, - "name": "nb_animal int" + "name": "nb_animal int", + "type": "" }, { "_type": "UMLAttribute", @@ -3294,7 +3898,8 @@ "_parent": { "$ref": "AAAAAAGHs05THaD99yA=" }, - "name": "Info string" + "name": "Info string", + "type": "" }, { "_type": "UMLAttribute", @@ -3302,7 +3907,8 @@ "_parent": { "$ref": "AAAAAAGHs05THaD99yA=" }, - "name": "nom string" + "name": "nom string", + "type": "" }, { "_type": "UMLAttribute", @@ -3310,7 +3916,8 @@ "_parent": { "$ref": "AAAAAAGHs05THaD99yA=" }, - "name": "info string" + "name": "info string", + "type": "" } ], "operations": [ @@ -3378,7 +3985,8 @@ "_parent": { "$ref": "AAAAAAGHs2KFbafzENs=" }, - "name": "nom string" + "name": "nom string", + "type": "" }, { "_type": "UMLAttribute", @@ -3386,7 +3994,8 @@ "_parent": { "$ref": "AAAAAAGHs2KFbafzENs=" }, - "name": "nb int" + "name": "nb int", + "type": "" }, { "_type": "UMLAttribute", @@ -3394,7 +4003,8 @@ "_parent": { "$ref": "AAAAAAGHs2KFbafzENs=" }, - "name": "info string" + "name": "info string", + "type": "" } ], "operations": [ diff --git a/essai1/ConsoleApp1/ConsoleApp1.csproj b/essai1/Console/Console.csproj similarity index 72% rename from essai1/ConsoleApp1/ConsoleApp1.csproj rename to essai1/Console/Console.csproj index b073a98..b4654f0 100644 --- a/essai1/ConsoleApp1/ConsoleApp1.csproj +++ b/essai1/Console/Console.csproj @@ -1,4 +1,4 @@ - + Exe @@ -8,6 +8,7 @@ + diff --git a/essai1/Console/Program.cs b/essai1/Console/Program.cs new file mode 100644 index 0000000..95223db --- /dev/null +++ b/essai1/Console/Program.cs @@ -0,0 +1,105 @@ +using Model; + +namespace MyProject; +class Program +{ + static void Main(string[] args) + { + menusPrincipal(); + //testdebase(); + //testCompte(); + //testAnimal(); + //testRace(); + } + + private static void menusPrincipal() + { + Console.WriteLine("Menus principal"); + Console.WriteLine("1- Les espèces"); + Console.WriteLine("2- Le animaux"); + Console.WriteLine("9- Quitter"); + + Console.Write("Entrer votre choix : "); + int choix = Convert.ToInt32(Console.ReadLine()); + + switch (choix) + { + case 1: + menusEspece(); + break; + case 2: + menusAnimal(); + break; + case 9: + return; + default: + Console.WriteLine("Choix incorrect"); + break; + } + } + + private static void menusEspece() + { + Console.WriteLine("Menus des espèces"); + Console.WriteLine("1- Afficher les espèces"); + Console.WriteLine("2- "); + Console.WriteLine("9- Quitter"); + + Console.Write("Entrer votre choix : "); + int choix = Convert.ToInt32(Console.ReadLine()); + + switch (choix) + { + case 1: + break; + case 9: + return; + default: + Console.WriteLine("Choix incorrect"); + break; + } + } + + private static void menusAnimal() + { + Console.WriteLine("Menus des animaux"); + Console.WriteLine("1- Afficher les animaux"); + Console.WriteLine("2- "); + Console.WriteLine("9- Quitter"); + + Console.Write("Entrer votre choix : "); + int choix = Convert.ToInt32(Console.ReadLine()); + + switch (choix) + { + case 1: + break; + case 9: + return; + default: + Console.WriteLine("Choix incorrect"); + break; + } + } + + private static void testdebase() + { + HashSet animaux = new HashSet(); + animaux.Add(new("Chien", "Les chiens sont l'un des animaux les plus populaires et appréciés dans le monde entier.")); + animaux.Add(new("Chat", "Les chats sont les meilleurs animaux pour faire de la ronron thérapie.")); + animaux.Add(new("Hamster", "Les hamster meurent facilement.")); + + Race boxer = new("Boxer"); + + //chien.afficherInfoUtile(); + } + + void testAnimal() + { + + } + void testRace() + { + + } +} \ No newline at end of file diff --git a/essai1/ConsoleApp1/Program.cs b/essai1/ConsoleApp1/Program.cs deleted file mode 100644 index d7d7b89..0000000 --- a/essai1/ConsoleApp1/Program.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Model; -namespace ConsoleApp1 -{ - internal class Program - { - private static void Main(string[] args) - { - void testdebase() - { - - Console.WriteLine("Hello, World!"); - Animal chien = new("chien", "Les chiens sont l'un des animaux les plus populaires et appréciés dans le monde entier. Ils peuvent être de merveilleux compagnons pour les enfants, les adultes et les personnes âgées. Cependant, il est important de comprendre les besoins et les soins nécessaires pour garder un chien heureux et en bonne santé. Voici quelques informations utiles à connaître pour les propriétaires de chiens potentiels : \r\n 1) L'exercice est essentiel : les chiens ont besoin de beaucoup d'exercice pour rester en forme et pour maintenir une bonne santé physique et mentale. Les promenades quotidiennes et les jeux de plein air sont recommandés pour les chiens de tous âges et de toutes races. \r\n 2) Une alimentation saine est importante : les chiens ont besoin d'une alimentation équilibrée et adaptée à leur âge, leur race et leur niveau d'activité. Il est important de leur donner une nourriture de qualité et de ne pas leur donner des aliments qui peuvent leur nuire. \r\n 3) Les soins vétérinaires sont nécessaires : les chiens ont besoin de soins vétérinaires réguliers pour prévenir les maladies et les problèmes de santé. Les vaccins, les examens annuels et les traitements préventifs sont essentiels pour garder un chien en bonne santé. \r\n 4) Les chiens ont besoin de compagnie : les chiens sont des animaux sociaux et ont besoin de compagnie pour éviter l'ennui et l'anxiété. Si vous n'êtes pas en mesure de passer beaucoup de temps avec votre chien, il est important de lui fournir une compagnie de substitution, comme un autre chien ou un animal en peluche. \r\n 5) Les chiens ont besoin de dressage : les chiens ont besoin d'être dressés pour être des membres de la famille respectueux et obéissants. Le dressage peut également aider à prévenir les comportements destructeurs et les problèmes de comportement. ","rien"); - - Race boxer = new("boxer"); - Compte benjamin = new("benjamin", "1234"); - Compte liam = new("liam", "0000"); - - benjamin.AfficherNom(); - liam.AfficherNom(); - chien.afficherInfoUtile(); - } - void testCompte() - { - - } - void testAnimal() - { - - } - void testRace() - { - - } - - - testdebase(); - testCompte(); - testAnimal(); - testRace(); - } - } -} \ No newline at end of file diff --git a/essai1/Model/Animal.cs b/essai1/Model/Animal.cs index 3433ba5..6f7da51 100644 --- a/essai1/Model/Animal.cs +++ b/essai1/Model/Animal.cs @@ -5,35 +5,27 @@ namespace Model { public class Animal { - public int nb_animal=1; public string Nom { get; set; } - public string InfoUtile { get; set; } - public string Conseille { get; set; } + public string Info { get; set; } - public Animal(string nom, string infoUtile = "rien", string conseille = "rien") + public Animal(string nom, string info = "Aucune information") { Nom = nom; - InfoUtile = infoUtile; - Conseille = conseille; - nb_animal = nb_animal + 1; + Info = info; } public void AfficherlisteRace() { + /* for (int i = 0; i < nb_animal; i++) { Console.WriteLine(Nom); } + */ } public void afficherInfoUtile() { - Console.WriteLine(InfoUtile); + Console.WriteLine(Info); } - public void AfficherConseille() - { - Console.WriteLine(Conseille); - } - - } } diff --git a/essai1/Model/Compte.cs b/essai1/Model/Compte.cs deleted file mode 100644 index 3687afa..0000000 --- a/essai1/Model/Compte.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - public class Compte - { - public string Nom { get; set; } - public string Mdp { get; set; } - public Compte(string nom, string mdp) - { - Nom = nom; - Mdp = mdp; - } - public void AfficherNom() - { - Console.WriteLine(Nom); - } - - - - public void SeConnection(string Nom, string Mdp) - { - - } - public void CreerCompte() - { - - } - public void MotdepasseOublier() - { - - } - public void ListeAnimauxCompte() - { - - } - } -} diff --git a/essai1/Model/Espece.cs b/essai1/Model/Espece.cs new file mode 100644 index 0000000..f9de2f1 --- /dev/null +++ b/essai1/Model/Espece.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class Espece + { + public string Nom { get; set; } + public string Info { get; set; } + public string Conseil { get; set; } + public HashSet Races { get; set; } = new HashSet(); + + public Espece(string nom, string info = "Aucune information", string conseil = "Aucun conseil") + { + Nom = nom; + Info = info; + Conseil = conseil; + } + } +} diff --git a/essai1/Model/Model.csproj b/essai1/Model/Model.csproj index d439800..4658cbf 100644 --- a/essai1/Model/Model.csproj +++ b/essai1/Model/Model.csproj @@ -1,7 +1,6 @@ - Exe net7.0 enable enable diff --git a/essai1/Model/Option.cs b/essai1/Model/Option.cs deleted file mode 100644 index c38d1b4..0000000 --- a/essai1/Model/Option.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Quic; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - internal class Option - { - public int num_option = 0; - public string name { get; set; } - public Option(string name) - { - this.name = name; - } - - public string GetName() - { - return name; - } - - public void ListerOptions(string name) - { - for (int i = 0; i < num_option; i++) - { - Console.WriteLine(name); - } - } - public void Choixoption(int choix) - { - num_option = choix; - } - } -} diff --git a/essai1/Model/Race.cs b/essai1/Model/Race.cs index 137e22e..0b52f7b 100644 --- a/essai1/Model/Race.cs +++ b/essai1/Model/Race.cs @@ -7,13 +7,13 @@ namespace Model public int nb_race = 1; public string Nom { get; set; } public string InfoUtile { get; set; } - public string Conseille { get; set; } + public string Conseil { get; set; } - public Race(string nom, string infoUtile = "rien", string conseille="rien" ) + public Race(string nom, string infoUtile = "Aucune information", string conseil = "Aucun conseil" ) { Nom = nom; InfoUtile = infoUtile; - Conseille = conseille; + Conseil = conseil; nb_race = nb_race + 1; } @@ -30,7 +30,7 @@ namespace Model } public void AfficherConseille() { - Console.WriteLine(Conseille); + Console.WriteLine(Conseil); } } diff --git a/essai1/Model/System.cs b/essai1/Model/System.cs index 1c28551..8740ca9 100644 --- a/essai1/Model/System.cs +++ b/essai1/Model/System.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; @@ -10,11 +11,12 @@ namespace Model internal class System { public bool theme_color = true; - public int num_page = 0 ; + HashSet listeAnimaux = new HashSet(); + //HashSet listeAnimaux = new HashSet(); public System() { } public void ChangeColor() { - if (theme_color = true) + if (theme_color == true) theme_color = false; else theme_color = true; } @@ -22,14 +24,14 @@ namespace Model { if (nom == null) { - Console.WriteLine("Aucun animal qui s'appele", nom); + Console.WriteLine("Aucun animal ne s'appelle " + nom); return; } } public void Retour() { - num_page = num_page - 1; + //num_page = num_page - 1; } } diff --git a/essai1/essai1.sln b/essai1/essai1.sln index f8efeb5..a1feb66 100644 --- a/essai1/essai1.sln +++ b/essai1/essai1.sln @@ -5,12 +5,9 @@ VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "essai1", "essai1\essai1.csproj", "{DCEA858F-145E-4308-B0B9-CE868DE0B48B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{26C79316-F8AC-4BBF-9735-F2B63A6EBD99}" - ProjectSection(ProjectDependencies) = postProject - {8BDA8C74-DE03-48C3-8B24-B4A2D623AE04} = {8BDA8C74-DE03-48C3-8B24-B4A2D623AE04} - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console\Console.csproj", "{BD04EBFD-20F9-4668-A53D-751F5226C119}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{8BDA8C74-DE03-48C3-8B24-B4A2D623AE04}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{A0117958-E2B2-4659-B768-44640ABC5C76}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -24,14 +21,14 @@ Global {DCEA858F-145E-4308-B0B9-CE868DE0B48B}.Release|Any CPU.ActiveCfg = Release|Any CPU {DCEA858F-145E-4308-B0B9-CE868DE0B48B}.Release|Any CPU.Build.0 = Release|Any CPU {DCEA858F-145E-4308-B0B9-CE868DE0B48B}.Release|Any CPU.Deploy.0 = Release|Any CPU - {26C79316-F8AC-4BBF-9735-F2B63A6EBD99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {26C79316-F8AC-4BBF-9735-F2B63A6EBD99}.Debug|Any CPU.Build.0 = Debug|Any CPU - {26C79316-F8AC-4BBF-9735-F2B63A6EBD99}.Release|Any CPU.ActiveCfg = Release|Any CPU - {26C79316-F8AC-4BBF-9735-F2B63A6EBD99}.Release|Any CPU.Build.0 = Release|Any CPU - {8BDA8C74-DE03-48C3-8B24-B4A2D623AE04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BDA8C74-DE03-48C3-8B24-B4A2D623AE04}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BDA8C74-DE03-48C3-8B24-B4A2D623AE04}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BDA8C74-DE03-48C3-8B24-B4A2D623AE04}.Release|Any CPU.Build.0 = Release|Any CPU + {BD04EBFD-20F9-4668-A53D-751F5226C119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD04EBFD-20F9-4668-A53D-751F5226C119}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD04EBFD-20F9-4668-A53D-751F5226C119}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD04EBFD-20F9-4668-A53D-751F5226C119}.Release|Any CPU.Build.0 = Release|Any CPU + {A0117958-E2B2-4659-B768-44640ABC5C76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0117958-E2B2-4659-B768-44640ABC5C76}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0117958-E2B2-4659-B768-44640ABC5C76}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0117958-E2B2-4659-B768-44640ABC5C76}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/essai1/essai1/MainPage.xaml.cs b/essai1/essai1/MainPage.xaml.cs index a862db5..4900b7f 100644 --- a/essai1/essai1/MainPage.xaml.cs +++ b/essai1/essai1/MainPage.xaml.cs @@ -1,24 +1,2 @@ namespace essai1; -public partial class MainPage : ContentPage -{ - int count = 0; - - public MainPage() - { - InitializeComponent(); - } - - private void OnCounterClicked(object sender, EventArgs e) - { - count++; - - if (count == 1) - CounterBtn.Text = $"Clicked {count} time"; - else - CounterBtn.Text = $"Clicked {count} times"; - - SemanticScreenReader.Announce(CounterBtn.Text); - } -} -