public List<Article> GetArticleList() { List<Article> AllArticles = new List<Article>(); MySqlCommand = new SqlCommand("select * from [Article]"); dt = Connexion.FunctionToRead(MySqlCommand); dt = MiseEnforme.AdaptDataTableArticle(dt); foreach (DataRow row in dt.Rows) { AllArticles.Add(ConvertRowToArticle(row)); } return AllArticles; }
public int FillDtgListeArticle() { CurrentDataTableArticle = new DALArticle().GetAllArticles(); CurrentDataTableArticleInit = CurrentDataTableArticle; CurrentDataTableArticle = MiseEnforme.AdaptDataTableArticle(CurrentDataTableArticle); dataGridView1.DataSource = CurrentDataTableArticle; if (CurrentDataTableArticle.Rows.Count == 0) { Btn_Modifier.Enabled = false; Btn_Supprimer.Enabled = false; } else { Btn_Modifier.Enabled = true; Btn_Supprimer.Enabled = true; } return(CurrentDataTableArticle.Rows.Count); }