private void barbtnThemMoi_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            dlgCT_KhoiKienThuc dlg = new dlgCT_KhoiKienThuc(pKQHT_CT_KhoiKienThucInfo, EDIT_MODE.THEM, mMaxCTSo);

            dlg.ShowDialog();
            if (dlg.Tag.ToString() == "1")
            {
                try
                {
                    pKQHT_CT_KhoiKienThucInfo = dlg.pCTDT;
                    pKQHT_CT_KhoiKienThucInfo.KQHT_CT_KhoiKienThucID = oBKQHT_CT_KhoiKienThuc.Add(pKQHT_CT_KhoiKienThucInfo);
                    DataRow drNew = dtCTDT.NewRow();
                    oBKQHT_CT_KhoiKienThuc.ToDataRow(pKQHT_CT_KhoiKienThucInfo, ref drNew);
                    drNew["TenTrinhDo"] = dlg.cmbTrinhDo.Text;
                    DM_HeInfo pDM_HeInfo = new DM_HeInfo();
                    pDM_HeInfo.DM_HeID       = int.Parse(dlg.cmbTrinhDo.GetColumnValue("IDDM_He").ToString());
                    drNew["TenHe"]           = new cBDM_He().Get(pDM_HeInfo).Rows[0]["TenHe"].ToString();
                    drNew["TenKhoiKienThuc"] = dlg.cmbKhoiKienThuc.Text;
                    drNew["TenNganh"]        = dlg.ucmbNganh.cmb.Text;
                    drNew["TenChuyenNganh"]  = dlg.ucmbChuyenNganh.cmb.Text;
                    drNew["TenKhoaHoc"]      = dlg.cmbKhoaHoc.Text;
                    dtCTDT.Rows.Add(drNew);
                    //LoadCTDT();
                    dlgCTDTChonMonHoc dlgMon = new dlgCTDTChonMonHoc(pKQHT_CT_KhoiKienThucInfo.KQHT_CT_KhoiKienThucID, pKQHT_CT_KhoiKienThucInfo.TenCT_KhoiKienThuc, ref dtMonHoc);
                    dlgMon.ShowDialog();
                    // Ghi Log
                    GhiLog("Thêm chương trình khối kiến thức '" + pKQHT_CT_KhoiKienThucInfo.TenCT_KhoiKienThuc + "'", "Thêm", this.Tag.ToString());
                    ThemThanhCong();
                }
                catch (Exception ex)
                {
                    ThongBao(ex.Message);
                }
            }
        }
 private void barbtnSua_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (grvCTDT.FocusedRowHandle >= 0)
     {
         dlgCT_KhoiKienThuc dlg = new dlgCT_KhoiKienThuc(pKQHT_CT_KhoiKienThucInfo, EDIT_MODE.SUA, mMaxCTSo);
         dlg.ShowDialog();
         if (dlg.Tag.ToString() == "1")
         {
             try
             {
                 pKQHT_CT_KhoiKienThucInfo = dlg.pCTDT;
                 oBKQHT_CT_KhoiKienThuc.Update(pKQHT_CT_KhoiKienThucInfo);
                 // Ghi Log
                 GhiLog("Sửa chương trình khối kiến thức '" + pKQHT_CT_KhoiKienThucInfo.TenCT_KhoiKienThuc + "'", "Sửa", this.Tag.ToString());
                 LoadCTDT();
                 SuaThanhCong();
             }
             catch (Exception ex)
             {
                 ThongBao(ex.Message);
             }
         }
     }
     else
     {
         ThongBao("Bạn chưa chọn chương trình khối kiến thức nào.");
     }
 }