private void btnNew_Click(object sender, EventArgs e) { User user = new User(); frmEditUser frm = new frmEditUser(user); if (frm.ShowDialog() == DialogResult.OK) { RefreshUsers(); } }
private void btnEdit_Click(object sender, EventArgs e) { if (lbUsers.SelectedIndex >= 0) { UsersRepository usersRepo = new UsersRepository(); User user = (User)lbUsers.SelectedItem; frmEditUser frm = new frmEditUser(user); if (frm.ShowDialog() == DialogResult.OK) { RefreshUsers(); } } }