//添加客户 private void ShowForm(int t) { var ac = new AddClient(); ac.Id = t; var result = ac.ShowDialog(); if (result == DialogResult.OK) { ShowCustomer(); } }
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Name == "tslblAdd") { var ac = new AddClient(); var result = ac.ShowDialog(); if (result == DialogResult.OK) { ShowCustomer(); } } if (e.ClickedItem.Name == "tslblMod") { ModClient(); } if (e.ClickedItem.Name == "tslblDel") { var status = MessageBox.Show("你确认删除所选择的行吗?", "确认对话框", MessageBoxButtons.YesNo); if (status == DialogResult.Yes) { DelClient(); } } }