private void bindingNavigatorAddNewItem_Click_1(object sender, EventArgs e) { if (dGVGiaoVien.RowCount == 0) { bindingNavigatorDeleteItem.Enabled = true; } DataRow m_Row = m_GiaoVienCtrl.ThemDongMoi(); m_Row["MaGiaoVien"] = "GV" + quyDinh.LaySTT(dGVGiaoVien.Rows.Count + 1); m_Row["TenGiaoVien"] = ""; m_Row["DiaChi"] = ""; m_Row["DienThoai"] = ""; m_Row["MaMonHoc"] = ""; m_GiaoVienCtrl.ThemGiaoVien(m_Row); bindingNavigatorGiaoVien.BindingSource.MoveLast(); }
private void simpleButtonThem_Click(object sender, EventArgs e) { if (_isAddButton) { _Disable_Control(editing: true); DataRow m_Row = m_GiaoVienCtrl.ThemDongMoi(); m_Row["MaGiaoVien"] = "GV" + quyDinh.LaySTT1(dGVGiaoVien.Rows.Count + 1); m_Row["TenGiaoVien"] = ""; m_Row["MaMonHoc"] = ""; m_GiaoVienCtrl.ThemGiaoVien(m_Row); bindingNavigatorGiaoVien.BindingSource.MoveLast(); } else { _Disable_Control(editing: false); m_MonHocCtrl.HienThiDataGridViewComboBoxColumnGiaoVien(colMaMonHoc); m_GiaoVienCtrl.HienThi(dGVGiaoVien, bindingNavigatorGiaoVien); } }