public frmInBaoCaoTongKetMon(BaoCaoTongKetMon[] DS, string mh, string hk)
 {
     Danh_Sach = DS;
     tenHocKi = hk;
     tenMonHoc = mh;
     InitializeComponent();
 }
        private void capNhat()
        {
            if (flag == true)
            {
                LopBUS adapterLop = new LopBUS();
                Lop[] Danh_Sach_Lop = adapterLop.getAllClass_BUS();

                int chi_soHK = combHocKi.SelectedIndex;
                int chi_soMH = combMonHoc.SelectedIndex;

                if (chi_soHK >= 0 && chi_soMH >= 0)
                {
                    HocKi[] HK = (HocKi[])combHocKi.Tag;
                    HocKi KQHK = HK[chi_soHK];
                    MonHoc[] MonHoc = (MonHoc[])combMonHoc.Tag;
                    MonHoc KQMH = MonHoc[chi_soMH];
                    monHoc = KQMH.TenMonHoc;
                    hocKi = KQHK.TenHocKi;

                    DataTable dt = new DataTable();
                    dt.Columns.Add("Stt");
                    dt.Columns.Add("tenLop");
                    dt.Columns.Add("siSo");
                    dt.Columns.Add("soLuongDat");
                    dt.Columns.Add("tiLe");
                    int stt = 0;
                    int i = 0;
                    noiDungBaoCao = new BaoCaoTongKetMon[Danh_Sach_Lop.Length];
                    foreach (Lop lop in Danh_Sach_Lop)
                    {
                        BaoCaoTongKetMon temp = new BaoCaoTongKetMon();
                        DataRow dr = dt.NewRow();
                        dt.Rows.Add(dr);
                        temp.Stt = stt;
                        dr["Stt"] = stt++;
                        dr["tenLop"] = lop.TenLop;
                        dr["siSo"] = lop.SiSo;
                        int soLuongDat = adapterLop.soLuongDat(KQMH.MaMonHoc, KQHK.MaHocKi, lop.MaLop);
                        dr["soLuongDat"] = soLuongDat;
                        dr["tiLe"] = (float)soLuongDat / lop.SiSo * 100 + "%";

                        temp.TenLop = lop.TenLop;
                        temp.SiSo = lop.SiSo;
                        temp.SoLuongDat = soLuongDat;
                        temp.TiLe = (float)soLuongDat / lop.SiSo * 100 + "%";

                        noiDungBaoCao[i] = temp;
                        i++;
                    }
                    dgvBaoCao.DataSource = dt;
                }
            }
        }
 public frmInBaoCaoTongKetHocKi(BaoCaoTongKetMon[] DS, string hk)
 {
     Danh_Sach = DS;
     hocKi = hk;
     InitializeComponent();
 }