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