public async void LoadData() { grdLoader.Visibility = Visibility.Visible; GenericResponse genericResponse = await BankChecks.GetList(Filter, OrderBy, OrderType, Page); TotalPages = genericResponse.TotalPages; if (genericResponse.Items.Count > 0) { grdNoRegisters.Visibility = Visibility.Collapsed; } else { grdNoRegisters.Visibility = Visibility.Visible; } lstItems.ItemsSource = genericResponse.Items; grdLoader.Visibility = Visibility.Collapsed; if (Page == 1) { btnFirst.IsEnabled = false; btnPrevious.IsEnabled = false; } if (Page > 1) { btnFirst.IsEnabled = true; btnPrevious.IsEnabled = true; } if (Page < TotalPages) { btnNext.IsEnabled = true; btnLast.IsEnabled = true; } if (Page == TotalPages) { btnNext.IsEnabled = false; btnLast.IsEnabled = false; } txtRegister.Text = genericResponse.PageString; }
private async void DisplayDeleteDialog(BankCheck bank) { ContentDialog deleteFileDialog = new ContentDialog { Title = "¿Está seguro que desea eliminar este registro?", Content = "El registro se borrará de forma permanente", PrimaryButtonText = "Borrar", CloseButtonText = "Cancelar" }; ContentDialogResult result = await deleteFileDialog.ShowAsync(); // Delete the file if the user clicked the primary button. /// Otherwise, do nothing. if (result == ContentDialogResult.Primary) { bool api_result = await BankChecks.Delete(bank.Id); if (api_result) { LoadData(); } } }