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  = "";
            }
        }
Example #2
0
        protected async Task HandleDelete()
        {
            await UserApiService.Delete(Id);

            NavigationManager.NavigateTo("admin/users");
        }