Ejemplo n.º 1
0
 /// <summary>
 /// When the comboBox of Famille changed, load all the sousfamilles of current famille.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void comboBox_Famille_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.comboBox_SousFamille.DataSource    = SousFamilleController.FindSousFamillesByFamilleName(this.comboBox_Famille.Text);
     this.comboBox_SousFamille.DisplayMember = "SousFamilleName";
     this.comboBox_SousFamille.ValueMember   = "SousFamilleName";
     this.comboBox_SousFamille.SelectedIndex = -1;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Load the view of ModifyArticle.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ModifyArticle_Load(object sender, EventArgs e)
        {
            this.label_ReferenceArticle.Text = this.Article.RefArticle;
            this.textBox_Description.Text    = this.Article.Description;
            this.textBox_PrixHT.Text         = this.Article.PrixHT.ToString();
            this.textBox_Quantite.Text       = this.Article.Quantite.ToString();

            this.comboBox_Marque.DataSource    = this.ModelList.Marques;
            this.comboBox_Marque.DisplayMember = "MarqueName";
            this.comboBox_Marque.ValueMember   = "MarqueName";
            this.comboBox_Marque.SelectedIndex = this.comboBox_Marque.FindString(Article.Marque.MarqueName);

            this.comboBox_Famille.DataSource    = this.ModelList.Familles;
            this.comboBox_Famille.DisplayMember = "FamilleName";
            this.comboBox_Famille.ValueMember   = "FamilleName";
            this.comboBox_Famille.SelectedIndex = this.comboBox_Famille.FindString(Article.Famille.FamilleName);

            this.comboBox_SousFamille.DataSource    = SousFamilleController.FindSousFamillesByFamilleName(this.comboBox_Famille.Text);
            this.comboBox_SousFamille.DisplayMember = "SousFamilleName";
            this.comboBox_SousFamille.ValueMember   = "SousFamilleName";
            this.comboBox_SousFamille.SelectedIndex = this.comboBox_SousFamille.FindString(Article.SousFamille.SousFamilleName);
        }