private void cboNhaSx_TextChanged(object sender, EventArgs e) { if (cboNhaSx.Text == "") { DanhSachThongKe(); return; } //cboTenSp.Text = ""; int i = 0; int Sum = 0; tk.TenSx = cboNhaSx.Text; List <ThongKe> tklist = tkbll.ThongKePHieuXuatTHeoNhaSx(tk); dgvThongKePhieuXuat.Rows.Clear(); foreach (ThongKe tks in tklist) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dgvThongKePhieuXuat); row.Cells[0].Value = i + 1; row.Cells[1].Value = tks.MaSp.ToString(); row.Cells[2].Value = tks.TenSp.ToString(); row.Cells[3].Value = tks.TenLoai.ToString(); row.Cells[4].Value = tks.TenSx.ToString(); row.Cells[5].Value = tks.TenKh.ToString(); row.Cells[6].Value = tks.Slx.ToString(); row.Cells[7].Value = tks.TongTien; row.Cells[8].Value = tks.PhanTram.ToString(); row.Cells[9].Value = tks.ThanhTien; dgvThongKePhieuXuat.Rows.Add(row); ++i; Sum += i; } cboTongPhieuXuat.Text = i.ToString(); List <ThongKe> tklist1 = tkbll.TinhTongSlpxTheoNhaSanXuat(tk); List <ThongKe> tklist2 = tkbll.TinhTongThanhTienTheoNhaSanXuat(tk); foreach (ThongKe tks1 in tklist1) { cboTongSoLuongXuat.Text = tks1.Slx.ToString(); } foreach (ThongKe tks2 in tklist2) { cboTongTien.Text = tks2.ThanhTien.ToString(); } }