private void btnFilter_Click(object sender, EventArgs e) { try { cboNhaSx.Text = ""; cboLoaiSp.Text = ""; int i = 0; tk.DateOne = DateTime.Parse(dtmTuNgay.Value.ToShortDateString()); tk.DateTwo = DateTime.Parse(dtmDenNgay.Value.ToShortDateString()); List <ThongKe> tklist = tkbll.ThongKeDonDatHangTheoNgayThang(tk); dgvThongKeDonHang.Rows.Clear(); foreach (ThongKe tks in tklist) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dgvThongKeDonHang); row.Cells[0].Value = i + 1; row.Cells[1].Value = tks.MaSp; row.Cells[2].Value = tks.TenSp; row.Cells[3].Value = tks.TenLoai; row.Cells[4].Value = tks.TenSx; row.Cells[5].Value = tks.Sld; dgvThongKeDonHang.Rows.Add(row); ++i; } cboTongDondh.Text = i.ToString(); cboTongSldh.DataSource = tkbll.TongSldhTheoNgayDh(tk); } catch (Exception ex) { MessageBox.Show("Lỗi Filter!" + ex.Message); } }