Ejemplo n.º 1
0
 private bool TaoMoi(GiangVien gv)
 {
     try
     {
         gv.MaGV = txtMaGV.Text;
         if (!string.IsNullOrEmpty(txtHoTen.Text))
         {
             gv.HoTen = txtHoTen.Text;
         }
         else
         {
             MsgboxUtil.Exclamation("Họ tên giảng viên không được để trống");
             txtHoTen.Focus();
             return(false);
         }
         if (rdgGioiTinh.SelectedIndex == 0)
         {
             gv.GioiTinh = false;
         }
         else
         {
             gv.GioiTinh = true;
         }
         gv.MaTrinhDo = cmbTrinhDo.EditValue.ToString();
         if (!string.IsNullOrEmpty(txtDiaChi.Text))
         {
             gv.DiaChi = txtDiaChi.Text.Trim();
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 private void LoadLogs()
 {
     try
     {
         if (File.Exists(tenFile))
         {
             listViewEx1.Items.Clear();
             logs = LogFile.DocFile(tenFile);
             if (logs.Count > 0)
             {
                 groupControl1.Text = "Nhật ký hệ thống tháng: " + dateNgay.DateTime.ToString("MM/yyyy");
                 foreach (var log in logs)
                 {
                     ListViewItem item = new ListViewItem(new string[]
                                                          { log.ThoiGian.ToString("HH:mm:ss dd/MM/yyyy"),
                                                            log.Quyen,
                                                            log.TenNguoiDung,
                                                            log.ThaoTac });
                     listViewEx1.Items.Add(item);
                 }
             }
         }
         else
         {
             MsgboxUtil.Exclamation("Không tồn tại lịch sử cho tháng này");
             dateNgay.DateTime = DateTime.Parse(listViewEx1.Items[0].Text);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Return true nếu dữ liệu nhập OK. Ngược lại False
 /// </summary>
 /// <returns></returns>
 public bool KTTruocOK()
 {
     try
     {
         if (txtMatKhau.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Bạn chưa nhập mật khẩu");
             txtMatKhau.Focus();
             return(false);
         }
         if (txtNhapLai.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Bạn chưa nhập xác minh lại mật khẩu");
             txtNhapLai.Focus();
             return(false);
         }
         if (txtNhapLai.Text.Trim() != txtMatKhau.Text.Trim())
         {
             MsgboxUtil.Exclamation("Mật khẩu không khớp. Vui lòng xác minh lại");
             txtNhapLai.Focus();
             txtNhapLai.SelectAll();
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         ExceptionUtil.Throw(ex.Message);
         return(false);
     }
 }
Ejemplo n.º 4
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     try
     {
         PhanCong pc = new PhanCong()
         {
             MaPC   = txtMaPC.Text,
             MaGV   = cmbGiangVien.EditValue.ToString(),
             MaLop  = cmbLop.EditValue.ToString(),
             MaMH   = cmbMonHoc.EditValue.ToString(),
             NamHoc = dateNamHoc.DateTime.Year,
             HocKy  = (byte)numHocKy.Value
         };
         if (!PhanCongBUS.KiemTraTonTai(pc))
         {
             PhanCongBUS.Them(pc);
             StaticClass.LuuThayDoi();
             log.GhiFile("Thêm phân công giảng dạy: " + pc.MaPC);
             LoadSourceGridControl();
             txtMaPC.Text = PhanCongBUS.SinhMa();
         }
         else
         {
             MsgboxUtil.Exclamation("Đã tồn tại một phân công y hệt như thế này rồi. Vui lòng kiểm tra lại");
         }
     }
     catch (Exception ex)
     {
         ExceptionUtil.ThrowMsgBox(ex.Message);
     }
 }
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         PhongHoc p = new PhongHoc();
         if (!string.IsNullOrEmpty(txtMaPhong.Text))
         {
             p.MaPhong = txtMaPhong.Text;
         }
         else
         {
             MsgboxUtil.Exclamation("Mã phòng không được rỗng");
             return;
         }
         if (!string.IsNullOrEmpty(txtChucNang.Text))
         {
             p.ChucNang = txtChucNang.Text;
         }
         if (!string.IsNullOrEmpty(txtDiaChi.Text))
         {
             p.DiaChi = txtDiaChi.Text;
         }
         p.SucChua = (int)numSucChua.Value;
         PhongHocBUS.Them(p);
         StaticClass.LuuThayDoi();
         StaticClass.Log.GhiFile("Thêm mới phòng học: " + p.MaPhong);
         MsgboxUtil.Success("Thành công!");
         ClearText();
     }
     catch (Exception ex)
     {
         ExceptionUtil.ThrowMsgBox(ex.Message);
     }
 }
 private void txtTimKiem_KeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             if (bool.Parse(radioGroup1.EditValue.ToString()))//tim theo ten
             {
                 gridControlGV.DataSource = GiangVienBUS.DanhSachGiangVien().Where(gv => gv.HoTen.ToLower().Contains(txtTimKiem.Text.Trim().ToLower()));
             }
             else if (txtTimKiem.Text.Trim().Length == 6)//tim theo ma
             {
                 gridControlGV.DataSource = GiangVienBUS.DanhSachGiangVien().Where(gv => gv.MaGV.ToLower() == txtTimKiem.Text.Trim().ToLower());
             }
             else
             {
                 MsgboxUtil.Exclamation("Mã giảng viên không đúng định dạng");
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionUtil.ThrowMsgBox(ex.Message);
     }
 }
Ejemplo n.º 7
0
 private void btnTestConnection_Click(object sender, EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     try
     {
         //nếu một server được chọn
         if (!string.IsNullOrEmpty(cmbServerName.Text))
         {
             //tạo kết nối đến server
             string message = this.ConnectDatabase();
             //nếu kết nối thành công
             if (string.IsNullOrEmpty(message))
             {
                 //add những CSDL hiện có của server vào combobox
                 this.ListDatabasesInServer(null);
                 //tùy chỉnh
                 cmbDbName.Enabled          = true;
                 btnTaoMoi.Enabled          = true;
                 btnTaoMoiDuLieuMau.Enabled = true;
                 txtNewDB.Enabled           = true;
             }
             //nếu kết nối không thành công, xuất thông báo lỗi
             else
             {
                 MsgboxUtil.Exclamation(message);
                 return;
             }
         }
         else
         {
             MsgboxUtil.Exclamation("Bạn hãy chọn hoặc gõ tên 1 máy chủ để thực hiện");
             return;
         }
     }
     catch (Exception ex)
     {
         cmbDbName.Enabled          = false;
         btnTaoMoi.Enabled          = false;
         txtNewDB.Enabled           = false;
         btnTaoMoiDuLieuMau.Enabled = false;
         MsgboxUtil.Exclamation(ex.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Ejemplo n.º 8
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     try
     {
         if (NguoiDungBUS.KiemTraTenDangNhap(txtTenDangNhap.Text.Trim()))
         {
             NguoiDung user = NguoiDungBUS.LayThongTin(txtTenDangNhap.Text.Trim());
             if (user.MatKhau == UtilitiesClass.MaHoaMD5(txtMatKhau.Text))
             {
                 StaticClass.User             = user;
                 StaticClass.DangNhap         = true;
                 Settings.Default.TenDangNhap = user.TenDangNhap;
                 if (ckbNhoMatKhau.Checked)
                 {
                     Settings.Default.MatKhau = txtMatKhau.Text;
                 }
                 else
                 {
                     Settings.Default.MatKhau = "";
                 }
                 Settings.Default.Save();
                 DialogResult = DialogResult.OK;
                 StaticClass.Log.GhiFile("Đăng nhập hệ thống");
                 this.Close();
             }
             else
             {
                 MsgboxUtil.Exclamation("Mật khẩu không đúng.");
                 txtMatKhau.Focus();
                 txtMatKhau.SelectAll();
                 return;
             }
         }
         else
         {
             MsgboxUtil.Exclamation("Người dùng không tồn tại");
             txtTenDangNhap.Focus();
             txtTenDangNhap.SelectAll();
             return;
         }
     }
     catch (Exception ex)
     {
         MsgboxUtil.Error(ex.Message);
     }
 }
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         TrinhDo td = new TrinhDo();
         if (!string.IsNullOrEmpty(txtMaTrinhDo.Text))
         {
             td.MaTrinhDo = txtMaTrinhDo.Text.Trim();
         }
         else
         {
             MsgboxUtil.Exclamation("Mã trình độ không được để trống");
             txtMaTrinhDo.Focus();
             return;
         }
         if (!string.IsNullOrEmpty(txtTenTrinhDo.Text))
         {
             td.TenTrinhDo = txtTenTrinhDo.Text.Trim();
         }
         else
         {
             MsgboxUtil.Exclamation("Tên trình độ không được để trống");
             txtTenTrinhDo.Focus();
             return;
         }
         if (numLuong.Value > 0)
         {
             td.HeSoLuong = (int)numLuong.Value;
         }
         else
         {
             MsgboxUtil.Exclamation("Tên trình độ không được để trống");
             txtTenTrinhDo.Focus();
             return;
         }
         TrinhDoBUS.Them(td);
         StaticClass.LuuThayDoi();
         log.GhiFile("Thêm mới trình độ: " + td.MaTrinhDo);
         MsgboxUtil.Success("Thành công");
         btnHuy_Click(null, null);
     }
     catch (Exception ex)
     {
         ExceptionUtil.ThrowMsgBox(ex.Message);
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Loads list of user tables from the SQL database, and fills
        ///a ListBox control with tatble names
        /// </summary>
        private void LoadTables()
        {
            try
            {
                // Conncets to database, and selects the table names.
                SqlConnection  cn = new SqlConnection(QuanLyDaoTao.Properties.Settings.Default.ConnectString);
                SqlDataAdapter da = new SqlDataAdapter("select name from dbo.sysobjects where xtype = 'U' and name <> 'dtproperties' order by name", cn);
                DataTable      dt = new DataTable();

                // Fills the list to an DataTable.
                da.Fill(dt);

                // Clears the ListBox
                this.lsvTables.Items.Clear();

                // Fills the table names to the ListBox.
                // Notifies user if there is no user table in the database yet.
                if (dt.Rows.Count == 0)
                {
                    MsgboxUtil.Exclamation("Không tồn tại bất kỳ bảng nào trong CSDL: " + QuanLyDaoTao.Properties.Settings.Default.DatabaseName);
                    this.lsvTables.Items.Add("< Không tồn tại bảng nào >");
                    this.btnExportToExcel.Enabled = false;
                }
                else
                {
                    this.btnExportToExcel.Enabled = true;

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i][0].ToString() != "sysdiagrams")
                        {
                            this.lsvTables.Items.Add(new ListViewItem(dt.Rows[i][0].ToString())
                            {
                                ImageIndex = 0
                            });
                        }
                    }
                    this.lsvTables.Items[0].Selected = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 11
0
 private void btnDoiMK_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMKCu.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Vui lòng nhập mật khẩu cũ của bạn!");
             txtMKCu.Focus();
             return;
         }
         if (txtMKMoi.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Vui lòng nhập mật khẩu mới của bạn!");
             txtMKMoi.Focus();
             return;
         }
         if (txtNhapLai.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Vui lòng xác minh mật khẩu mới!");
             txtNhapLai.Focus();
             return;
         }
         if (txtMKMoi.Text.Trim() != txtNhapLai.Text.Trim())
         {
             MsgboxUtil.Exclamation("Xác minh mật khẩu không đúng. Vui lòng xác minh lại!");
             txtMKMoi.ResetText();
             txtNhapLai.ResetText();
             txtMKMoi.Focus();
             return;
         }
         if (NguoiDungBUS.DoiMatKhau(StaticClass.User.TenDangNhap, txtMKCu.Text, txtMKMoi.Text))
         {
             StaticClass.Log.GhiFile("Đổi mật khẩu");
             MsgboxUtil.Success("Mật khẩu của bạn đã được thay đổi");
             this.Close();
         }
     }
     catch (Exception ex)
     {
         ExceptionUtil.ThrowMsgBox(ex.Message);
     }
 }
 private bool TaoMoi(SinhVien sv)
 {
     try
     {
         sv.MSSV = txtMSSV.Text;
         if (!string.IsNullOrEmpty(txtHoTen.Text))
         {
             sv.HoTen = txtHoTen.Text;
         }
         else
         {
             MsgboxUtil.Exclamation("Họ tên sinh viên không được để trống");
             txtHoTen.Focus();
             return(false);
         }
         if (!string.IsNullOrEmpty(dateNgaySinh.Text))
         {
             sv.NgaySinh = dateNgaySinh.DateTime;
         }
         if (!string.IsNullOrEmpty(cmbLop.Text))
         {
             sv.MaLop = cmbLop.EditValue.ToString();
         }
         else
         {
             MsgboxUtil.Exclamation("Hãy chọn lớp cho sinh viên này");
             cmbLop.Focus();
             return(false);
         }
         if (!string.IsNullOrEmpty(txtDiaChi.Text))
         {
             sv.DiaChi = txtDiaChi.Text.Trim();
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     try
     {
         SinhVien sv = new SinhVien();
         if (TaoMoi(sv))
         {
             frmMatKhau frm = new frmMatKhau();
             frm.truyen += new frmMatKhau.TruyenMatKhau(GetMatKhau);
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 NguoiDung user = new NguoiDung()
                 {
                     TenDangNhap  = sv.MSSV.ToLower(),
                     MatKhau      = UtilitiesClass.MaHoaMD5(_matKhau),
                     TenNguoiDung = sv.HoTen,
                     Quyen        = (int)QuyenNguoiDung.SinhVien,
                     MoTaQuyen    = "Sinh viên"
                 };
                 NguoiDungBUS.Them(user);
                 SinhVienBUS.Them(sv);
                 StaticClass.LuuThayDoi();
                 log.GhiFile("Thêm mới sinh viên: " + sv.MSSV);
                 MsgboxUtil.Success("Thành công");
                 ClearText();
                 TaoMa();
             }
             else
             {
                 MsgboxUtil.Exclamation("Không thể thêm sinh viên khi chưa thiết lập mật khẩu");
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionUtil.ThrowMsgBox(ex.Message);
     }
 }
Ejemplo n.º 14
0
        private bool TaoMoi(NganhHoc nh)
        {
            try
            {
                if (!string.IsNullOrEmpty(txtMaNganh.Text))
                {
                    nh.MaNganh = txtMaNganh.Text;
                }
                else
                {
                    MsgboxUtil.Exclamation("Mã ngành học không được để trống");
                    txtMaNganh.Focus();
                    return(false);
                }

                if (!string.IsNullOrEmpty(txtTenNganh.Text))
                {
                    nh.TenNganh = txtTenNganh.Text;
                }
                else
                {
                    MsgboxUtil.Exclamation("Tên ngành học không được để trống");
                    txtTenNganh.Focus();
                    return(false);
                }

                if (!string.IsNullOrEmpty(txtKhoa.Text))
                {
                    nh.Khoa = txtKhoa.Text;
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 15
0
 public bool KiemTra()
 {
     try
     {
         if (txtTenDangNhap.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Bạn chưa nhập Tên người dùng");
             txtTenDangNhap.Focus();
             return(false);
         }
         if (txtMatKhau.Text.Trim().Length == 0)
         {
             MsgboxUtil.Exclamation("Bạn chưa nhập Mật khẩu");
             txtMatKhau.Focus();
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 16
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                QuanLyDaoTao.Properties.Settings.Default.Server = cmbServerName.SelectedValue.ToString();
                QuanLyDaoTao.Properties.Settings.Default.SQLAuthenticationMode = rdbServerAuthentication.Checked;
                if (!string.IsNullOrEmpty(cmbDbName.Text))
                {
                    QuanLyDaoTao.Properties.Settings.Default.DatabaseName = cmbDbName.SelectedItem.ToString();
                }
                else
                {
                    QuanLyDaoTao.Properties.Settings.Default.DatabaseName = string.Empty;
                }

                //nếu chọn check box nhớ mật khẩu
                if (ckbRemeberPass.Checked)
                {
                    QuanLyDaoTao.Properties.Settings.Default.UserName     = txtUserName.Text;
                    QuanLyDaoTao.Properties.Settings.Default.Password     = txtPassword.Text;
                    QuanLyDaoTao.Properties.Settings.Default.SavePassword = true;
                }
                else
                {
                    QuanLyDaoTao.Properties.Settings.Default.UserName     = txtUserName.Text;
                    QuanLyDaoTao.Properties.Settings.Default.Password     = txtPassword.Text;
                    QuanLyDaoTao.Properties.Settings.Default.SavePassword = false;
                }
                //tạo kết nối đến server
                string message = ConnectDatabase();
                //nếu kết nối ko thành công
                if (!string.IsNullOrEmpty(message))
                {
                    MsgboxUtil.Exclamation(message);
                }
                //kết nối thành công
                else
                {
                    //chưa chọn database
                    if (QuanLyDaoTao.Properties.Settings.Default.DatabaseName == "")
                    {
                        MsgboxUtil.Exclamation("Chưa chọn database!");
                        return;
                    }
                    if (!this.CheckExists_Tables(QuanLyDaoTao.Properties.Settings.Default.DatabaseName))
                    {
                        this.InitStruct_DB(QuanLyDaoTao.Properties.Settings.Default.DatabaseName);
                    }

                    QuanLyDaoTao.Properties.Settings.Default.ConnectString = frmAddConnection.BuildConnectionString();
                    QuanLyDaoTao.Properties.Settings.Default.Save();
                    this.DialogResult = DialogResult.OK;
                    if (StaticClass.DangNhap)
                    {
                        StaticClass.Log.GhiFile("Kết nối với CSDL: " + QuanLyDaoTao.Properties.Settings.Default.DatabaseName);
                    }
                    MsgboxUtil.Info("Ứng dụng sẽ tự khởi động lại để cấu hình kết nối!");
                    DialogResult = DialogResult.OK;
                    Application.Restart();
                }
            }
            catch (Exception ex)
            {
                ExceptionUtil.ThrowMsgBox(ex.Message);
            }
        }
        private void btnLuu_Click(object sender, EventArgs e)
        {
            try
            {
                MonHoc mh = new MonHoc();
                if (!string.IsNullOrEmpty(txtMaMH.Text))
                {
                    mh.MaMH = txtMaMH.Text.Trim();
                }
                else
                {
                    MsgboxUtil.Exclamation("Mã môn học không được để trống");
                    txtMaMH.Focus();
                    return;
                }
                if (!string.IsNullOrEmpty(txtTenMH.Text))
                {
                    mh.TenMH = txtTenMH.Text.Trim();
                }
                else
                {
                    MsgboxUtil.Exclamation("Tên môn học không được để trống");
                    txtTenMH.Focus();
                    return;
                }
                if (numSTC.Value > 0)
                {
                    mh.STC = (byte)numSTC.Value;
                }
                else
                {
                    MsgboxUtil.Exclamation("Số tín chỉ không thể nhỏ hơn 0");
                    numSTC.Focus();
                    return;
                }

                if (numLyThuyet.Value > 0)
                {
                    mh.LyThuyet = (byte)numLyThuyet.Value;
                }
                else
                {
                    MsgboxUtil.Exclamation("Số tiết lý thuyết không thể nhỏ hơn 0");
                    numLyThuyet.Focus();
                    return;
                }

                if (numThucHanh.Value >= 0)
                {
                    mh.ThucHanh = (byte)numThucHanh.Value;
                }
                else
                {
                    MsgboxUtil.Exclamation("Số tiết thực hành không thể nhỏ hơn 0");
                    numThucHanh.Focus();
                    return;
                }
                MonHocBUS.Them(mh);
                StaticClass.LuuThayDoi();
                log.GhiFile("Thêm mới môn học: " + mh.MaMH);
                MsgboxUtil.Success("Thành công");
                btnHuy_Click(null, null);
            }
            catch (Exception ex)
            {
                ExceptionUtil.ThrowMsgBox(ex.Message);
            }
        }
Ejemplo n.º 18
0
        public bool ThemBuoiHoc(Thu thu, int tietBD, int soTiet, string monHoc, string lop, string maPC)
        {
            try
            {
                if (tietBD < 0 || tietBD > 9)
                {
                    throw new Exception("Tiết bắt đầu không hợp lệ.");
                }
                if (soTiet < 1 || soTiet > 5)
                {
                    throw new Exception("Số tiết không hợp lệ.");
                }

                int idBuoiHoc = idBuoiHoc = BuoiHocBUS.LayMaCuoiCung() + 1;

                //kiem tra co ton tai buoi hoc chua
                bool tonTaiBuoiHoc = false;

                foreach (BuoiHoc b in buoiHocs)
                {
                    if (b.Ngay == ngayDauTuan.AddDays((int)thu) && b.TietBatDau == tietBD && b.SoTiet == soTiet)
                    {
                        idBuoiHoc     = b.BuoiHoc1;
                        tonTaiBuoiHoc = true;
                        if (deNghis.Any(i => i.MaPC == maPC && i.BuoiHoc == idBuoiHoc))
                        {
                            MsgboxUtil.Exclamation("Đã tồn tại một đề nghị như thế này rồi.");
                            return(false);
                        }
                    }
                }

                //them buoi hoc
                if (!tonTaiBuoiHoc)//neu chua ton tai buoi hoc
                {
                    buoiHocs.Add(new BuoiHoc()
                    {
                        BuoiHoc1 = idBuoiHoc, Ngay = ngayDauTuan.AddDays((int)thu), SoTiet = (byte)soTiet, TietBatDau = (byte)tietBD
                    });
                }

                //kiểm tra không cho trùng
                int      tietKT      = tietBD + soTiet - 1;
                DateTime ngayDangXet = ngayDauTuan.AddDays((int)thu);
                foreach (var i in deNghis)
                {
                    BuoiHoc b = buoiHocs.Single(c => c.BuoiHoc1 == i.BuoiHoc);

                    if (b.Ngay == ngayDangXet)
                    {
                        int tietKTCu = b.TietBatDau + b.SoTiet - 1;
                        if (tietBD == b.TietBatDau)
                        {
                            MsgboxUtil.Exclamation("Trùng rồi bạn ơi");
                            return(false);
                        }
                        if (tietBD < b.TietBatDau && tietKT >= b.TietBatDau)
                        {
                            MsgboxUtil.Exclamation("Trùng rồi bạn ơi");
                            return(false);
                        }
                        if (tietBD > b.TietBatDau && tietKT <= tietKTCu)
                        {
                            MsgboxUtil.Exclamation("Trùng rồi bạn ơi");
                            return(false);
                        }
                        if (tietBD == tietKTCu)
                        {
                            MsgboxUtil.Exclamation("Trùng rồi bạn ơi");
                            return(false);
                        }
                    }
                }

                //vẽ các panel
                Paint((int)thu, tietBD, soTiet, lop, monHoc);
                deNghis.Add(new DeNghi()
                {
                    BuoiHoc = idBuoiHoc, MaPC = maPC
                });

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }