private void btnThemMoi_Click(object sender, EventArgs e) { frmVatTu_ThemMoi frm = new frmVatTu_ThemMoi(); frm.Closed += delegate { LoadData(); this.Refresh(); }; frm.ShowDialog(); }
private void btnSua_Click(object sender, EventArgs e) { string maVT = grvData.GetRowCellValue(grvData.FocusedRowHandle, "MaVT").ToString(); if (string.IsNullOrEmpty(maVT)) { MessageBox.Show(string.Format("Vui lòng chọn bản ghi cần sửa!"), CommonConstant.MESSAGE_WARNING, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } frmVatTu_ThemMoi frm = new frmVatTu_ThemMoi(2, maVT); frm.Closed += delegate { LoadData(); this.Refresh(); }; frm.ShowDialog(); }