public CreerClient() { InitializeComponent(); // ajout des valeurs try { List <ComboxItem> data = new List <ComboxItem>(); foreach (Client unClient in BDDExterne.GetAllClients()) { data.Add(new ComboxItem() { Value = unClient.cliId, Text = unClient.cliNom + " " + unClient.cliPrenom }); } comboBoxListeClient.DisplayMember = "Text"; comboBoxListeClient.DataSource = data; } catch (Exception ex) { Debug.WriteLine(ex); } }
public OuvrirProjet() { InitializeComponent(); List <ComboxItem> data = new List <ComboxItem>(); foreach (Client item in BDDExterne.GetAllClients()) { data.Add(new ComboxItem() { Value = item.cliId, Text = item.cliNom + " " + item.cliPrenom }); } listBoxClient.DisplayMember = "Text"; listBoxClient.DataSource = data; }
void refresh() { try { List <ComboxItem> data = new List <ComboxItem>(); foreach (Client unClient in BDDExterne.GetAllClients()) { data.Add(new ComboxItem() { Value = unClient.cliId, Text = unClient.cliNom + " " + unClient.cliPrenom }); } comboBoxListeClient.DisplayMember = "Text"; comboBoxListeClient.DataSource = data; } catch (Exception ex) { Debug.WriteLine(ex); } }