ajout de fonction de recherche à note et tags

vSonar_test
Matheo THIERRY 2 years ago
parent 22a8b754d2
commit ca60eb0e64

@ -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<Note> listeNote, string nom)
/// {
/// List<Note> newListNote = new List<Note>();
/// foreach (Note note in listeNote)
/// {
/// if (note.Nom == nom)
/// {
///
/// }
/// }
/// return newListNote;
/// }
public List<Note> RechercherNote(List<Note> listeNote, string nom){
List<Note> ListNotesearch = new List<Note>();
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<Tags> listNote, string name) {
foreach(Tags tag in listNote){

@ -26,5 +26,14 @@ namespace Biblioteque_de_Class
}
public override string ToString() => $"tag -> nom : {Nom}\ncouleur : {Couleur}";
public Tags RechercherTags(List<Tags> listtags,string rechercher){
List<Tags> ListTagssearch = new List<Tags>();
string search = rechercher.Tolower();
foreach(Tags tag in listtags){
if(tag.Nom.Tolower().Contains(search)) { ListTagssearch.Add(tag.Nom); }
}return ListTagssearch;
}
}
}

Loading…
Cancel
Save