diff --git a/notus/Biblioteque_de_Class/Note.cs b/notus/Biblioteque_de_Class/Note.cs index 4760949..6b16f9c 100644 --- a/notus/Biblioteque_de_Class/Note.cs +++ b/notus/Biblioteque_de_Class/Note.cs @@ -40,18 +40,13 @@ namespace Biblioteque_de_Class public override string ToString() => $"note -> nom : {Nom}\nlogoPATH : {LogoPATH}\nhow many line : {listeLigneTexte.Count()}"; - ///public Note RechercherNote(List listeNote, string nom) - /// { - /// List newListNote = new List(); - /// foreach (Note note in listeNote) - /// { - /// if (note.Nom == nom) - /// { - /// - /// } - /// } - /// return newListNote; - /// } + public List RechercherNote(List listeNote, string nom){ + List ListNotesearch = new List(); + string search = nom.Tolower(); + foreach(Note note in listeNote){ + if(note.Nom.Tolower().Contains(search)) { ListNotesearch.Add(note.Nom); } + }return ListNotesearch; + } public void AjouterTag(List listNote, string name) { foreach(Tags tag in listNote){ diff --git a/notus/Biblioteque_de_Class/Tags.cs b/notus/Biblioteque_de_Class/Tags.cs index ab7e76e..f6e3c04 100644 --- a/notus/Biblioteque_de_Class/Tags.cs +++ b/notus/Biblioteque_de_Class/Tags.cs @@ -26,5 +26,14 @@ namespace Biblioteque_de_Class } public override string ToString() => $"tag -> nom : {Nom}\ncouleur : {Couleur}"; + + public Tags RechercherTags(List listtags,string rechercher){ + List ListTagssearch = new List(); + string search = rechercher.Tolower(); + foreach(Tags tag in listtags){ + if(tag.Nom.Tolower().Contains(search)) { ListTagssearch.Add(tag.Nom); } + }return ListTagssearch; + } + } }