private void btnSuaQD_Click(object sender, EventArgs e) { dlgQDKyLuat dlg = new dlgQDKyLuat(EDIT_MODE.SUA); dlg.drQuyetDinh = drQuyetDinh; if (dlg.ShowDialog() == DialogResult.OK) { SuaThanhCong(); } }
private void btnThem_Click(object sender, EventArgs e) { if (dtSinhVien == null) { return; } DataRow[] arrDr = dtSinhVien.Select("Chon = 1"); if (arrDr.Length > 0) { dlgQDKyLuat dlg = new dlgQDKyLuat(EDIT_MODE.THEM); dlg.drQuyetDinh = dtQuyetDinh.NewRow(); if (dlg.ShowDialog() == DialogResult.OK) { try { DataRow drNew; dtQuyetDinh.Rows.Add(dlg.drQuyetDinh); pSV_SinhVien_KyLuatInfo.IDSV_QuyetDinhKyLuat = int.Parse(dlg.drQuyetDinh["SV_QuyetDinhKyLuatID"].ToString()); foreach (DataRow dr in arrDr) { pSV_SinhVien_KyLuatInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString()); pSV_SinhVien_KyLuatInfo.NgayXoaKyLuat = DateTime.Parse("01/01/1900"); pSV_SinhVien_KyLuatInfo.SV_SinhVien_KyLuatID = oBSV_SinhVien_KyLuat.Add(pSV_SinhVien_KyLuatInfo); drNew = dtKyLuat.NewRow(); drNew["Chon"] = false; drNew["SV_SinhVien_KyLuatID"] = pSV_SinhVien_KyLuatInfo.SV_SinhVien_KyLuatID; drNew["SV_SinhVienID"] = pSV_SinhVien_KyLuatInfo.IDSV_SinhVien; drNew["MaSinhVien"] = dr["MaSinhVien"]; drNew["HoVaTen"] = dr["HoVaTen"]; drNew["Ten"] = dr["Ten"]; drNew["NgaySinh"] = dr["NgaySinh"]; drNew["GioiTinh"] = dr["GioiTinh"]; drNew["TenLop"] = dr["TenLop"]; dtKyLuat.Rows.Add(drNew); dr["Chon"] = false; } } catch (Exception ex) { ThongBaoLoi(ex.Message); } } } else { ThongBao("Chưa chọn sinh viên nào để thêm."); } }