private void btnThemMoi_Click(object sender, EventArgs e) { frmThemQuanLiGiangDay frmThem = new frmThemQuanLiGiangDay(); frmThem.ShowDialog(); GetThongTinGiangDay(); }
private void btnChinhSua_Click(object sender, EventArgs e) { DataGridViewRow dgr = dgvQuanLiGiangDay.CurrentRow; if (dgvQuanLiGiangDay.SelectedRows.Count <= 0) { MessageBox.Show("Chọn bản ghi cần sửa!"); } else { QuanLiGiangDay ql = new QuanLiGiangDay(); ql.MaGiaoVien = dgr.Cells["magiaovien"].Value.ToString(); ql.MaMonHoc = dgr.Cells["mamonhoc"].Value.ToString(); ql.MaLop = dgr.Cells["tenlop"].Value.ToString(); ql.TietHoc = dgr.Cells["tiethoc"].Value.ToString(); ql.DiaDiem = dgr.Cells["diadiem"].Value.ToString(); ql.NgayBatDau = DateTime.Parse(dgr.Cells["ngaybatdau"].Value.ToString()); ql.NgayKetThuc = DateTime.Parse(dgr.Cells["ngayketthuc"].Value.ToString()); frmThemQuanLiGiangDay frmThem = new frmThemQuanLiGiangDay(ql, true); frmThem.ShowDialog(); GetThongTinGiangDay(); } }