private void btn_add_Click(object sender, EventArgs e) { var obj = new MaintenancePerson(Action.Add); obj.DefineControlVisible(new User()); obj.ShowDialog(); DisplayUsers(); }
private void btn_edit_Click(object sender, EventArgs e) { var selectedId = (int)UserData.SelectedRows[0].Cells[0].Value; var user = GetUser(selectedId); var obj = new MaintenancePerson(Action.Edit, user); obj.DefineControlVisible(new User()); obj.ShowDialog(); DisplayUsers(); }