private void btnSelect_Click(object sender, EventArgs e) { CLI_FetchTousClients_Result oCli = (CLI_FetchTousClients_Result)comboBox1.SelectedItem; MainMenu oClFrm = new MainMenu(oCli); oClFrm.ShowDialog(); }
// TAB RESERVATIONS // Récupération du client sélectionné public MainMenu(CLI_FetchTousClients_Result clt) { _Client = clt; InitializeComponent(); InitializeTabOverview(); InitializeTabDetails(); InitializeTabModification(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { CLI_FetchTousClients_Result oCLi = (CLI_FetchTousClients_Result)comboBox1.SelectedItem; txtClientName.Text = oCLi.CLIENT_NOM.ToString() + " " + oCLi.CLIENT_PRENOM.ToString();; } catch (CustomError cEx) { MessageBox.Show(cEx.Message); } catch (Exception ex) { CustomError cEx = new CustomError(666); MessageBox.Show(ex.Message); } }
private void userFormSelect_Load(object sender, EventArgs e) { // populate combobox List <CLI_FetchTousClients_Result> clientList = new List <CLI_FetchTousClients_Result>(); try { clientList = BLClients.GetAllClients(); comboBox1.DataSource = clientList; comboBox1.ValueMember = "CLIENT_ID"; comboBox1.DisplayMember = "CLIENT_LOGIN"; CLI_FetchTousClients_Result oCLi = (CLI_FetchTousClients_Result)comboBox1.SelectedItem; txtClientName.Text = oCLi.CLIENT_NOM.ToString() + " " + oCLi.CLIENT_PRENOM.ToString(); } catch (CustomError cEx) { MessageBox.Show(cEx.Message); } catch (Exception ex) { MessageBox.Show(ex.Message); CustomError cEx = new CustomError(666); } }