private static void GestionMenus() { string Rep = ""; do { Console.WriteLine("Choisir une options L pour Liste A pour Ajout S pour sortir"); Rep = Console.ReadLine(); switch (Rep) { case "L": AdherentManager adhMan = new AdherentManager(Configuration._serviceProvider.GetService <IAdherentRepository>()); foreach (Adherent adh in adhMan.Lister()) { Console.WriteLine($"Code {adh.IdAdherent} Nom {adh.NomAdherent} prénom {adh.PrenomAdherent}"); } break; case "A": AdherentManager adhMan2 = new AdherentManager(Configuration._serviceProvider.GetService <IAdherentRepository>()); break; default: break; } } while (Rep != "S"); }
public FrmRecAdherent(string debNom, BindingSource adherentBS) : this() { adherentBSG = adherentBS; AdherentManager adhMan = new AdherentManager(Configuration._serviceProvider.GetService <IAdherentRepository>()); HashSet <Adherent> adherents = adhMan.Lister().Where(a => a.NomAdherent .StartsWith(debNom, StringComparison.CurrentCultureIgnoreCase)).ToHashSet(); if (adherents.Count > 0) { adherentBindingSource.DataSource = adherents; } }
private Adherent SelectionnerAdherentByID(string adherentID) { AdherentManager adhMan = new AdherentManager(Configuration._serviceProvider.GetService <IAdherentRepository>()); return(adhMan.Lister().Where(a => a.IdAdherent == adherentID).FirstOrDefault()); }