public DataTable Get(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@KQHT_DanhSachKhongThiID", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.KQHT_DanhSachKhongThiID));

            return(RunProcedureGet("sp_KQHT_DanhSachKhongThi_Get", colParam));
        }
        public void Delete(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@KQHT_DanhSachKhongThiID", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.KQHT_DanhSachKhongThiID));

            RunProcedure("sp_KQHT_DanhSachKhongThi_Delete", colParam);
        }
        //public void Update(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        //{
        //    var client = new UnimOsServiceClient();
        //    client.cDKQHT_DanhSachKhongThi_Update(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo);
        //    client.Close();
        //    mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
        //    mErrorNumber = oDKQHT_DanhSachKhongThi.ErrorNumber;
        //}

        //public void Delete(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        //{
        //    var client = new UnimOsServiceClient();
        //    client.cDKQHT_DanhSachKhongThi_Delete(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo);
        //    client.Close();
        //    mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
        //    mErrorNumber = oDKQHT_DanhSachKhongThi.ErrorNumber;
        //}

        public void DeleteDanhSachDuThi(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo, int IDXL_MonHocTrongKy)
        {
            var client = new UnimOsServiceClient();

            client.cDKQHT_DanhSachKhongThi_DeleteDanhSachDuThi(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo, IDXL_MonHocTrongKy);
            client.Close();
            mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
            mErrorNumber  = oDKQHT_DanhSachKhongThi.ErrorNumber;
        }
 public void ToDataRow(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo, ref DataRow dr)
 {
     dr[pKQHT_DanhSachKhongThiInfo.strKQHT_DanhSachKhongThiID] = pKQHT_DanhSachKhongThiInfo.KQHT_DanhSachKhongThiID;
     dr[pKQHT_DanhSachKhongThiInfo.strIDSV_SinhVien]           = pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien;
     dr[pKQHT_DanhSachKhongThiInfo.strIDDM_MonHoc]             = pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc;
     dr[pKQHT_DanhSachKhongThiInfo.strIDDM_NamHoc]             = pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc;
     dr[pKQHT_DanhSachKhongThiInfo.strHocKy] = pKQHT_DanhSachKhongThiInfo.HocKy;
     dr[pKQHT_DanhSachKhongThiInfo.strLyDo]  = pKQHT_DanhSachKhongThiInfo.LyDo;
 }
        public int AddTuDong(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            int ID = 0;

            ID            = oDKQHT_DanhSachKhongThi.AddTuDong(pKQHT_DanhSachKhongThiInfo);
            mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
            mErrorNumber  = oDKQHT_DanhSachKhongThi.ErrorNumber;
            return(ID);
        }
 public void ToInfo(ref KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo, DataRow dr)
 {
     pKQHT_DanhSachKhongThiInfo.KQHT_DanhSachKhongThiID = int.Parse(dr[pKQHT_DanhSachKhongThiInfo.strKQHT_DanhSachKhongThiID].ToString());
     pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien           = int.Parse(dr[pKQHT_DanhSachKhongThiInfo.strIDSV_SinhVien].ToString());
     pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc             = int.Parse(dr[pKQHT_DanhSachKhongThiInfo.strIDDM_MonHoc].ToString());
     pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc             = int.Parse(dr[pKQHT_DanhSachKhongThiInfo.strIDDM_NamHoc].ToString());
     pKQHT_DanhSachKhongThiInfo.HocKy = int.Parse(dr[pKQHT_DanhSachKhongThiInfo.strHocKy].ToString());
     pKQHT_DanhSachKhongThiInfo.LyDo  = dr[pKQHT_DanhSachKhongThiInfo.strLyDo].ToString();
 }
