/// <summary> /// Get all the Articles saved in the referenced Marque passed to the method. /// </summary> /// <param name="RefMarque">The reference of the Marque that contains all returned Articles.</param> public void ShowArticleforMarques(int RefMarque) { List <ArticlesModel> ArticlesToVis = ArticlesDao.SelectByMarque(RefMarque); TypeShown = "Articles"; ListToDisplay.Clear(); ListToDisplay.Columns.Add("Description", -2, HorizontalAlignment.Left); ListToDisplay.Columns.Add("Famille", -2, HorizontalAlignment.Left); ListToDisplay.Columns.Add("Sous-Famille", -2, HorizontalAlignment.Left); ListToDisplay.Columns.Add("Marque", -2, HorizontalAlignment.Left); ListToDisplay.Columns.Add("Quantite", -2, HorizontalAlignment.Left); foreach (ArticlesModel Article in ArticlesToVis) { var Item = new ListViewItem(Article.Description, 0); Item.SubItems.Add(Article.SousFamille.Famille.Nom); Item.SubItems.Add(Article.SousFamille.Nom); Item.SubItems.Add(Article.Marque.Nom); Item.SubItems.Add(Article.Quantite.ToString()); ListToDisplay.Items.Add(Item); Item.Name = Article.RefArticle; } }