Ajout plusieurs methodes et debut adaptation program.cs

vSonar_test
Liam MONCHANIN 2 years ago
parent cfad4a3ec6
commit 4f4d86b107

@ -781,7 +781,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 1040,
"top": -144,
"top": -112,
"height": 13
},
{
@ -792,7 +792,7 @@
},
"font": "Arial;13;1",
"left": 797,
"top": 463,
"top": 479,
"width": 205.2578125,
"height": 13,
"text": "Utilisateur"
@ -806,7 +806,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 1040,
"top": -144,
"top": -112,
"width": 73.67724609375,
"height": 13,
"text": "(from Model)"
@ -820,14 +820,14 @@
"visible": false,
"font": "Arial;13;0",
"left": 1040,
"top": -144,
"top": -112,
"height": 13,
"horizontalAlignment": 1
}
],
"font": "Arial;13;0",
"left": 792,
"top": 456,
"top": 472,
"width": 215.2578125,
"height": 25,
"stereotypeLabel": {
@ -864,7 +864,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 486,
"top": 502,
"width": 205.2578125,
"height": 13,
"text": "-/pseudo: string",
@ -881,7 +881,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 501,
"top": 517,
"width": 205.2578125,
"height": 13,
"text": "-/mail: string",
@ -898,7 +898,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 516,
"top": 532,
"width": 205.2578125,
"height": 13,
"text": "-/password: string",
@ -915,7 +915,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 531,
"top": 547,
"width": 205.2578125,
"height": 13,
"text": "-connecter: bool",
@ -932,7 +932,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 546,
"top": 562,
"width": 205.2578125,
"height": 13,
"text": "-notetaged: map<note, List<Tags>>",
@ -941,7 +941,7 @@
],
"font": "Arial;13;0",
"left": 792,
"top": 481,
"top": 497,
"width": 215.2578125,
"height": 83
},
@ -966,7 +966,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 569,
"top": 585,
"width": 205.2578125,
"height": 13,
"text": "+SetPassword()",
@ -983,7 +983,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 584,
"top": 600,
"width": 205.2578125,
"height": 13,
"text": "+AjouterFav()",
@ -1000,7 +1000,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 599,
"top": 615,
"width": 205.2578125,
"height": 13,
"text": "+SupFav()",
@ -1017,7 +1017,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 614,
"top": 630,
"width": 205.2578125,
"height": 13,
"text": "+AjouterNote()",
@ -1034,7 +1034,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 629,
"top": 645,
"width": 205.2578125,
"height": 13,
"text": "+SupNote()",
@ -1051,7 +1051,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 644,
"top": 660,
"width": 205.2578125,
"height": 13,
"text": "+AjouterTag()",
@ -1068,7 +1068,7 @@
},
"font": "Arial;13;0",
"left": 797,
"top": 659,
"top": 675,
"width": 205.2578125,
"height": 13,
"text": "+SupTag()",
@ -1077,7 +1077,7 @@
],
"font": "Arial;13;0",
"left": 792,
"top": 564,
"top": 580,
"width": 215.2578125,
"height": 113
},
@ -1092,8 +1092,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 512,
"top": -80,
"left": 504,
"top": -72,
"width": 10,
"height": 10
},
@ -1108,8 +1108,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 842.5927734375,
"top": 448,
"left": 834.5927734375,
"top": 456,
"width": 130.6689453125,
"height": 10
}
@ -1117,9 +1117,9 @@
"font": "Arial;13;0",
"containerChangeable": true,
"left": 792,
"top": 456,
"top": 472,
"width": 215.2578125,
"height": 251,
"height": 221,
"nameCompartment": {
"$ref": "AAAAAAGHszJKAWG1eoU="
},
@ -1518,11 +1518,30 @@
"model": {
"$ref": "AAAAAAGHs2HK4mc6StU="
},
"subViews": [
{
"_type": "UMLOperationView",
"_id": "AAAAAAGH6+RfvRFVmfE=",
"_parent": {
"$ref": "AAAAAAGHs2HK42dDsQM="
},
"model": {
"$ref": "AAAAAAGH6+RfrBFS0Bc="
},
"font": "Arial;13;0",
"left": 773,
"top": 844,
"width": 160.4052734375,
"height": 13,
"text": "+ChangeColor()",
"horizontalAlignment": 0
}
],
"font": "Arial;13;0",
"left": 768,
"top": 839,
"width": 170.4052734375,
"height": 10
"height": 23
},
{
"_type": "UMLReceptionCompartmentView",
@ -1562,7 +1581,7 @@
"left": 768,
"top": 776,
"width": 170.4052734375,
"height": 73,
"height": 86,
"nameCompartment": {
"$ref": "AAAAAAGHs2HK42c9P1Y="
},
@ -1601,7 +1620,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 647,
"top": 657,
"top": 658,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 15,
@ -1622,7 +1641,7 @@
"visible": null,
"font": "Arial;13;0",
"left": 651,
"top": 671,
"top": 672,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 30,
@ -1643,7 +1662,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 640,
"top": 628,
"top": 629,
"height": 13,
"alpha": -1.5707963267948966,
"distance": 15,
@ -1664,7 +1683,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 769,
"top": 625,
"top": 626,
"height": 13,
"alpha": 0.5235987755982988,
"distance": 30,
@ -1684,8 +1703,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 771,
"top": 638,
"left": 770,
"top": 639,
"height": 13,
"alpha": 0.7853981633974483,
"distance": 40,
@ -1706,7 +1725,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 766,
"top": 597,
"top": 598,
"height": 13,
"alpha": -0.5235987755982988,
"distance": 25,
@ -1748,7 +1767,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 531,
"top": 702,
"top": 703,
"height": 13,
"alpha": -0.7853981633974483,
"distance": 40,
@ -1818,7 +1837,7 @@
"$ref": "AAAAAAGHszJKAGG0NQ0="
},
"lineStyle": 1,
"points": "791:610;497:689",
"points": "791:611;497:689",
"showVisibility": true,
"nameLabel": {
"$ref": "AAAAAAGHwVHBhl/Apoc="
@ -1876,7 +1895,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 884,
"top": 403,
"top": 411,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 15,
@ -1897,7 +1916,7 @@
"visible": null,
"font": "Arial;13;0",
"left": 869,
"top": 403,
"top": 411,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 30,
@ -1918,7 +1937,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 913,
"top": 404,
"top": 412,
"height": 13,
"alpha": -1.5707963267948966,
"distance": 15,
@ -1939,7 +1958,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 884,
"top": 422,
"top": 438,
"height": 13,
"alpha": 0.5235987755982988,
"distance": 30,
@ -1959,8 +1978,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 871,
"top": 420,
"left": 870,
"top": 436,
"height": 13,
"alpha": 0.7853981633974483,
"distance": 40,
@ -1981,7 +2000,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 911,
"top": 427,
"top": 443,
"height": 13,
"alpha": -0.5235987755982988,
"distance": 25,
@ -2023,7 +2042,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 871,
"top": 387,
"top": 388,
"height": 13,
"alpha": -0.7853981633974483,
"distance": 40,
@ -2093,7 +2112,7 @@
"$ref": "AAAAAAGHszJKAGG0NQ0="
},
"lineStyle": 1,
"points": "899:455;900:366",
"points": "899:471;900:366",
"showVisibility": true,
"nameLabel": {
"$ref": "AAAAAAGHwVctnIUNaCs="
@ -2171,8 +2190,8 @@
},
"visible": null,
"font": "Arial;13;0",
"left": 814,
"top": 422,
"left": 815,
"top": 423,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 30,
@ -2211,7 +2230,7 @@
"$ref": "AAAAAAGHsxLjH2EVAzI="
},
"lineStyle": 3,
"points": "528:425;792:448;798:455",
"points": "528:425;792:448;810:471",
"showVisibility": true,
"nameLabel": {
"$ref": "AAAAAAGHwV2zBOCQoPw="
@ -2308,7 +2327,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 765,
"top": 591,
"top": 592,
"height": 13,
"alpha": 0.5235987755982988,
"distance": 30,
@ -2328,8 +2347,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 763,
"top": 604,
"left": 762,
"top": 605,
"height": 13,
"alpha": 0.7853981633974483,
"distance": 40,
@ -2350,7 +2369,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 769,
"top": 563,
"top": 564,
"height": 13,
"alpha": -0.5235987755982988,
"distance": 25,
@ -2462,7 +2481,7 @@
"$ref": "AAAAAAGHszJKAGG0NQ0="
},
"lineStyle": 3,
"points": "791:582;648:584;528:491",
"points": "791:583;648:584;528:491",
"showVisibility": true,
"nameLabel": {
"$ref": "AAAAAAGHwV3a5OQ2Hy0="
@ -2889,7 +2908,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 654,
"top": 504,
"top": 505,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 15,
@ -2910,7 +2929,7 @@
"visible": null,
"font": "Arial;13;0",
"left": 649,
"top": 518,
"top": 519,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 30,
@ -2931,7 +2950,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 663,
"top": 475,
"top": 476,
"height": 13,
"alpha": -1.5707963267948966,
"distance": 15,
@ -2952,7 +2971,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 761,
"top": 542,
"top": 543,
"height": 13,
"alpha": 0.5235987755982988,
"distance": 30,
@ -2973,7 +2992,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 754,
"top": 554,
"top": 555,
"height": 13,
"alpha": 0.7853981633974483,
"distance": 40,
@ -2994,7 +3013,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 774,
"top": 517,
"top": 518,
"height": 13,
"alpha": -0.5235987755982988,
"distance": 25,
@ -3014,7 +3033,7 @@
},
"font": "Arial;13;0",
"left": 551,
"top": 463,
"top": 464,
"width": 68.9990234375,
"height": 13,
"alpha": 0.002433128081675673,
@ -3036,7 +3055,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 545,
"top": 480,
"top": 481,
"height": 13,
"alpha": -0.7853981633974483,
"distance": 40,
@ -3055,7 +3074,7 @@
},
"font": "Arial;13;0",
"left": 538,
"top": 463,
"top": 464,
"width": 6.5,
"height": 13,
"alpha": -0.6366393122007756,
@ -3104,7 +3123,7 @@
"$ref": "AAAAAAGHszJKAGG0NQ0="
},
"lineStyle": 1,
"points": "791:543;528:450",
"points": "791:544;528:451",
"showVisibility": true,
"nameLabel": {
"$ref": "AAAAAAGHwW45PViwqGs="
@ -3162,7 +3181,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 635,
"top": 741,
"top": 744,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 15,
@ -3182,8 +3201,8 @@
},
"visible": null,
"font": "Arial;13;0",
"left": 638,
"top": 726,
"left": 639,
"top": 729,
"height": 13,
"alpha": 1.5707963267948966,
"distance": 30,
@ -3204,7 +3223,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 628,
"top": 770,
"top": 773,
"height": 13,
"alpha": -1.5707963267948966,
"distance": 15,
@ -3225,7 +3244,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 525,
"top": 716,
"top": 718,
"height": 13,
"alpha": 0.5235987755982988,
"distance": 30,
@ -3245,8 +3264,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 530,
"top": 703,
"left": 531,
"top": 706,
"height": 13,
"alpha": 0.7853981633974483,
"distance": 40,
@ -3267,7 +3286,7 @@
"visible": false,
"font": "Arial;13;0",
"left": 515,
"top": 742,
"top": 744,
"height": 13,
"alpha": -0.5235987755982988,
"distance": 25,
@ -3287,7 +3306,7 @@
},
"font": "Arial;13;0",
"left": 692,
"top": 763,
"top": 768,
"width": 71.169921875,
"height": 13,
"alpha": -0.30805284668983113,
@ -3308,8 +3327,8 @@
},
"visible": false,
"font": "Arial;13;0",
"left": 745,
"top": 753,
"left": 746,
"top": 757,
"height": 13,
"alpha": -0.7853981633974483,
"distance": 40,
@ -3328,7 +3347,7 @@
},
"font": "Arial;13;0",
"left": 740,
"top": 794,
"top": 799,
"width": 6.5,
"height": 13,
"alpha": 0.5235987755982988,
@ -3375,7 +3394,7 @@
"$ref": "AAAAAAGHsxATrmDNnOM="
},
"lineStyle": 1,
"points": "497:731;767:793",
"points": "497:733;767:798",
"showVisibility": true,
"nameLabel": {
"$ref": "AAAAAAGHwXrkljsZ58k="
@ -4934,6 +4953,16 @@
"visibility": "private",
"type": "list <string>"
}
],
"operations": [
{
"_type": "UMLOperation",
"_id": "AAAAAAGH6+RfrBFS0Bc=",
"_parent": {
"$ref": "AAAAAAGHs2HK4mc6StU="
},
"name": "ChangeColor"
}
]
},
{

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -23,18 +25,49 @@ namespace Biblioteque_de_Class
{
foreach (Logo logo in ListDefaultLogo)
{
if (logo.Name == Name) { return logo.Link; }
if (logo.Nom == Name) { return logo.LinkLogo; }
}throw new Exception("no logo link find");
}
public Utilisateur GetUtilisateur(string Name) {
foreach(Utilisateur user in ListUtilisateur) {
if(user.Pseudo == Name)
foreach(Utilisateur user in ListUtilisateur){
if(user.Pseudo.get == Name)
{
return user;
}
}throw new Exception("no user find with this pseudo");
}
public bool CorrespondPassword(string Psd)
{
foreach (Utilisateur Mdp in ListUtilisateur)
{
if (string.Equals(Psd, Mdp))
{
return true;
}
else
{
return false;
}
}
return false;
}
public bool TrouverMail(string mail)
{
foreach (Utilisateur Mail in ListUtilisateur)
{
if (string.Equals(mail,Mail))
{
return true;
}
else
{
return false;
}
}
return false;
}
}
}