예제 #7
0
 public frmXetThiHetMon()
 {
     InitializeComponent();
     oBDM_Lop                   = new cBDM_Lop();
     oBXL_MonHocTrongKy         = new cBXL_MonHocTrongKy();
     pKQHT_DanhSachKhongThiInfo = new KQHT_DanhSachKhongThiInfo();
     oBKQHT_DanhSachKhongThi    = new cBKQHT_DanhSachKhongThi();
     pDM_LopInfo                = new DM_LopInfo();
 }
        //public int Add(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        //{
        //    int ID = 0;
        //    var client = new UnimOsServiceClient();
        //    ID = client.cDKQHT_DanhSachKhongThi_Add(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo);
        //    client.Close();
        //    mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
        //    mErrorNumber = oDKQHT_DanhSachKhongThi.ErrorNumber;
        //    return ID;
        //}

        public int AddTuDong(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            int ID     = 0;
            var client = new UnimOsServiceClient();

            ID = client.cDKQHT_DanhSachKhongThi_AddTuDong(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo);
            client.Close();
            mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
            mErrorNumber  = oDKQHT_DanhSachKhongThi.ErrorNumber;
            return(ID);
        }
예제 #9
0
        public void DeleteTuDong(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@IDSV_SinhVien", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien));
            colParam.Add(CreateParam("@IDDM_MonHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc));
            colParam.Add(CreateParam("@IDDM_NamHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc));
            colParam.Add(CreateParam("@HocKy", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.HocKy));
            colParam.Add(CreateParam("@LanThi", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.LanThi));

            RunProcedure("sp_KQHT_DanhSachKhongThi_DeleteTuDong", colParam);
        }
예제 #10
0
        public void DeleteDanhSachDuThi(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo, int IDXL_MonHocTrongKy)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@IDXL_MonHocTrongKy", SqlDbType.Int, IDXL_MonHocTrongKy));
            colParam.Add(CreateParam("@IDDM_MonHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc));
            colParam.Add(CreateParam("@IDDM_NamHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc));
            colParam.Add(CreateParam("@HocKy", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.HocKy));
            colParam.Add(CreateParam("@LanThi", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.LanThi));

            RunProcedure("sp_KQHT_DanhSachKhongThi_DeleteDanhSachDuThi", colParam);
        }
        public void Update(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@IDSV_SinhVien", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien));
            colParam.Add(CreateParam("@IDDM_MonHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc));
            colParam.Add(CreateParam("@IDDM_NamHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc));
            colParam.Add(CreateParam("@HocKy", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.HocKy));
            colParam.Add(CreateParam("@LanThi", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.LanThi));
            colParam.Add(CreateParam("@LyDo", SqlDbType.NVarChar, pKQHT_DanhSachKhongThiInfo.LyDo));
            colParam.Add(CreateParam("@KQHT_DanhSachKhongThiID", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.KQHT_DanhSachKhongThiID));

            RunProcedure("sp_KQHT_DanhSachKhongThi_Update", colParam);
        }
        public int Add(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@IDSV_SinhVien", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien));
            colParam.Add(CreateParam("@IDDM_MonHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc));
            colParam.Add(CreateParam("@IDDM_NamHoc", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc));
            colParam.Add(CreateParam("@HocKy", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.HocKy));
            colParam.Add(CreateParam("@LanThi", SqlDbType.Int, pKQHT_DanhSachKhongThiInfo.LanThi));
            colParam.Add(CreateParam("@LyDo", SqlDbType.NVarChar, pKQHT_DanhSachKhongThiInfo.LyDo));
            colParam.Add(CreateParamOut("@ID", SqlDbType.Int));

            return((int)RunProcedureOut("sp_KQHT_DanhSachKhongThi_Add", colParam));
        }
        public List <KQHT_DanhSachKhongThiInfo> GetList(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
        {
            List <KQHT_DanhSachKhongThiInfo> oKQHT_DanhSachKhongThiInfoList = new List <KQHT_DanhSachKhongThiInfo>();
            DataTable dtb = Get(pKQHT_DanhSachKhongThiInfo);

            if (dtb != null)
            {
                for (int i = 0; i < dtb.Rows.Count; i++)
                {
                    oKQHT_DanhSachKhongThiInfo = new KQHT_DanhSachKhongThiInfo();

                    oKQHT_DanhSachKhongThiInfo.KQHT_DanhSachKhongThiID = int.Parse(dtb.Rows[i]["KQHT_DanhSachKhongThiID"].ToString());
                    oKQHT_DanhSachKhongThiInfo.IDSV_SinhVien           = int.Parse(dtb.Rows[i]["IDSV_SinhVien"].ToString());
                    oKQHT_DanhSachKhongThiInfo.IDDM_MonHoc             = int.Parse(dtb.Rows[i]["IDDM_MonHoc"].ToString());
                    oKQHT_DanhSachKhongThiInfo.IDDM_NamHoc             = int.Parse(dtb.Rows[i]["IDDM_NamHoc"].ToString());
                    oKQHT_DanhSachKhongThiInfo.HocKy = int.Parse(dtb.Rows[i]["HocKy"].ToString());
                    oKQHT_DanhSachKhongThiInfo.LyDo  = dtb.Rows[i]["LyDo"].ToString();

                    oKQHT_DanhSachKhongThiInfoList.Add(oKQHT_DanhSachKhongThiInfo);
                }
            }
            return(oKQHT_DanhSachKhongThiInfoList);
        }
 public void DeleteDanhSachDuThi(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo, int IDXL_MonHocTrongKy)
 {
     oDKQHT_DanhSachKhongThi.DeleteDanhSachDuThi(pKQHT_DanhSachKhongThiInfo, IDXL_MonHocTrongKy);
     mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
     mErrorNumber  = oDKQHT_DanhSachKhongThi.ErrorNumber;
 }
 public void Delete(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
 {
     oDKQHT_DanhSachKhongThi.Delete(pKQHT_DanhSachKhongThiInfo);
     mErrorMessage = oDKQHT_DanhSachKhongThi.ErrorMessages;
     mErrorNumber  = oDKQHT_DanhSachKhongThi.ErrorNumber;
 }
 public DataTable Get(KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo)
 {
     return(oDKQHT_DanhSachKhongThi.Get(pKQHT_DanhSachKhongThiInfo));
 }
        public void TinhDiemTBHS_QCNghe(DataTable dtSV, DataRow drMonHoc, int IDDM_Lop, int IDDM_TrinhDo, int IDDM_NamHoc, int HocKy, int IDKQHT_ThanhPhanDiem, int LanThi, string CongThucDiem, int NS_GiaoVienID)
        {
            DataTable dtDiem               = GetTongHopTBHS(int.Parse(drMonHoc["XL_MonHocTrongKyID"].ToString()), int.Parse(drMonHoc["DM_MonHocID"].ToString()), IDDM_Lop, IDDM_TrinhDo, IDDM_NamHoc, HocKy, LanThi);
            DataTable dtTPBatBuoc          = (new cDKQHT_ThanhPhanDiemBatBuoc()).GetByTrinhDo(IDDM_TrinhDo);
            string    TinhCaTietNghiCoPhep = (new cBwsHT_ThamSoHeThong()).GetGiaTriByMaThamSo("TinhCaTietNghiCoPhep");
            string    LyDo;
            //int SoTietNghi;
            double DiemThapNhat = double.Parse((new cBwsHT_ThamSoHeThong()).GetGiaTriByMaThamSo("DieuKienDiemDuThi"));

            DataRow[] arrDr, arrDrTPBatBuoc;

            KQHT_DiemThanhPhanInfo pKQHT_DiemThanhPhanInfo = new KQHT_DiemThanhPhanInfo();

            pKQHT_DiemThanhPhanInfo.IDDM_MonHoc        = int.Parse(drMonHoc["DM_MonHocID"].ToString());
            pKQHT_DiemThanhPhanInfo.IDXL_MonHocTrongKy = int.Parse(drMonHoc["XL_MonHocTrongKyID"].ToString());
            pKQHT_DiemThanhPhanInfo.IDDM_NamHoc        = IDDM_NamHoc;
            pKQHT_DiemThanhPhanInfo.HocKy = HocKy;
            pKQHT_DiemThanhPhanInfo.IDKQHT_ThanhPhanDiem = IDKQHT_ThanhPhanDiem;
            pKQHT_DiemThanhPhanInfo.IDHT_User            = NS_GiaoVienID;
            pKQHT_DiemThanhPhanInfo.DiemThu = LanThi;
            pKQHT_DiemThanhPhanInfo.DiemLan = LanThi;

            cDKQHT_DanhSachKhongThi   oDKQHT_DanhSachKhongThi    = new cDKQHT_DanhSachKhongThi();
            KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo = new KQHT_DanhSachKhongThiInfo();

            pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc = pKQHT_DiemThanhPhanInfo.IDDM_MonHoc;
            pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc = IDDM_NamHoc;
            pKQHT_DanhSachKhongThiInfo.HocKy       = HocKy;

            foreach (DataRow dr in dtSV.Rows)
            {
                LyDo = "";
                // Kiểm tra số tiết nghỉ
                //SoTietNghi = int.Parse("0" + dr["KhongLyDo"]);
                //if (TinhCaTietNghiCoPhep != "0")
                //    SoTietNghi += int.Parse("0" + dr["CoLyDo"]);
                //if (SoTietNghi > SoTietNghiChoPhep * int.Parse("0" + drMonHoc["SoTiet"]))
                //{
                //    LyDo = "Nghỉ quá số tiết quy định;";
                //}
                // Kiểm tra số tiết học lại
                if ("" + dr["SoTietHocLai"] != "")
                {
                    LyDo = "Học lại " + dr["SoTietHocLai"] + " tiết";
                }
                // Kiểm tra số thành phần điểm
                arrDr = dtDiem.Select("IDSV_SinhVien = " + dr["SV_SinhVienID"]);
                if (arrDr.Length > 0)
                {
                    foreach (DataRow dr1 in arrDr)
                    {
                        arrDrTPBatBuoc = dtTPBatBuoc.Select("SoHocTrinh = " + drMonHoc["SoHocTrinh"] + " And IDKQHT_ThanhPhanDiem = " + dr1["IDKQHT_ThanhPhanDiem"]);
                        if (arrDrTPBatBuoc.Length > 0)
                        {
                            if (int.Parse("0" + dr1["SoDiem"]) < int.Parse("0" + arrDrTPBatBuoc[0]["SoDiemBatBuoc"]))
                            {
                                dr1["SoDiem"] = arrDrTPBatBuoc[0]["SoDiemBatBuoc"];
                                LyDo         += "Số thành phần của " + dr1["KyHieu"] + " ít hơn quy định;";
                            }
                        }
                    }
                    // Được phép tổng hợp điểm hệ số

                    pKQHT_DiemThanhPhanInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    pKQHT_DiemThanhPhanInfo.Diem          = TestCongThuc(arrDr, CongThucDiem);
                    dr[IDKQHT_ThanhPhanDiem.ToString() + "_" + LanThi.ToString()] = pKQHT_DiemThanhPhanInfo.Diem;
                    var client = new UnimOsServiceClient();
                    client.cDKQHT_DiemThanhPhan_Add(GlobalVar.MaXacThuc, pKQHT_DiemThanhPhanInfo);
                    client.Close();
                    if (pKQHT_DiemThanhPhanInfo.Diem < DiemThapNhat)
                    {
                        LyDo += "Điểm TBHS < " + DiemThapNhat.ToString() + ";";
                    }
                }
                else
                {
                    LyDo = "Chưa có điểm thành phần";
                    pKQHT_DiemThanhPhanInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    var client = new UnimOsServiceClient();
                    client.cDKQHT_DiemThanhPhan_DeleteByInfo(GlobalVar.MaXacThuc, pKQHT_DiemThanhPhanInfo);
                    client.Close();
                }

                if (LyDo != "" || "" + dr["SoTietHocLai"] != "")
                {
                    // Đưa SV vào danh sách không được thi
                    pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    pKQHT_DanhSachKhongThiInfo.LyDo          = LyDo;
                    pKQHT_DanhSachKhongThiInfo.LanThi        = LanThi;
                    if ("" + dr["SoTietHocLai"] != "")
                    {
                        pKQHT_DanhSachKhongThiInfo.SoTietHocLai = int.Parse("" + dr["SoTietHocLai"]);
                    }
                    else
                    {
                        pKQHT_DanhSachKhongThiInfo.SoTietHocLai = null;
                    }
                    var client = new UnimOsServiceClient();
                    client.cDKQHT_DanhSachKhongThi_AddTuDong(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo);
                    client.Close();
                    dr["LyDo"] = LyDo;
                }
                else if ("" + dr["LyDo"] != "" && "" + dr["SoTietHocLai"] == "")
                {
                    pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    pKQHT_DanhSachKhongThiInfo.LanThi        = LanThi;
                    var client = new UnimOsServiceClient();
                    client.cDKQHT_DanhSachKhongThi_DeleteTuDong(GlobalVar.MaXacThuc, pKQHT_DanhSachKhongThiInfo);
                    client.Close();
                    dr["LyDo"] = "";
                }
            }
        }
        public void TinhDiemTBHS(DataTable dtSV, DataRow drMonHoc, int IDDM_Lop, int IDDM_TrinhDo, int IDDM_NamHoc, int HocKy, int IDKQHT_ThanhPhanDiem, int LanThi, string CongThucDiem, int NS_GiaoVienID)
        {
            DataTable dtDiem               = GetTongHopTBHS(int.Parse(drMonHoc["XL_MonHocTrongKyID"].ToString()), int.Parse(drMonHoc["DM_MonHocID"].ToString()), IDDM_Lop, IDDM_TrinhDo, IDDM_NamHoc, HocKy, LanThi);
            DataTable dtTPBatBuoc          = (new cDKQHT_ThanhPhanDiemBatBuoc()).GetByTrinhDo(IDDM_TrinhDo);
            string    TinhCaTietNghiCoPhep = (new cBHT_ThamSoHeThong()).GetGiaTriByMaThamSo("TinhCaTietNghiCoPhep");
            string    LyDo;
            int       SoTietNghi;
            double    DiemThapNhat = double.Parse((new cBHT_ThamSoHeThong()).GetGiaTriByMaThamSo("DieuKienDiemDuThi"));

            DataRow[] arrDr, arrDrTPBatBuoc;

            KQHT_DiemThanhPhanInfo pKQHT_DiemThanhPhanInfo = new KQHT_DiemThanhPhanInfo();

            pKQHT_DiemThanhPhanInfo.IDDM_MonHoc        = int.Parse(drMonHoc["DM_MonHocID"].ToString());
            pKQHT_DiemThanhPhanInfo.IDXL_MonHocTrongKy = int.Parse(drMonHoc["XL_MonHocTrongKyID"].ToString());
            pKQHT_DiemThanhPhanInfo.IDDM_NamHoc        = IDDM_NamHoc;
            pKQHT_DiemThanhPhanInfo.HocKy = HocKy;
            pKQHT_DiemThanhPhanInfo.IDKQHT_ThanhPhanDiem = IDKQHT_ThanhPhanDiem;
            pKQHT_DiemThanhPhanInfo.IDHT_User            = NS_GiaoVienID;
            pKQHT_DiemThanhPhanInfo.DiemThu = LanThi;
            pKQHT_DiemThanhPhanInfo.DiemLan = LanThi;

            cDKQHT_DanhSachKhongThi   oDKQHT_DanhSachKhongThi    = new cDKQHT_DanhSachKhongThi();
            KQHT_DanhSachKhongThiInfo pKQHT_DanhSachKhongThiInfo = new KQHT_DanhSachKhongThiInfo();

            pKQHT_DanhSachKhongThiInfo.IDDM_MonHoc = pKQHT_DiemThanhPhanInfo.IDDM_MonHoc;
            pKQHT_DanhSachKhongThiInfo.IDDM_NamHoc = IDDM_NamHoc;
            pKQHT_DanhSachKhongThiInfo.HocKy       = HocKy;
            pKQHT_DanhSachKhongThiInfo.LanThi      = LanThi;

            foreach (DataRow dr in dtSV.Rows)
            {
                LyDo = "";
                // Kiểm tra số tiết nghỉ
                SoTietNghi = int.Parse("0" + dr["KhongLyDo"]);
                if (TinhCaTietNghiCoPhep != "0")
                {
                    SoTietNghi += int.Parse("0" + dr["CoLyDo"]);
                }
                if (SoTietNghi > SoTietNghiChoPhep * int.Parse("0" + drMonHoc["SoTiet"]))
                {
                    LyDo = "Nghỉ quá số tiết quy định;";
                }
                // Kiểm tra số thành phần điểm
                arrDr = dtDiem.Select("IDSV_SinhVien = " + dr["SV_SinhVienID"]);
                if (arrDr.Length > 0)
                {
                    foreach (DataRow dr1 in arrDr)
                    {
                        arrDrTPBatBuoc = dtTPBatBuoc.Select("SoHocTrinh = " + drMonHoc["SoHocTrinh"] + " And IDKQHT_ThanhPhanDiem = " + dr1["IDKQHT_ThanhPhanDiem"]);
                        if (arrDrTPBatBuoc.Length > 0)
                        {
                            if (int.Parse("0" + dr1["SoDiem"]) < int.Parse("0" + arrDrTPBatBuoc[0]["SoDiemBatBuoc"]))
                            {
                                dr1["SoDiem"] = arrDrTPBatBuoc[0]["SoDiemBatBuoc"];
                                LyDo         += "Số thành phần của " + dr1["KyHieu"] + " ít hơn quy định;";
                            }
                        }
                    }

                    // Được phép tổng hợp điểm hệ số
                    pKQHT_DiemThanhPhanInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    pKQHT_DiemThanhPhanInfo.Diem          = TestCongThuc(arrDr, CongThucDiem);

                    if (!(double.IsInfinity(pKQHT_DiemThanhPhanInfo.Diem) ||
                          double.IsNaN(pKQHT_DiemThanhPhanInfo.Diem) || double.IsNegativeInfinity(pKQHT_DiemThanhPhanInfo.Diem)))
                    {
                        dr[IDKQHT_ThanhPhanDiem.ToString() + "_" + LanThi.ToString()] = pKQHT_DiemThanhPhanInfo.Diem;
                        oDKQHT_DiemThanhPhan.Add(pKQHT_DiemThanhPhanInfo);

                        pKQHT_DiemThanhPhanInfo.Diem = 0;
                    }

                    if (pKQHT_DiemThanhPhanInfo.Diem < DiemThapNhat)
                    {
                        LyDo += "Điểm TBHS < " + DiemThapNhat.ToString() + ";";
                    }
                }
                else
                {
                    LyDo = "Chưa có điểm thành phần";
                    pKQHT_DiemThanhPhanInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    oDKQHT_DiemThanhPhan.DeleteByInfo(pKQHT_DiemThanhPhanInfo);
                }

                if (LyDo != "")
                {
                    // Đưa SV vào danh sách không được thi
                    pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    pKQHT_DanhSachKhongThiInfo.LyDo          = LyDo;
                    pKQHT_DanhSachKhongThiInfo.LanThi        = LanThi;
                    oDKQHT_DanhSachKhongThi.AddTuDong(pKQHT_DanhSachKhongThiInfo);
                    dr["LyDo"] = LyDo;
                }
                else if ("" + dr["LyDo"] != "")
                {
                    pKQHT_DanhSachKhongThiInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                    pKQHT_DanhSachKhongThiInfo.LanThi        = LanThi;
                    oDKQHT_DanhSachKhongThi.DeleteTuDong(pKQHT_DanhSachKhongThiInfo);
                    dr["LyDo"] = "";
                }
            }

            oDKQHT_DanhSachKhongThi.DeleteDanhSachDuThi(pKQHT_DanhSachKhongThiInfo, pKQHT_DiemThanhPhanInfo.IDXL_MonHocTrongKy);
        }