예제 #1
0
        private void DanhSachThongKe()
        {
            try
            {
                int            i      = 0;
                List <ThongKe> tklist = tkbll.ThongKePhieuNhap();
                foreach (ThongKe tks in tklist)
                {
                    DataGridViewRow row = new DataGridViewRow();
                    row.CreateCells(dgvThongKePhieuNhap);
                    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.Sld.ToString();
                    row.Cells[6].Value = tks.Sln.ToString();
                    row.Cells[7].Value = tks.Slcl.ToString();
                    row.Cells[8].Value = tks.DonGia.ToString();
                    row.Cells[9].Value = tks.ThanhTien.ToString();

                    dgvThongKePhieuNhap.Rows.Add(row);
                    ++i;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }