private void tsbAddUser_Click(object sender, EventArgs e) { FrmUser frm = new FrmUser(); if (frm.ShowDialog(this) == DialogResult.OK) { this.LoadUserView(); } }
private void tsbModifyUser_Click(object sender, EventArgs e) { if (dgvUserList.SelectedRows.Count == 0) { throw new ApplicationException("请先选择一个用户。"); } User user = (User)dgvUserList.SelectedRows[0].Tag; FrmUser frm = new FrmUser(user); if (frm.ShowDialog(this) == DialogResult.OK) { this.LoadUserView(); } }