private void BtnDeleteEmployee_Click(object sender, RoutedEventArgs e) { RefreshLabels(); MessageBoxResult result = MessageBox.Show("Are you sure that you want to delete this employee ?", "Delete", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { UserApiService service = new UserApiService(); var del_emp = (UserVM)dgShowEmployees.SelectedItem; servise.Delete(new UserDeleteVM { Id = del_emp.Id }); FillDG(); txtEmail.Text = ""; txtName.Text = ""; } }
protected async Task HandleDelete() { await UserApiService.Delete(Id); NavigationManager.NavigateTo("admin/users"); }