From 8143c601ae3c53e4185fe2f6abd11a0857ba933a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Tue, 18 Oct 2022 10:49:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserPages/InstitutionalEntryPage.cs | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/HKCardManager/UserPages/InstitutionalEntryPage.cs b/HKCardManager/UserPages/InstitutionalEntryPage.cs index 071bbe9..e1e201c 100644 --- a/HKCardManager/UserPages/InstitutionalEntryPage.cs +++ b/HKCardManager/UserPages/InstitutionalEntryPage.cs @@ -55,13 +55,20 @@ namespace HKCardManager.UserPages { if (HKLibHelper.DelOrg(res)) { - Global.OrgTables.Clear(); - Global.OrgTables = HKLibHelper.GetOrg(); - this.Invoke(() => + //Global.OrgTables.Clear(); + //Global.OrgTables = HKLibHelper.GetOrg(); + var result = HKLibHelper.GetOrg(); + if (result != null) { - dataGridView1.DataSource = null; - dataGridView1.DataSource = Global.OrgTables; - }); + this.Invoke(() => + { + dataGridView1.DataSource = null; + Global.OrgTables.Clear(); + Global.OrgTables = result; + dataGridView1.DataSource = Global.OrgTables; + }); + } + MessageLogNotify.GetInstance.Show($"机构:【{dataGridView1.Rows[index].Cells[0].Value?.ToString()}】 删除成功"); } else @@ -113,13 +120,18 @@ namespace HKCardManager.UserPages if (HKLibHelper.AlterOrg(changeName, id)) { - Global.OrgTables.Clear(); - Global.OrgTables = HKLibHelper.GetOrg(); - this.Invoke(() => + var result = HKLibHelper.GetOrg(); + if (result != null) { - dataGridView1.DataSource = null; - dataGridView1.DataSource = Global.OrgTables; - }); + this.Invoke(() => + { + dataGridView1.DataSource = null; + Global.OrgTables.Clear(); + Global.OrgTables = result; + dataGridView1.DataSource = Global.OrgTables; + }); + } + MessageLogNotify.GetInstance.Show($"{name} 机构修改成功"); } else