@ -6,17 +6,21 @@ using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
internal class Note
public class Note
{
public string Nom {
public string Nom
{
get { return Nom; }
set { if (value==null) { Nom = "Note sans nom"; } else { Nom = value; } }
set { if (value == null) { Nom = "Note sans nom"; } else { Nom = value; } }
}
public string LogoPATH {
///private string Text { get; set; } Attribut pour le texte de la note
public string LogoPATH
{
get { return LogoPATH; }
set { if (value == null) { LogoPATH = "PATH TO DEFAULT LOGO"; } else { LogoPATH = value; } }
}
private DateOnly DateCreation { get; set; }
private DateOnly DateCreation { get;}
public List<Tags> atributionTag;
public List<String> listeImage;
@ -34,25 +38,26 @@ namespace Biblioteque_de_Class
owner = uOwner;
}
/// public Note RechercherNote(List<Note> listeNote, string nom)
/// {
/// List<Note> newListNote = new List<Note>();
/// foreach (Note note in listeNote)
/// {
/// if (note.Nom == nom)
/// {
///
/// }
/// }
/// return newListNote;
/// }
/// public Note RechercherNote(List<Note> listeNote, string nom)
/// {
/// List<Note> newListNote = new List<Note>();
/// foreach (Note note in listeNote)
/// {
/// if (note.Nom == nom)
/// {
///
/// }
/// }
/// return newListNote;
/// }
public override string ToString() => $"note -> nom : {Nom}\nlogoPATH : {LogoPATH}\nhow many line : {listeLigneTexte.Count()}";
public void AjouterTag(List<Tags> listNote, string name) {
foreach(Tags tag in listNote)
public void AjouterTag(List<Tags> listNote, string name)
{
foreach (Tags tag in listNote)
{
if(tag.Nom == name)
if (tag.Nom == name)
{
atributionTag.Add(tag);
}
@ -62,9 +67,9 @@ namespace Biblioteque_de_Class
public void SupTag(string name)
{
foreach(Tags tag in atributionTag)
foreach (Tags tag in atributionTag)
{
if(tag.Nom == name)
if (tag.Nom == name)
{
atributionTag.Remove(tag);
}
@ -72,9 +77,58 @@ namespace Biblioteque_de_Class
throw new Exception("no tag find with this name");
}
public bool VerifOwner(Utilisateur user) {
public bool VerifOwner(Utilisateur user)
{
if (owner == user)
return true;
else
return false;
}
public bool ModifRole(Utilisateur user,int choix)
{
if (editeurs.Contains(user))
{
editeurs.Remove(user);
cooperateurs.Add(user);
return true;
}
if (cooperateurs.Contains(user) && choix==1)
{
cooperateurs.Remove(user);
editeurs.Add(user);
return true;
}
else
{
cooperateurs.Remove(user);
}
return ;
return false;
}
public bool AjouterImage(string image)
{
if (listeImage.Contains(image))
{
return false;
}
else
{
return true;
}
}
public bool SuppImage(string image)
{
if (listeImage.Contains(image))
{
listeImage.Remove(image);
return true;
}
else
{
return false;
}
}
}
}

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
internal class Tags
public class Tags
{
public string Nom { get; set; }
public string Couleur { get; set; }

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
internal class Theme
public class Theme
{
public string Nom { get; set; }
List<string> ListCouleur;

@ -1,4 +1,5 @@
using System.ComponentModel;
using Microsoft.VisualBasic.FileIO;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
///https://learn.microsoft.com/fr-fr/windows/apps/design/
@ -31,8 +32,63 @@ namespace Biblioteque_de_Class
{
foreach(Note notefav in ListFav)
{
if (notefav.Nom)
if (!notefav.Equals(note))
{
ListFav.Add(note);
return true;
}
}
return false;
}
public bool SuppFav(List<Note> ListFav, Note note)
{
foreach (Note notefav in ListFav)
{
if (notefav.Nom.Equals(note))
{
ListFav.Remove(note);
return true;
}
}
return false;
}
public void AjouterNote(string nom, string LogoPath)
{
Note note = new Note(nom, LogoPath,this);
NoteList.Add(note);
}
public void SuppNote(Note note)
{
if (NoteList.Contains(note))
NoteList.Remove(note);
}
/*public void AjouterTag(List<Tags> listNote, string name) {
foreach(Tags tag in listNote)
{
if(tag.Nom == name)
{
atributionTag.Add(tag);
}
}
throw new Exception("no tag find with this name");
}
public void SupTag(string name)
{
foreach(Tags tag in atributionTag)
{
if(tag.Nom == name)
{
atributionTag.Remove(tag);
}
}
throw new Exception("no tag find with this name");
}*/
/// Je laisse en attendant, sur l'uml c'est dans utilisateur mais y a les methodes dans note
}
}

@ -9,6 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
<ProjectReference Include="..\notus\notus.csproj" />
</ItemGroup>
</Project>

@ -2,6 +2,9 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
Database db= new Database();
Utilisateur u = new Utilisateur(Upseudo, Umail, Upassword);
int boucle = 0;
while (boucle == 0){
int choix = 0;
@ -42,31 +45,31 @@ while (boucle == 0){
switch (Console.ReadLine())
{
case "1":
Database.RechercherPseudo();
Database.TrouverMail();
Database.CorrespondPassword();
db.GetUtilisateur("Name");
db.TrouverMail("Mail");
db.CorrespondPassword("Psd");
break;
case "2":
break;
case "3":
Utilisateur.Utilisateur(Upseudo, Umail, Upassword);
Database.AjouterBaseData();
Utilisateur u1 = new Utilisateur("Upseudo", "Umail", "Upassword");
db.AjouterBaseData();
break;
case "4":
Database.RecherhcerPseudo();
Database.TrouverMail();
Database.CorrespondPassword();
Database.SuppBaseData();
db.GetUtilisateur("Name");
db.TrouverMail("Mail");
db.CorrespondPassword("Psd");
db.SuppBaseData();
break;
case "5":
Utilisateur.AjouterNote(NoteList);
Utilisateur.AjouterNote();
break;
case "6":
Utilisateur.SupNote();
Utilisateur.SuppNote();
break;
case "7":
Tags.Tags(nom,couleur);
Tags t= new Tags(nom,couleur);
break;
case "8":
Note.AjouterTag();
@ -124,17 +127,17 @@ while (boucle == 0){
Note.GererPartageNote();
break;
case "25":
Note.VerifProprietaire();
if ()
Note.VerifOwner();
if (true) //A CHANGER
{
Note.ModifRole();
}
break;
case "26":
Note.VerifProprietaire();
if ()
Note.VerifOwner(user);
if (owner==user)
{
Note.ModifRole();
Note.ModifRole(user2);
}
break;
default:

Loading…
Cancel
Save