private void LoadGrilleContenu(DocStock d) { dgv_contenu.Rows.Clear(); string query = "select * from contenu_stock where stock = " + d.Id + " order by id"; current.Contenus = ContenuStockBLL.List(query); foreach (ContenuStock c in current.Contenus) { AddRowContenu(c); } ResetContenu(); }
private void txt_search_art_TextChanged(object sender, EventArgs e) { string search = txt_search_art.Text.Trim(); if (search.Length > 0) { dgv_contenu.Rows.Clear(); string query = "select c.* from contenu_stock c inner join articles a on c.article = a.id where a.reference like '" + search + "%' or a.designation like '" + search + "%' and c.stock = " + current.Id; List <ContenuStock> l = ContenuStockBLL.List(query); foreach (ContenuStock f in l) { AddRowContenu(f); } ResetContenu(); } else { LoadGrilleContenu(current); } }