private void button1_Click(object sender, EventArgs e) { frmEditUser editor = new frmEditUser(this.isAdministrator); if (editor.ShowDialog() == DialogResult.OK) { this.repository.AddUser(editor.user); { this.ViewAll(); } } }
private void button2_Click(object sender, EventArgs e) { User User = this.GetFirstSelectedUser(); if (User != null) { int oldId = User.Id; frmEditUser editor = new frmEditUser(User); if (editor.ShowDialog() == DialogResult.OK) { this.repository.EditUser(oldId, User); { this.ViewAll(); } } } }