private void btnCapNhat_Click(object sender, EventArgs e) { if (!CheckValid()) { return; } try { GetpInfo(); if (edit == EDIT_MODE.THEM) { pSV_QuyetDinhKyLuatInfo.SV_QuyetDinhKyLuatID = oBSV_QuyetDinhKyLuat.Add(pSV_QuyetDinhKyLuatInfo); GhiLog("Thêm quyết định kỷ luật '" + pSV_QuyetDinhKyLuatInfo.SoQuyetDinh + "' vào CSDL ", "Thêm", this.Tag.ToString()); oBSV_QuyetDinhKyLuat.ToDataRow(pSV_QuyetDinhKyLuatInfo, ref drQuyetDinh); } else { pSV_QuyetDinhKyLuatInfo.SV_QuyetDinhKyLuatID = int.Parse(drQuyetDinh[pSV_QuyetDinhKyLuatInfo.strSV_QuyetDinhKyLuatID].ToString()); oBSV_QuyetDinhKyLuat.Update(pSV_QuyetDinhKyLuatInfo); GhiLog("Sửa quyết định kỷ luật '" + pSV_QuyetDinhKyLuatInfo.SoQuyetDinh + "' trong CSDL ", "Sửa", this.Tag.ToString()); oBSV_QuyetDinhKyLuat.ToDataRow(pSV_QuyetDinhKyLuatInfo, ref drQuyetDinh); } drQuyetDinh["TenHanhVi"] = cmbLoaiKyLuat.Text; this.DialogResult = DialogResult.OK; this.Close(); } catch { } }