private void BtnDelete_Click(object sender, EventArgs e) { _candidateRepository.Delete(txtFirstName.Text.Trim(), txtLastName.Text.Trim()); SharedViewLogic.LoadCandidatesTree(_treeView, _candidateRepository); var parentNode = _treeView.Nodes.Find(_info.LastName.First().ToString(), false).FirstOrDefault(); SharedViewLogic.LoadCandidatesGrid(_dgvCandidates, parentNode?.Nodes ?? (IEnumerable)Enumerable.Empty <TreeNode>()); Close(); }
private void ButtonDelete_OnClick(object sender, RoutedEventArgs e) { var document = DataContext as CandidateInfo; _repository.Delete(document.FirstName, document.LastName); }